I\'m using networkx to manage large network graph which consists of 50k nodes.
networkx
I want to calculate the shortest path length between a specific set of node
import networkx as nx G=nx.Graph() G.add_nodes_from([1,2,3,4]) G.add_edge(1,2) G.add_edge(3,4) try: n=nx.shortest_path_length(G,1,4) print n except nx.NetworkXNoPath: print 'No path'