title: Networkx - Shortest path length
body: <p>I'm  using <code>networkx</code> to manage large network graph which consists of 50k nodes. </p>
  
  <p>I want to calculate the shortest path length between a specific set of nodes, say N.<br>
  For that i'm using the <code>nx.shortest_path_length</code> function.</p>
  
  <p>In some of the nodes from N there might not be a path so networkx is raising and stopping my program.</p>
  
  <p>Is there any way to run this program without any error?<br>
  And to tell to <code>shortest_path_length</code> to return some maximum value? </p>
  
  <p>Code simply uses <code>nx.shortest_path_length(G,i,j)</code>in loop.
  and error is as follows</p>
  
  <p><code>raise nx.NetworkXNoPath("No path between %s and %s." % (source, target))
  networkx.exception.NetworkXNoPath: No path between V and J</code></p>