title: Getting subgraph of nodes between two nodes?
body: <p>I have this graph:</p>
  
  <pre><code>%matplotlib inline 
  import networkx as nx
  
  G = nx.Graph()
  
  G.add_edge(1, 2)
  G.add_edge(2, 3)
  G.add_edge(3, 4)
  G.add_edge(3, 5)
  G.add_edge(4, 6)
  G.add_edge(5, 6)
  G.add_edge(3, 7)
  G.add_edge(7, 6)
  G.add_edge(6, 8)
  G.add_edge(8, 9)
  
  nx.draw(G, pos=nx.spring_layout(G), with_labels=True)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1JSPa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1JSPa.png" alt="enter image description here"></a></p>
  
  <p>Is it possible to get the subgraph between the nodes 3 and 6 without using <code>nx.subgraph(G, [3,4,5,6,7])</code>. I mean, what if I know that there is this subgraph, but I don't know e.g. about the 5?</p>