public class CycleDetector
extends java.lang.Object
| Constructor | Description |
|---|---|
CycleDetector() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.List<java.lang.String> |
hasCycle(DAG graph) |
|
static java.util.List<java.lang.String> |
introducesCycle(Vertex vertex) |
|
static java.util.List<java.lang.String> |
introducesCycle(Vertex vertex,
java.util.Map<Vertex,java.lang.Integer> vertexStateMap) |
This method will be called when an edge leading to given vertex was added and we want to check if introduction of
this edge has not resulted in apparition of cycle in the graph
|
public static java.util.List<java.lang.String> hasCycle(DAG graph)
public static java.util.List<java.lang.String> introducesCycle(Vertex vertex, java.util.Map<Vertex,java.lang.Integer> vertexStateMap)
vertex - vertexStateMap - public static java.util.List<java.lang.String> introducesCycle(Vertex vertex)