org._3pq.jgrapht.alg
public class CycleDetector extends java.lang.Object
Constructor and Description |
---|
CycleDetector(DirectedGraph graph)
Creates a cycle detector for the specified graph.
|
Modifier and Type | Method and Description |
---|---|
boolean |
detectCycles()
Performs yes/no cycle detection on the entire graph.
|
boolean |
detectCyclesContainingVertex(java.lang.Object v)
Performs yes/no cycle detection on an individual vertex.
|
java.util.Set |
findCycles()
Finds the vertex set for the subgraph of all cycles.
|
java.util.Set |
findCyclesContainingVertex(java.lang.Object v)
Finds the vertex set for the subgraph of all cycles which contain a
particular vertex.
|
public CycleDetector(DirectedGraph graph)
graph
- the DirectedGraph in which to detect cyclespublic boolean detectCycles()
public boolean detectCyclesContainingVertex(java.lang.Object v)
v
- the vertex to testpublic java.util.Set findCycles()
public java.util.Set findCyclesContainingVertex(java.lang.Object v)
v
- the vertex to test