public void DirectedCycle_hasCycle_true() { var g = initDG(); var dc = new DirectedCycle(g); var res = dc.hasCycle(); Assert.True(res); }
public Topological(Digraph G) { DirectedCycle cycleFinder = new DirectedCycle(G); if (!cycleFinder.hasCycle()) { DepthFirstOrder dfs = new DepthFirstOrder(G); order = dfs.getReversePost(); } }