@@ -202,6 +202,8 @@ def _get_all_pairs_shortest_path():
202
202
"""Pre-compute all pairs shortest paths of the assigned graph `_Gk`."""
203
203
logger .info ("Start to compute all pair shortest path." )
204
204
205
+ global _Gk
206
+
205
207
t0 = time .time ()
206
208
apsp = nk .distance .APSP (_Gk ).run ().getDistances ()
207
209
logger .info ("%8f secs for all pair by NetworKit." % (time .time () - t0 ))
@@ -572,6 +574,8 @@ def _compute_ricci_flow(G: nx.Graph, weight="weight",
572
574
# Set normalized weight to be the number of edges.
573
575
normalized_weight = float (G .number_of_edges ())
574
576
577
+ global _apsp
578
+
575
579
# Start compute edge Ricci flow
576
580
t0 = time .time ()
577
581
@@ -583,6 +587,10 @@ def _compute_ricci_flow(G: nx.Graph, weight="weight",
583
587
for (v1 , v2 ) in G .edges ():
584
588
G [v1 ][v2 ]["original_RC" ] = G [v1 ][v2 ]["ricciCurvature" ]
585
589
590
+ # clear the APSP since the graph have changed.
591
+ _apsp = {}
592
+
593
+
586
594
# Start the Ricci flow process
587
595
for i in range (iterations ):
588
596
for (v1 , v2 ) in G .edges ():
@@ -616,10 +624,9 @@ def _compute_ricci_flow(G: nx.Graph, weight="weight",
616
624
normalized_weight = float (G .number_of_edges ())
617
625
618
626
for n1 , n2 in G .edges ():
619
- logger .debug (n1 , n2 , G [n1 ][n2 ])
627
+ logger .debug ("%s %s %s" % ( n1 , n2 , G [n1 ][n2 ]) )
620
628
621
629
# clear the APSP since the graph have changed.
622
- global _apsp
623
630
_apsp = {}
624
631
625
632
logger .info ("\n %8f secs for Ricci flow computation." % (time .time () - t0 ))
0 commit comments