Commit e2e46593 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

shortest_distance(): clarify distance of unconnected vertices in documentation

parent 4cdad2f3
Pipeline #213 failed with stage
in 4471 minutes and 44 seconds
......@@ -1324,6 +1324,10 @@ def shortest_distance(g, source=None, target=None, weights=None,
Johnson's algorithm [johnson-apsp]_. If dense=True, the Floyd-Warshall
algorithm [floyd-warshall-apsp]_ is used instead.
If there is not path between two vertices, the computed distance will
correspond to the maximum value allowed by the value type of ``dist_map``,
or ``inf`` in case of floating point types.
If source is specified, the algorithm runs in :math:`O(V + E)` time, or
:math:`O(V \log V)` if weights are given. If ``negative_weights == True``,
the complexity is :math:`O(VE)`. If source is not specified, it runs in
......@@ -1397,6 +1401,7 @@ def shortest_distance(g, source=None, target=None, weights=None,
.. [johnson-apsp]
.. [floyd-warshall-apsp]
.. [bellman-ford]
if isinstance(target, collections.Iterable):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment