From 877ce7d1e8c8c74a3952c6c152b5fee4efc9d967 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Tue, 11 Aug 2020 06:09:33 +0530 Subject: Use dict instead of OrderedDict since dict is ordered by default from Python 3.6. (#4145) --- networkx/algorithms/simple_paths.py | 5 ++--- 1 file 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] -- cgit v1.2.1