|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpaul.Graphs.SCComponent<Vertex>
public final class SCComponent<Vertex>
SCComponent
models a strongly-connected
component of a directed graph: a set of vertices such that
there is a path between any two of them.
The main way of spliting a digraph into SCComponent
s
is using the method buildScc
. Alternatively, given a
DiGraph
, one may construct a
TopSortedCompDiGraph
(using its constructor).
DiGraph
,
TopSortedCompDiGraph
,
buildScc(jpaul.Graphs.DiGraph)
,
Serialized FormMethod Summary | ||
---|---|---|
static
|
buildScc(DiGraph<Vertex> diGraph)
Splits a directed graph into the set of its strongly-connected components. |
|
int |
compareTo(SCComponent<Vertex> scc2)
|
|
boolean |
contains(Vertex node)
Checks whether node belongs to this \
strongly connected component. |
|
java.util.Set<Vertex> |
entryVertices()
Returns the entry vertices of this strongly
connected component. |
|
java.util.Set<Vertex> |
exitVertices()
Returns the exit vertices of this strongly
connected component. |
|
int |
getId()
Returns the numeric ID of this SCComponent . |
|
static
|
getSccBiDiNavigator()
Default navigator through a component graph (a diGraph of strongly-connected components). |
|
boolean |
isLoop()
Checks whether this strongly connected component
corresponds to a loop, ie it has at least one arc to
itself. |
|
java.util.List<SCComponent<Vertex>> |
next()
Returns the SCCs that this SCC points to in the
component digraph. |
|
java.util.List<SCComponent<Vertex>> |
prev()
Returns the SCCs that point to this SCC in the
component digraph. |
|
int |
size()
Returns the number of vertices in this strongly connected
component. |
|
java.lang.String |
toString()
Pretty-print method for debugging. |
|
java.util.Set<Vertex> |
vertices()
Returns the vertices of this strongly connected
component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <Vertex> BiDiNavigator<SCComponent<Vertex>> getSccBiDiNavigator()
public static final <Vertex> java.util.Set<SCComponent<Vertex>> buildScc(DiGraph<Vertex> diGraph)
diGraph
- Directed graph
diGraph
.public int getId()
this
SCComponent
.
Just for debug purposes ...
public final boolean isLoop()
this
strongly connected component
corresponds to a loop, ie it has at least one arc to
itself.
public int compareTo(SCComponent<Vertex> scc2)
compareTo
in interface java.lang.Comparable<SCComponent<Vertex>>
public final java.util.List<SCComponent<Vertex>> next()
this
SCC points to in the
component digraph. Returns an unmodifiable list. Returns a
list (instead of a set), in order to be consistent with the
navigator
methods.
public final java.util.List<SCComponent<Vertex>> prev()
this
SCC in the
component digraph. Returns an unmodifiable list. Returns a
list (instead of a set), in order to be consistent with the
navigator
methods.
public final java.util.Set<Vertex> vertices()
this
strongly connected
component. Returns an umodifiable set.
public final int size()
this
strongly connected
component.
public final boolean contains(Vertex node)
node
belongs to this
\
strongly connected component.
public final java.util.Set<Vertex> entryVertices()
this
strongly
connected component. These are the vertices that are
reachable from outside the component. Returns an unmodifiable
set.
public final java.util.Set<Vertex> exitVertices()
this
strongly
connected component. These are the vertices that have arcs
toward vertices outside the component. Returns an
unmodifiable set.
public final java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |