X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=src%2Fpyutils%2Fgraph.py;h=903be145f153fb967a81a6f731ddd1e594d04415;hb=5e7c3cc44fd97059718b2f58e8318d8367ecedb4;hp=24a921372bf5d28cc0a08d386236b9f72bac45e0;hpb=2b439a98c85e9998ca01801f4342f5c03c85ada6;p=pyutils.git diff --git a/src/pyutils/graph.py b/src/pyutils/graph.py index 24a9213..903be14 100644 --- a/src/pyutils/graph.py +++ b/src/pyutils/graph.py @@ -85,7 +85,7 @@ class Graph(object): 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:: @@ -309,11 +309,11 @@ class Graph(object): .. 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. @@ -323,9 +323,9 @@ class Graph(object): 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;