Class CycleFinder<T>
java.lang.Object
com.yahoo.container.di.componentgraph.cycle.CycleFinder<T>
Applies the three-color algorithm to detect a cycle in a directed graph. If there are multiple cycles, this implementation only detects one of them and does not guarantee that the shortest cycle is found.
- Author:
- gjoranv
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
CycleFinder
-
-
Method Details
-
findCycle
Returns a list of vertices constituting a cycle in the graph, or an empty list if no cycle was found. Only the first encountered cycle is returned.
-