core-lightning/gossipd/test
Rusty Russell e197956032 gossipd/routing: Iterate on Dijkstra when route is too long.
If a route is too long, we try to bias Dijkstra towards choosing a
shorter route by adding a per-hop cost.  We do a naive "shortest path"
pass, then using that cost as a ceiling on per-hop cost, we do a
binary search.

There are some subtleties: we use risk rather than total as our
counter field (we normally bias this by 1 anyway, so it's easy to make
that a variable), and we set riskfactor to a mimimal value once we're
iterating.  It's good enough to get a solution, we don't need to do a
2-dimensional search on riskfactor and riskbias.

Of course, this is extremely slow if we hit it on our benchmark,
though it doesn't happen in a more realistic network:

$ gossipd/test/run-bench-find_route 100000 100:

Before:
	100 (79 succeeded) routes in 100000 nodes in 25341 msec (253412314 nanoseconds per route)

After:
	100 (100 succeeded) routes in 100000 nodes in 97346 msec (973461784 nanoseconds per route)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-18 06:33:09 +00:00
..
.gitignore gossipd/test/run-bench-find_route: don't abort if we try to route to ourselves 2017-12-20 13:57:28 +01:00
Makefile Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
run-bench-find_route.c gossipd/routing: Iterate on Dijkstra when route is too long. 2019-04-18 06:33:09 +00:00
run-find_route-specific.c gossipd: adjust peers' broadcast_offset when compacting store. 2019-04-11 18:31:34 -07:00
run-find_route.c gossipd: adjust peers' broadcast_offset when compacting store. 2019-04-11 18:31:34 -07:00
run-overlong.c gossipd/routing: Iterate on Dijkstra when route is too long. 2019-04-18 06:33:09 +00:00