<p>In the case of <strong>undirected</strong> graph, a paper recently published (<em>Optimal listing of cycles and st-paths in undirected graphs</em>) offers an asymptotically optimal solution. You can read it here <a href="http://arxiv.org/abs/1205.2766" rel="nofollow">http://arxiv.org/abs/1205.2766</a> or here <a href="http://dl.acm.org/citation.cfm?id=2627951" rel="nofollow">http://dl.acm.org/citation.cfm?id=2627951</a>
I know it doesn't answer your question, but since the title of your question doesn't mention direction, it might still be useful for Google search</p>
Finding all cycles in a directed graph
<p>How can I find (iterate over) ALL the cycles in a directed graph from/to a given node?</p>

<p>For example, I want something like this:</p>

<pre><code>A-&gt;B-&gt;A
A-&gt;B-&gt;C-&gt;A
</code></pre>

<p>but not:
    B->C->B</p>