From d6abcc24a131964e1c1c3ac8dd2b6358501e78ae Mon Sep 17 00:00:00 2001 From: Benoit GAUZERE Date: Thu, 30 Nov 2017 15:37:51 +0100 Subject: [PATCH] Minor bug on traversal of shortest path list inutils.py --- pygraph/utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygraph/utils/utils.py b/pygraph/utils/utils.py index 52a85f1..0c7bf60 100644 --- a/pygraph/utils/utils.py +++ b/pygraph/utils/utils.py @@ -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