title: label nodes outside with minimum overlap with other nodes/edges in networkx
body: <p>I am trying to create a graph with node labels printed outside of nodes. I am able to generate 'offset' as shown below that solve the purpose. However, Sometimes the labels overlaps with edges (Which is undesirable as there are lots of empty spaces around nodes  where the corresponding  labels can be printed). I need to label these nodes in such a way that the labels does not overlap any edge or at least try to minimize overlap as much as possible. </p>
  
  <pre><code>import networkx as nx
  from networkx.utils import is_list_of_ints, flatten
  import matplotlib.pyplot as plt
  
  G=nx.Graph()
  
  G = nx.complete_graph(5)
  mapping = {0:'aaaaaaa',1:'bbbbbbb',2:'ccccccc', 3:'dddddddd', 4:'eeeeeeeee'}
  G = nx.relabel_nodes(G,mapping)
  
  plt.figure(figsize=(10,10), facecolor="w", frameon=False)
  pos = nx.graphviz_layout(G, prog="fdp") #calculate position (x,y) coordinates
  nx.draw_networkx_nodes(G,pos,node_size=1200,node_shape='o',node_color='0.75')
  nx.draw_networkx_edges(G,pos, width=2,edge_color='b')
  
  
  #for labeling outside the node
  offset =10
  pos_labels = {}
  keys = pos.keys()
  for key in keys:
      x, y = pos[key]
      pos_labels[key] = (x, y+offset)
  nx.draw_networkx_labels(G,pos=pos_labels,fontsize=2)
  plt.show()
  </code></pre>
  
  <p>Is there any function in networkx that can deal with such situation. I googled for long with no success.</p>