summaryrefslogtreecommitdiff
path: root/networkx/algorithms/shortest_paths/unweighted.py
diff options
context:
space:
mode:
Diffstat (limited to 'networkx/algorithms/shortest_paths/unweighted.py')
-rw-r--r--networkx/algorithms/shortest_paths/unweighted.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/networkx/algorithms/shortest_paths/unweighted.py b/networkx/algorithms/shortest_paths/unweighted.py
index 9d1dff5b..0bd1ddc5 100644
--- a/networkx/algorithms/shortest_paths/unweighted.py
+++ b/networkx/algorithms/shortest_paths/unweighted.py
@@ -15,6 +15,7 @@ __all__ = [
]
+@nx._dispatch
def single_source_shortest_path_length(G, source, cutoff=None):
"""Compute the shortest path lengths from source to all reachable nodes.
@@ -93,6 +94,7 @@ def _single_shortest_path_length(adj, firstlevel, cutoff):
del seen
+@nx._dispatch
def single_target_shortest_path_length(G, target, cutoff=None):
"""Compute the shortest path lengths to target from all reachable nodes.
@@ -140,6 +142,7 @@ def single_target_shortest_path_length(G, target, cutoff=None):
return _single_shortest_path_length(adj, nextlevel, cutoff)
+@nx._dispatch
def all_pairs_shortest_path_length(G, cutoff=None):
"""Computes the shortest path lengths between all nodes in `G`.
@@ -292,6 +295,7 @@ def _bidirectional_pred_succ(G, source, target):
raise nx.NetworkXNoPath(f"No path between {source} and {target}.")
+@nx._dispatch
def single_source_shortest_path(G, source, cutoff=None):
"""Compute shortest path between source
and all other nodes reachable from source.
@@ -375,6 +379,7 @@ def _single_shortest_path(adj, firstlevel, paths, cutoff, join):
return paths
+@nx._dispatch
def single_target_shortest_path(G, target, cutoff=None):
"""Compute shortest path to target from all nodes that reach target.
@@ -426,6 +431,7 @@ def single_target_shortest_path(G, target, cutoff=None):
return dict(_single_shortest_path(adj, nextlevel, paths, cutoff, join))
+@nx._dispatch
def all_pairs_shortest_path(G, cutoff=None):
"""Compute shortest paths between all nodes.