Hi,
I am trying to find the shortest route between two locations using the nx.shortest_path function. In addition to the start and destination, weight should also be taken into account.
My command looks like this:
route_nodes = nx.shortest_path(G_proj, orig_node, dest_node, weight=edge_weight)
And the edge_weight function starts like this:
def edge_weight(u, v, data):
# Länge der Kante (Standardwert = 1, falls nicht vorhanden)
L = data.get("length", 1)
In edge_weight, however, data does not contain any information about length or speed. Although these are still present in G_proj.
Does anyone know why?
Thank you!