public CyclicDetection(NonDiGraph graph) { this.graph = graph; edgeTo = Enumerable.Repeat(-1, graph.V()).ToArray<int>(); visited = new bool[graph.V ()]; dfsCyclic (); }
public CCProcess(NonDiGraph graph) { this.graph = graph; CC = Enumerable.Repeat(-1, graph.V()).ToArray<int>(); visited = new bool[graph.V ()]; findConnectedComponents (); }
public DFSProcess(NonDiGraph graph,int v) { this.v = v; this.graph = graph; edgeTo = Enumerable.Repeat(-1, graph.V()).ToArray<int>(); visited = new bool[graph.V ()]; depthFirstSearch (v); }
public ColoringProcess(NonDiGraph graph) { colors = new bool[graph.V()]; IsTwoColorable = true; this.graph = graph; edgeTo = Enumerable.Repeat(-1, graph.V()).ToArray<int>(); visited = new bool[graph.V ()]; for (int i = 0; i < graph.V(); i++) { dfs (i); } }