|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Graphs.SCCTopSortedGraph
SCCTopSortedGraph
represents a
graph of strongly connected components topologically sorted in decreasing
order.
To obtain such a graph, use the topSort
static method.
It uses a Depth First Search to do the sortting in linear time (see
Section 23.4
in Cormen and co for the exact algorithm).
Method Summary | |
SCComponent |
getFirst()
Returns the first (i.e. |
SCComponent |
getLast()
Returns the last (i.e. |
static SCCTopSortedGraph |
topSort(SCComponent root)
Sorts all the strongly connected component reachable from root in decreasing topological order. |
static SCCTopSortedGraph |
topSort(Set roots)
Sorts all the strongly connected component reachable from one of the SCComponent s from roots in decreasing
topological order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public final SCComponent getFirst()
SCComponent
public final SCComponent getLast()
SCComponent
public static SCCTopSortedGraph topSort(SCComponent root)
root
in decreasing topological order.
This method sets the nextTopSort
and
prevTopSort
fields of the SCComponent
s,
arranging then in a double linked list according to the
aforementioned order.SCCTopSortedGraph
containing the first and
the last elements of this list.
Note: This is just a convenient function, for more than one
root, please use the more general topSort(Set)
.
public static SCCTopSortedGraph topSort(Set roots)
SCComponent
s from roots
in decreasing
topological order.
This method sets the nextTopSort
and
prevTopSort
fields of the SCComponent
s,
arranging then in a double linked list according to the
aforementioned order.SCCTopSortedGraph
containing the first and
the last elements of this list.
Note: the roots
parameter must contain only
root Sccomponent
s (ie SCComponent
s without
any entering edge.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |