Feb. 21, 2014, 4:27 p.m. by Rosalind Team
Topics: Graphs
Given: A positive integer
Return: For each graph, output "1" if it contains a simple cycle (that is, a cycle which doesn’t intersect itself) of length
Source: Algorithms by Dasgupta, Papadimitriou, Vazirani. McGraw-Hill. 2006.
2 4 5 3 4 4 2 3 2 3 1 1 2 4 4 1 2 3 4 2 4 4 1
1 -1
Hint
The adjacency matrix may come in useful for this problem.