mst
Class MSTProblem

java.lang.Object
  extended by mst.MSTProblem
All Implemented Interfaces:
Problem

public class MSTProblem
extends java.lang.Object
implements Problem

Contains an instance of MST.

See Also:
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

numNodes

public int numNodes
The number of nodes in the graph.


adjList

public java.util.ArrayList<java.util.ArrayList<GraphEdge>> adjList
Adjacency list representation. adjList.get(i) is node i's edges.


isEuclidean

public boolean isEuclidean
Vertices are 2D points.


points

public Pointd[] points
For Euclidean case, we'll store the original points as well.


errorMessage

public java.lang.String errorMessage
This is useful to problem-generating algorithms. If a problem is improperly generated, an error message is placed here.


topMessage

public java.lang.String topMessage
Constructor Detail

MSTProblem

public MSTProblem(Pointd[] points)

MSTProblem

public MSTProblem(int numNodes)

MSTProblem

public MSTProblem()
Method Detail

writeToFile

public void writeToFile(java.io.File f)
Description copied from interface: Problem
Write the problem in plain text to the given file.

Specified by:
writeToFile in interface Problem
Parameters:
f - a File value

readFromFile

public void readFromFile(java.io.File f)
Description copied from interface: Problem
Read the problem in plain text from the given file.

Specified by:
readFromFile in interface Problem
Parameters:
f - a File value

toString

public java.lang.String toString()
Description copied from interface: Problem
Returns a problem description summary.

Specified by:
toString in interface Problem
Overrides:
toString in class java.lang.Object
Returns:
a String value

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: Problem
Retrieve error message about an invalid problem.

Specified by:
getErrorMessage in interface Problem
Returns:
a String value