java.lang.Objectmst.MSTProblem
public class MSTProblem
Contains an instance of MST.
Problem| Field Summary | |
|---|---|
java.util.ArrayList<java.util.ArrayList<GraphEdge>> |
adjList
Adjacency list representation. |
java.lang.String |
errorMessage
This is useful to problem-generating algorithms. |
boolean |
isEuclidean
Vertices are 2D points. |
int |
numNodes
The number of nodes in the graph. |
Pointd[] |
points
For Euclidean case, we'll store the original points as well. |
java.lang.String |
topMessage
|
| Constructor Summary | |
|---|---|
MSTProblem()
|
|
MSTProblem(int numNodes)
|
|
MSTProblem(Pointd[] points)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getErrorMessage()
Retrieve error message about an invalid problem. |
void |
readFromFile(java.io.File f)
Read the problem in plain text from the given file. |
java.lang.String |
toString()
Returns a problem description summary. |
void |
writeToFile(java.io.File f)
Write the problem in plain text to the given file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int numNodes
public java.util.ArrayList<java.util.ArrayList<GraphEdge>> adjList
public boolean isEuclidean
public Pointd[] points
public java.lang.String errorMessage
public java.lang.String topMessage
| Constructor Detail |
|---|
public MSTProblem(Pointd[] points)
public MSTProblem(int numNodes)
public MSTProblem()
| Method Detail |
|---|
public void writeToFile(java.io.File f)
Problem
writeToFile in interface Problemf - a File valuepublic void readFromFile(java.io.File f)
Problem
readFromFile in interface Problemf - a File valuepublic java.lang.String toString()
Problem
toString in interface ProblemtoString in class java.lang.ObjectString valuepublic java.lang.String getErrorMessage()
Problem
getErrorMessage in interface ProblemString value