|
jBNC Toolbox | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjbnc.graphs.MinSpanTree
Minimum Spanning Tree algorithm.
Assumes that edges are undirected and there is only at most one edge between
any two nodes.
| Constructor Summary | |
MinSpanTree()
|
|
| Method Summary | |
Edge[] |
getDirectedEdges(Graph graph,
Vertex root)
Returns edges of a minimum spanning tree of a graph. |
static void |
main(java.lang.String[] argv)
Test the class. |
protected void |
orientEdges(Edge[] edges,
Vertex root)
Make sure that graph represents a directed tree (each vertex has at most one parent |
Graph |
run(Graph graph,
Vertex root)
Return a minimum spanning tree for a graph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MinSpanTree()
| Method Detail |
public static void main(java.lang.String[] argv)
argv - The command line arguments
public Edge[] getDirectedEdges(Graph graph,
Vertex root)
throws java.lang.Exception
graph - graph to span with a tree.root - vertex designated as the root of the full tree.
java.lang.Exception
public Graph run(Graph graph,
Vertex root)
throws java.lang.Exception
graph - Description of Parameterroot - Description of Parameter
java.lang.Exception - Description of Exception
protected void orientEdges(Edge[] edges,
Vertex root)
throws java.lang.Exception
root - Vertex that should be treated as root of the
directed tree.edges - Description of Parameter
java.lang.Exception - Description of Exception
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||