public Topological(DirectedGraph graph) { DirectedCircle circleFinder = new DirectedCircle(graph); if (!circleFinder.HasCircle()) { DepthFirstOrder dfs = new DepthFirstOrder(graph); Order = dfs.ReversePost(); } }
public KosarajuConnectedComponent(DirectedGraph g) { marked = new bool[g.VertexSize]; id = new int[g.VertexSize]; DepthFirstOrder order = new DepthFirstOrder(g.Reverse()); foreach (var i in order.ReversePost()) { if (!marked[i]) { Dfs(g, i); Count++; } } }