dijkstra: fix heap ordering.

We were always ordering heap by distance, not score (which are different
if we are routing by cheapest, not shortest!).

This simplifies our callbacks, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-10-20 14:28:06 +10:30
parent 4a1843a151
commit 1bf3eebbf6
6 changed files with 49 additions and 85 deletions

View File

@@ -52,7 +52,7 @@ static struct route **least_cost(struct gossmap *map,
tstart = time_mono();
dij = dijkstra(tmpctx, map, dst,
sent, riskfactor, route_can_carry,
route_path_cheaper, NULL);
route_score_cheaper, NULL);
tstop = time_mono();
printf("# Time to find route: %"PRIu64" usec\n",