Routing, Python, Topology, Linear Programming, Basemap.
calculated using the Geopy library in Python, using the geodesic() function. def get_distance(g): #g = G (NetworkX Graph) dist = dict(nx.all_pairs_dijkstra_path_length(g)) d = {} for src in g.nodes(): for dst in g.nodes(): d[(src, dst)] = dist[src][dst] return d In[4]: D = get_distance(G) Out[4]: