What is the expected enhancement?
It would be useful to support an optional distance cutoff for Dijkstra shortest-path-length APIs, similar to NetworkX's single_source_dijkstra_path_length:
nx.single_source_dijkstra_path_length(
graph,
source,
cutoff=10.0,
weight="weight",
)
For example:
rustworkx.dijkstra_shortest_path_lengths(
graph,
source,
edge_cost_fn,
cutoff=10.0,
)
The main motivation is performance.
Currently, bounded Dijkstra search can be implemented with dijkstra_search() and a custom DijkstraVisitor, but this requires user-side code and Python callbacks during traversal.
A native cutoff in the Rust implementation could terminate the search once the minimum queued distance exceeds the cutoff, avoiding unnecessary heap operations and edge relaxations.
This would also make migration from NetworkX easier for workloads that rely on cutoff.
What is the expected enhancement?
It would be useful to support an optional distance
cutofffor Dijkstra shortest-path-length APIs, similar to NetworkX's single_source_dijkstra_path_length:For example:
The main motivation is performance.
Currently, bounded Dijkstra search can be implemented with
dijkstra_search()and a customDijkstraVisitor, but this requires user-side code and Python callbacks during traversal.A native cutoff in the Rust implementation could terminate the search once the minimum queued distance exceeds the cutoff, avoiding unnecessary heap operations and edge relaxations.
This would also make migration from NetworkX easier for workloads that rely on
cutoff.