routing: introduce a heap to keep track of closest nodes during pathfinding

This commit introduces a new heap struct that will be used to keep
track of the next closest node to the source during path finding within
our modified Dijkstra's algorithm.
This commit is contained in:
Olaoluwa Osuntokun
2017-03-19 14:06:08 -07:00
parent 5d434839a4
commit 606b23df43
3 changed files with 111 additions and 7 deletions

View File

@ -208,13 +208,6 @@ func newVertex(pub *btcec.PublicKey) vertex {
return v
}
// nodeWithDist is a helper struct that couples the distance from the current
// source to a node with a pointer to the node itself.
type nodeWithDist struct {
dist float64
node *channeldb.LightningNode
}
// edgeWithPrev is a helper struct used in path finding that couples an
// directional edge with the node's ID in the opposite direction.
type edgeWithPrev struct {