title: Find all paths with cycles in directed graph, given the source vertex
body: <p>I'm having trouble solving this problem. I have to find all <em>simple</em> paths starting from a source vertex <em>s</em> containing a <em>simple</em> cycle in a directed graph. i.e. No repeats allowed, except of course for the single repeated vertex where the cycle joins back on the path.</p>
  
  <p>I know how to use a DFS visit to find if the graph has cycles, but I can't find a way to use it to find all such paths starting from <em>s</em>.</p>
  
  <p>For example, in this graph</p>
  
  <pre><code>        +-&gt;B-+
          |    v
  s--&gt;T--&gt;A&lt;---C
          |    ^
          +-&gt;D-+
  </code></pre>
  
  <p>Starting from <code>s</code>, the path S-T-A-B-C-A will correctly be found. But the path S-T-A-D-C-A will not be found, because the vertex C is marked as Visited by DFS.</p>
  
  <p>Can someone hint me how to solve this problem?
  Thanks</p>