def remove_edge(self, source: str, dest: str):
"""Remove a previously added edge in the graph. If the graph is
- not directed (see :meth:`__ini__`), also removes the reciprocal
+ not directed (see :meth:`__init__`), also removes the reciprocal
edge from dest back to source.
.. note::
.. note::
- This method runs Dijkstra's algorithm
- (https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)
- internally and caches the results. Subsequent calls made with
- the same source node before modifying the graph are less
- expensive due to these cached intermediate results.
+ This method runs Dijkstra's algorithm
+ (https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)
+ internally and caches the results. Subsequent calls made with
+ the same source node before modifying the graph are less
+ expensive due to these cached intermediate results.
Returns:
A tuple containing the minimum distance of the path and the path itself.
graph g {
node [shape=record];
- A -- B [w=3];
+ A -- B [weight=3];
B -- D;
- A -- C [w=2];
+ A -- C [weight=2];
C -- D -- E -- F;
F -- F;
E -- G;