Method 1: Union-Find (Detect Cycle in a an Undirected Graph) [1]
Method 2: DFS (Detect Cycle in a an Directed Graph) [2]
Method 3: Coloring (Detect Cycle in a an Directed Graph) [3]
Ref[1] http://www.geeksforgeeks.org/union-find/
[2] http://www.geeksforgeeks.org/detect-cycle-in-a-graph/
[3] http://www.cs.cornell.edu/courses/cs2112/2012sp/lectures/lec24/lec24-12sp.html
No comments:
Post a Comment