Browse Source

Minor bug on traversal of shortest path list inutils.py

v0.1
Benoit GAUZERE 7 years ago
parent
commit
d6abcc24a1
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      pygraph/utils/utils.py

+ 2
- 2
pygraph/utils/utils.py View File

@@ -5,8 +5,8 @@ import numpy as np
def getSPLengths(G1):
sp = nx.shortest_path(G1)
distances = np.zeros((G1.number_of_nodes(), G1.number_of_nodes()))
for i in np.keys():
for j in np[i].keys():
for i in sp.keys():
for j in sp[i].keys():
distances[i, j] = len(sp[i][j])-1
return distances



Loading…
Cancel
Save