title: How to create a connected graph in networkx
body: <p>I  want to create a connected graph in <code>IPython</code> notebook through <code>NetworkX</code>. Previously, I use </p>
  
  <pre><code>erdos_renyi_graph
  </code></pre>
  
  <p>to generate a random graph, but I never get a connected graph, I want to use this graph to prove that my graph is a small world network. But the unconnected graph's average shortest path cannot be calculated. So please tell me how to generate a connected graph through <code>NetworkX</code>.</p>