title: Finding length of shortest cycle in undirected graph
body: <p>I tried the following :</p>
  
  <p>1) DFS, keeping track of level of each vertex in my DFS tree</p>
  
  <p>2) Each time a back edge (x,y) is seen, I calculate cycle length = level[x] - level[y] + 1, and save it if it is smaller than the shortest</p>
  
  <p>Can someone tell a counter example for which this approach is wrong ?</p>
  
  <p>What could be a better way to find shortest cycle in undirected graphs ?</p>
  
  <p>Thanks. </p>