g.add_edge('a', 'b', distance=0.3)
g.add_edge('a', 'c', distance=0.7)
nx.dijkstra_path_length(g, 'b', 'c', 'distance')
nx.dijkstra_path(g, 'b', 'c', 'distance')
nx.dijkstra_path_length(g, 'b', 'b', 'distance')
nx.dijkstra_path(g, 'b', 'b', 'distance')
How to find shortest path in a weighted graph using networkx?