|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdsl.graph.algo.AbstractTopologicalSort | +--jdsl.graph.algo.TopologicalSort
This algorithm class performs a topological ordering on a given DAG. Each Vertex is labeled with a unique order-number which may be retrieved using the number(Vertex) method. In addition to the number(Vertex) query method, this algo-object provides a method sortedVertices(), for obtaining a VertexIterator containing the Vertices in topologically sorted order.
AbstractTopologicalSort
Fields inherited from class jdsl.graph.algo.AbstractTopologicalSort |
graph_, is_cyclic_, NUMBER_KEY_, queue_ |
Constructor Summary | |
TopologicalSort()
Constructor |
Method Summary | |
protected void |
sort()
The meat of the algorithm. |
VertexIterator |
sortedVertices()
Returns a VertexIterator containing all the Vertices in topologically sorted order. |
Methods inherited from class jdsl.graph.algo.AbstractTopologicalSort |
cleanup, execute, init, isCyclic, number |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TopologicalSort()
Method Detail |
protected final void sort()
sort
in class AbstractTopologicalSort
jdsl.graph.algo.AbstractTopologicalSort
TopologicalSort
,
UnitWeightedTopologicalNumbering
public VertexIterator sortedVertices() throws InvalidQueryException
InvalidQueryException
- if the Graph has cycles, or if
the algorithm has not yet been executed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |