15 / reference
Shortest-path reference
Exact and bounded-hop shortest-path functions for weighted directed graphs.
Edit this pageUpdated with the source
from reachq.shortest_paths import (
dijkstra,
shortest_path,
shortest_path_hopbound,
truncated_dijkstra,
)
from reachq.hopset import build_hopset_for_sssp dijkstra returns exact source distances. shortest_path_hopbound searches the original graph plus hopset edges with a maximum hop count. It returns a mapping for vertices reachable within that budget.