1

i'm a newbie to networkx world. it looks really cool, but would like to know if there's a way to draw, networking-related diagram, such as below:

           +--------------+
     +---->+  Controller  +<----+
     |     +--------------+     |
     |                          |
     |                          |
     |                          |
    sw-a   =================   sw-b

so far, of all the examples/galleries i find on the net only show 1 edge between two fixed nodes. in network topologies, it's very common to have multi-links between nodes. how am i going to achieve this? i tried (focus only on sw-a and sw-b):

G.add_edge('sw-a','sw-b',weight=0.6)
G.add_edge('sw-a','sw-b',weight=0.2)
elarge=[('sw-a', 'sw-b')]
esmall=[('sw-a', 'sw-b')]
nx.draw_networkx_edges(G,pos,edgelist=elarge,width=6)
nx.draw_networkx_edges(G,pos,edgelist=esmall,width=2,alpha=0.5,\
     edge_color='b',style='dashed')

but the lines drawn are not being split and separated (parallel-lines), instead they're overlapping with each other. any hints would be appreciated. tia.

ArnonZ
  • 3,822
  • 4
  • 32
  • 42
pa grape
  • 11
  • 3
  • See http://stackoverflow.com/q/15053686 and http://stackoverflow.com/a/10419646. In short: neato can draw multi-edge graphs but the feature has not been implemented in networkx (yet) – Bonlenfum Sep 28 '14 at 09:54
  • It might be a good idea to increase the thickness of the drawn edge depending on how many edges between the 2 nodes – Abdallah Sobehy Oct 13 '15 at 22:53

0 Answers0