|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.algo.SpanningTrees
public class SpanningTrees
Provides (minimum) spanning tree algorithms for graphs. A spanning tree of an undirected connected graph is a subset of its edges that form a tree connecting all edges of the graph. If the edges of a graph have a cost or a weight associated with them then it is possible to calculate a minimum spanning tree of that graph, i.e. a spanning tree whose edges have minimum overall cost of all spanning trees of that graph.
Constructor Summary | |
---|---|
SpanningTrees()
|
Method Summary | |
---|---|
static double |
cost(EdgeList treeEdges,
DataProvider edgeCost)
Returns the overall cost of a previously calculated minimum spanning tree. |
static EdgeList |
kruskal(Graph graph,
DataProvider cost)
Calculates a minimum spanning tree for the given graph. |
static EdgeList |
minimum(Graph graph,
DataProvider cost)
Calculates a minimum spanning tree for the given graph using our favorite algorithm for that problem. |
static EdgeList |
prim(Graph graph,
DataProvider cost)
Calculates a minimum spanning tree for the given graph. |
static EdgeList |
uniform(Graph graph)
Calculates a spanning tree for the given graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpanningTrees()
Method Detail |
---|
public static EdgeList minimum(Graph graph, DataProvider cost)
graph
- the input graphcost
- a data provider that must return a double value for each
edge in the graph.
public static EdgeList kruskal(Graph graph, DataProvider cost)
graph
- the input graphcost
- a data provider that must return a double value for each
edge in the graph.
public static EdgeList prim(Graph graph, DataProvider cost)
graph
- the input graphcost
- a data provider that must return a double value for each
edge in the graph.
public static EdgeList uniform(Graph graph)
graph
- the input graph
public static double cost(EdgeList treeEdges, DataProvider edgeCost)
treeEdges
- edges that make up a minimum spanning tree.edgeCost
- a data provider that returns the double valued
cost of each of the tree edges.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |