detect a cycle in undirected graph