title: algorithm to get cycle in graph?
body: <p>If you have a graph represented as an adjacency list, how can you detect any <code>odd length-ed</code> cycles in python?</p>
  
  <p>Suppose you have a graph given as input:</p>
  
  <pre><code>A = {
      1: [2, 4],
      2: [1, 5],
      3: [4, 5],
      4: [1, 3, 5],
      5: [2, 3, 4],
      6: []
  }
  
  V = {
      1: &lt;node&gt;,
      2: &lt;node&gt;,
      3: &lt;node&gt;,
      4: &lt;node&gt;,
      5: &lt;node&gt;,
      6: &lt;node&gt;
  }
  </code></pre>
  
  <p><code>A</code> is a dictionary where the key is a number and the value is a list of numbers, so there is an edge between the key to all of it's values. <code>V</code> is a dictionary which maps a number to the node instance.</p>
  
  <p>How can you detect if there is an odd length-ed cycle?</p>
  
  <p>From the input above, there actually is one which uses nodes <code>3, 4, 5</code>.</p>
  
  <p>Basically how can I get the output to be <code>3 4 5</code>?</p>
  
  <p>Thanks</p>