Adjust weight after split
This commit is contained in:
parent
25a80f7fa9
commit
d060afea0d
@ -311,8 +311,10 @@ int dijkstra_path_intersect(struct dijkstra_solver *solver,
|
|||||||
|
|
||||||
disconnected_node = dijkstra_disconnect_node_from_path(path_a, path_a->destination);
|
disconnected_node = dijkstra_disconnect_node_from_path(path_a, path_a->destination);
|
||||||
dijkstra_connect_destination_node_to_path(node_new, path_a);
|
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);
|
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
|
// 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);
|
disconnected_node = dijkstra_disconnect_node_from_path(path_b, path_b->destination);
|
||||||
dijkstra_connect_destination_node_to_path(node_new, path_b);
|
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);
|
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;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user