Skip to main content

Module walk

Module walk 

Source
Expand description

Single bounded-BFS engine behind every graph traversal in the codebase.

Four traversals used to exist side by side — directed with a weight floor, bidirectional with a weight floor, bidirectional in memory without one, and a predecessor-tracking variant — each with its own frontier handling and its own drift. They now all declare their parameters through GraphWalk and share this driver, so hop distance means the same thing everywhere.

The driver is a strict FIFO breadth-first search: the depth recorded for an entity is its minimum distance from the seed set. A LIFO frontier would silently turn the walk into a depth-first search and report distances that are not distances.

Structs§

EdgeArrival
The edge through which an entity was reached.
GraphWalk
Traversal parameters. Every caller states its own explicitly.
InMemoryNeighbors
Neighbours resolved against an in-memory edge list.
MemoryEdge
A relationship already loaded in memory.
SqlNeighbors
Neighbours read straight from the relationships table.
WalkOutcome
Result of a walk.

Enums§

WalkDirection
Which way edges are followed during the walk.

Traits§

NeighborSource
Supplies the neighbours of an entity to the walk driver.