Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def runProbGroup(probGroup):
global graph, outLock, verbose, outFile
(source, targets) = probGroup
if len(targets) == 1:
dijk = nk.distance.Dijkstra(graph, source, target=targets[0])
else:
dijk = nk.distance.Dijkstra(graph, source)
dijk.run()
outLock.acquire()
for target in targets:
path = dijk.getPath(target)
outFile.write("{}\n".format(" ".join([str(x) for x in path])))
outLock.release()
def runProbGroup(probGroup):
global graph, outLock, verbose, outFile
(source, targets) = probGroup
if len(targets) == 1:
dijk = nk.distance.Dijkstra(graph, source, target=targets[0])
else:
dijk = nk.distance.Dijkstra(graph, source)
dijk.run()
outLock.acquire()
for target in targets:
path = dijk.getPath(target)
outFile.write("{}\n".format(" ".join([str(x) for x in path])))
outLock.release()
def _get_pairwise_sp(self, source, target):
return nk.distance.BidirectionalDijkstra(self.G, source, target).run().getDistance()
def run(self, G):
return networkit.distance.ApproxNeighborhoodFunction(G).run().getNeighborhoodFunction()
def run(self, G):
return networkit.distance.ApproxHopPlot(G).run().getHopPlot()
def run(self, G):
return networkit.distance.Diameter(G, networkit.distance.DiameterAlgo.estimatedRange, error=0.1).run()
def run(self, G):
return networkit.distance.Diameter(G, networkit.distance.DiameterAlgo.exact).run()
def run(self, G):
return networkit.distance.EffectiveDiameter(G).run().getEffectiveDiameter()
def run(self, G):
return networkit.distance.EffectiveDiameterApproximation(G).run().getEffectiveDiameter()
def run(self, G):
return networkit.distance.NeighborhoodFunction(G).run().getNeighborhoodFunction()