Commit Graph

9 Commits

Author SHA1 Message Date
Elle Mouton
699e335954 autopilot: remove the ForEachChannel method from Node interface
And instead make use of the new ForEachNodesChannels method which
uses a much more efficient method for iterating through nodes&channels.
2025-08-06 09:52:09 +02:00
Elle Mouton
70b8c8ec78 autopilot: convert Peer to route.Vertex
In preparation for removing the ForEachNode/ForEachChannel call pattern,
we refactor the autopilot subserver by simplifying the `ChannelEdge`
such that it no longer returns the `Node` type which has a
`ForEachChannel` method on it. The aim is to completely remove the
`ForEachChannel` usage.
2025-08-05 09:59:12 +02:00
Elle Mouton
c32bf642d2 multi: pass reset to ForEachNodeCached 2025-07-15 11:23:27 +02:00
Elle Mouton
13fcb08794 autopilot: start threading contexts through
The `GraphSource` interface in the `autopilot` package is directly
implemented by the `graphdb.KVStore` and so we will eventually thread
contexts through to this interface. So in this commit, we start updating
the autopilot system to thread contexts through in preparation for
passing the context through to any calls made to the GraphSource.

Two context.TODOs are added here which will be addressed in follow up
commits.
2025-05-22 14:14:38 +02:00
Eng Zer Jun
0899cee987 refactor: replace min/max helpers with built-in min/max
We can use the built-in `min` and `max` functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2025-02-06 09:45:10 +08:00
Michael Rooke
78d9996620 trivial: Fix spelling errors
- Fixes some spelling in code comments and a couple of function names
2023-09-21 22:35:33 -04:00
Oliver Gugger
ed40eddafd autopilot: return early for empty graph
This fixes an issue where the diameter calculation would crash if the
graph is empty.
2022-06-16 10:10:27 +02:00
bitromortac
52d56a8990 lnrpc+autopilot: add graph diameter calculation
* adds a brute force computation of the diameter
* adds a more efficient calculation of the diameter
2022-03-07 11:15:47 +01:00
Andras Banki-Horvath
3fe9c70722 autopilot: betweenness centrality using Brandes algo on simplifed graph
This commit adds betweenness centrality to the available node metrics.
Betweenness centrality is a per node centrality measure which for an
arbitrary node v equals to the sum of shortest paths going trough v
divided by the number of all shortest paths for for each vertex pair
k, s where k != s != v.
2020-03-27 10:39:50 +01:00