|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.algorithm.TopologicalSort
This class implements the topological-sort algorithm. This algorithm also checks whether a graph has cycles or not. A sort may not be possible if there are cycles in a graph.
| Constructor Summary | |
TopologicalSort()
Constructs a new stateless instance of the TopologicalSort algorithm. |
|
| Method Summary | |
boolean |
apply(Graph graph,
Node[] order)
Returns true if there is one or more cycles in the graph. |
boolean |
apply(Subgraph subgraph,
Node[] order)
Returns true if there is one or more cycles in the subgraph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TopologicalSort()
TopologicalSort algorithm.
| Method Detail |
public boolean apply(Graph graph,
Node[] order)
throws GraphException
graph - the Graph to examine,
may not be null.order - array that is filled with the order that
is given by the topological sorting,
may be null, in this the information is considered
to be unwanted.
GraphException - thrown if the is not directed.
public boolean apply(Subgraph subgraph,
Node[] order)
throws GraphException
subgraph - the Subgraph to examine,
may not be null.order - array that is filled with the order that
is given by the topological sorting,
may not be null.
GraphException - thrown if the is not directed.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||