I am trying to implement single_source_dijkstra_path algorithm of the networkx to define the shortest path from a node to all nodes in the network. There are six sources in total, and I want to measure which one of the six nodes has the shortest path to a target node (e.g from node 1 - 6, which node has the shortest distance to node 30). While it works, I think some of the result didn't show the shortest path.
for example, the picture above shows the shortest path to AS Calau, which is to be from Stralsund with 353.3 km. However, with only a gap of a node with a distance of 10 km, the shortest path changes as follow:
From Calau to Bronkow is only 10 km and my network is proven to be all connected (len(list(nx.connected_components)) = 1 ). In Figure 2, it can be seen that the shortest path is no longer from Stralsund but from Rostock Oberseehafen, and the shortest distance is then 641 km. Further analysis also shown that from Stralsund to Bronkow needs to undergo similar path with figure 2, thus resulting in a longer distance.
Does anybody know what I might be doing wrong in this case or does anyone have any explanation for this?