Repository: networkx/networkx

Issue:
Replace OrderedDict with dict in simple_paths module
From Python 3.6 dicts are ordered by default and 3.6 is the minimum version for the project. In `all_simple_paths` function OrderedDict is used which can be replaced with dict. Since `popitem` and `__setitem__` are heavily used where `OrderedDict` performs some more [additional work](https://github.com/python/cpython/blob/e28b8c93878072dc02b116108ef5443084290d47/Lib/collections/__init__.py#L174) that is not needed here. Some perf benchmarks for a large graph.

OrderedDict usage : https://github.com/networkx/networkx/blob/522c6f8c6ad04da883ca9140c7788a02f911e218/networkx/algorithms/simple_paths.py#L242

```python
import networkx as nx
import networkx.algorithms.simple_paths as sp

G = nx.complete_graph(10)
list(sp.all_simple_paths(G, source=0, target=9))
```

On master branch : 

```
python -m pyperf timeit -s 'import networkx as nx; import networkx.algorithms.simple_paths as sp; G = nx.complete_graph(10)' 'list(sp.all_simple_paths(G, source=0, target=9))' -o master.json      
.....................
Mean +- std dev: 921 ms +- 51 ms
```

On my branch replacing OrderedDict with dict : 

```
python -m pyperf timeit -s 'import networkx as nx; import networkx.algorithms.simple_paths as sp; G = nx.complete_graph(10)' 'list(sp.all_simple_paths(G, source=0, target=9))' -o improve_perf.json 
.....................
Mean +- std dev: 783 ms +- 20 ms
```

Comparison shows 15% faster 

```
python -m pyperf compare_to master.json improve_perf.json
Mean +- std dev: [master] 921 ms +- 51 ms -> [improve_perf] 783 ms +- 20 ms: 1.18x faster (-15%)
```


```patch
diff --git a/networkx/algorithms/simple_paths.py b/networkx/algorithms/simple_paths.py
index f8cbe7e..b7d7d6d 100644
--- a/networkx/algorithms/simple_paths.py
+++ b/networkx/algorithms/simple_paths.py
@@ -239,7 +239,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 +265,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]

```


Discussion:

Resolving patch:
diff --git a/networkx/algorithms/simple_paths.py b/networkx/algorithms/simple_paths.py
--- 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]


Test patch: