findCycles
public <N,E> List<List<String>> findCycles(Graph<N,E> graph)
Given a Graph, g, this function returns all nodes that
are part of a cycle. As there may be more than one cycle in a graph this function return an array of these cycles, where each cycle is itself
represented by an array of ids for each node involved in that cycle.
isAcyclic is more efficient if you only need to determine whether a graph has a cycle or not.
- 类型参数:
N - node data type
E - edge data type
- 参数:
graph - Graph
- 返回:
- returns all nodes that are part of a cycle