From d060afea0d6072276daf148d03cf8c89a02cb3d5 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 3 May 2020 12:08:24 +0200 Subject: [PATCH] Adjust weight after split --- src/dijkstragraph.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dijkstragraph.c b/src/dijkstragraph.c index 189e715..b2c99b0 100644 --- a/src/dijkstragraph.c +++ b/src/dijkstragraph.c @@ -311,8 +311,10 @@ int dijkstra_path_intersect(struct dijkstra_solver *solver, disconnected_node = dijkstra_disconnect_node_from_path(path_a, path_a->destination); dijkstra_connect_destination_node_to_path(node_new, path_a); + path_a->weight = dijkstra_get_weight_from_distance(path_a->source, path_a->destination); dijkstra_connect_nodes_to_path(node_new, disconnected_node, path_new); + path_new->weight = dijkstra_get_weight_from_distance(path_new->source, path_new->destination); } // Now do the same thing for path b @@ -322,8 +324,10 @@ int dijkstra_path_intersect(struct dijkstra_solver *solver, disconnected_node = dijkstra_disconnect_node_from_path(path_b, path_b->destination); dijkstra_connect_destination_node_to_path(node_new, path_b); + path_b->weight = dijkstra_get_weight_from_distance(path_b->source, path_b->destination); dijkstra_connect_nodes_to_path(node_new, disconnected_node, path_new); + path_new->weight = dijkstra_get_weight_from_distance(path_new->source, path_new->destination); } return 1;