title: Graph analysis: Identify loop paths
body: <p>I have an undirected graph like:</p>
  
  <pre><code>import igraph as ig
  G = ig.Graph()
  G.add_vertices(9)
  G.add_edges([(0,1), (1,2),(2,3),(3,0),(0,4),(4,5),(5,6),(6,7),(6,8)])
  </code></pre>
  
  <p>There is a "loop path"  from node 0 via 1,2,3 back to 0 (sorry, in the pic the nodelabels are starting with 1 instead of 0)</p>
  
  <p><img src="https://i.stack.imgur.com/BEi07.jpg" alt="Graph"></p>
  
  <p>For an assignment, I need to identify the node where the "loop path" is connected to the rest of the graph, i.e. <code>0</code>, and most importantly, the "loop path" itself, i.e. <code>[0,1,2,3,0]</code> and/or <code>[0,3,2,1,0]</code></p>
  
  <p>I am trying hard, but really have no clue. If I use the function from <a href="https://stackoverflow.com/a/29324009/2772305">here</a> like <code>find_all_paths(G,0,0)</code> I of course get only <code>[0]</code></p>