summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>2020-08-11 06:09:33 +0530
committerGitHub <noreply@github.com>2020-08-10 17:39:33 -0700
commit877ce7d1e8c8c74a3952c6c152b5fee4efc9d967 (patch)
tree6999a13b56ecf51b49bc35ecbcb34bbb83acb2e4
parent522c6f8c6ad04da883ca9140c7788a02f911e218 (diff)
downloadnetworkx-877ce7d1e8c8c74a3952c6c152b5fee4efc9d967.tar.gz
Use dict instead of OrderedDict since dict is ordered by default from Python 3.6. (#4145)
-rw-r--r--networkx/algorithms/simple_paths.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/networkx/algorithms/simple_paths.py b/networkx/algorithms/simple_paths.py
index f8cbe7ee..5aa7426c 100644
--- a/networkx/algorithms/simple_paths.py
+++ b/networkx/algorithms/simple_paths.py
@@ -1,4 +1,3 @@
-import collections
from heapq import heappush, heappop
from itertools import count
@@ -239,7 +238,7 @@ def all_simple_paths(G, source, target, cutoff=None):
def _all_simple_paths_graph(G, source, targets, cutoff):
- visited = collections.OrderedDict.fromkeys([source])
+ visited = dict.fromkeys([source])
stack = [iter(G[source])]
while stack:
children = stack[-1]
@@ -265,7 +264,7 @@ def _all_simple_paths_graph(G, source, targets, cutoff):
def _all_simple_paths_multigraph(G, source, targets, cutoff):
- visited = collections.OrderedDict.fromkeys([source])
+ visited = dict.fromkeys([source])
stack = [(v for u, v in G.edges(source))]
while stack:
children = stack[-1]