Package | com.yworks.yfiles.algo |
Class | public class SpanningTrees |
Inheritance | SpanningTrees YObject Object |
Method | Defined By | ||
---|---|---|---|
SpanningTrees(init:Boolean = true) | SpanningTrees | ||
[static]
Returns the overall cost of a previously calculated minimum spanning tree. | SpanningTrees | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | SpanningTrees | ||
hashCode():int | YObject | ||
[static]
Calculates a minimum spanning tree for the given graph. | SpanningTrees | ||
[static]
Calculates a minimum spanning tree for the given graph using our favorite algorithm for that problem. | SpanningTrees | ||
[static] | SpanningTrees | ||
[static]
Calculates a minimum spanning tree for the given graph. | SpanningTrees | ||
[static]
Calculates a spanning tree for the given graph. | SpanningTrees |
Method | Defined By | ||
---|---|---|---|
initSpanningTrees():void | SpanningTrees |
SpanningTrees | () | Constructor |
public function SpanningTrees(init:Boolean = true)
init:Boolean (default = true )
|
cost | () | method |
public static function cost(treeEdges:EdgeList, edgeCost:DataProvider):Number
Returns the overall cost of a previously calculated minimum spanning tree.
Parameters
treeEdges:EdgeList — edges that make up a minimum spanning tree.
| |
edgeCost:DataProvider — a data provider that returns the double valued cost of each of the tree edges.
|
Number — the overall cost of the tree edges.
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initSpanningTrees | () | method |
protected final function initSpanningTrees():void
kruskal | () | method |
public static function kruskal(graph:Graph, cost:DataProvider):EdgeList
Calculates a minimum spanning tree for the given graph. The implementation is based on an algorithm originally published in
J.B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, pages 48-50, 1956.Precondition GraphComponents.isConnected(graph)
Precondition cost.length == graph.E();
Complexity graph.E()+graph.N()*log(graph.N())
Parameters
graph:Graph — the input graph
| |
cost:DataProvider — a data provider that must return a double value for each edge in the graph.
|
EdgeList — a list that contains the edges that make up the minimum spanning tree.
|
minimum | () | method |
public static function minimum(graph:Graph, cost:DataProvider):EdgeList
Calculates a minimum spanning tree for the given graph using our favorite algorithm for that problem.
Precondition GraphComponents.isConnected(graph)
Precondition cost.length == graph.E();
Parameters
graph:Graph — the input graph
| |
cost:DataProvider — a data provider that must return a double value for each edge in the graph.
|
EdgeList — a list that contains the edges that make up the minimum spanning tree.
|
newSpanningTrees | () | method |
prim | () | method |
public static function prim(graph:Graph, cost:DataProvider):EdgeList
Calculates a minimum spanning tree for the given graph. The implementation is based on an algorithm originally published in
R.C. Prim. Shortest connection networks and some generalizations. Bell System Technical Journal, 36:1389-1401, 1957.Precondition GraphComponents.isConnected(graph)
Precondition cost.length == graph.E();
Complexity graph.E()*log(graph.N())
Parameters
graph:Graph — the input graph
| |
cost:DataProvider — a data provider that must return a double value for each edge in the graph.
|
EdgeList — a list that contains the edges that make up the minimum spanning tree.
|
uniform | () | method |
public static function uniform(graph:Graph):EdgeList
Calculates a spanning tree for the given graph. Each edge has assumed uniform cost of 1.0.
Precondition GraphComponents.isConnected(graph)
Complexity O(graph.E()+graph.N())
Parameters
graph:Graph — the input graph
|
EdgeList — a list that contains the edges that make up the minimum spanning tree.
|