Function follow

Source
fn follow(graph: &mut Graph, position: Point, direction: Point) -> u32
Expand description

Starting from an edge, find either the first node marked by a splitter of any orientation or exit from another edge of the grid. If the node is not yet computed, then recursively compute the node and all descendants, caching the result to speed up future checks.

This does not mark paths in the grid to avoid corrupting potential future calculations.