aryagraph.algorithms.paths.all_shortest_paths#
- aryagraph.algorithms.paths.all_shortest_paths(g: Graph, source: Hashable, target: Hashable, weight: str | Callable[[Hashable, Hashable, dict], float] | None = None, method: str = 'auto') Iterator[list[Hashable]][source]#
Every shortest path from source to target (a lazy iterator).
Missing nodes and unreachable targets raise immediately, before any path is produced. The number of shortest paths can grow exponentially, so the paths are generated one at a time from the predecessor DAG. With float weights, paths count as tied only when their lengths are exactly equal.