How to use the networkit.distance function in networkit

To help you get started, we’ve selected a few networkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JSybrandt / MOLIERE / code / components / queryProcess / findPaths / findPaths.py View on Github external
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()
github JSybrandt / MOLIERE / code / components / queryProcess / findPaths / findPaths.py View on Github external
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()
github saibalmars / GraphRicciCurvature / GraphRicciCurvature / OllivierRicci.py View on Github external
def _get_pairwise_sp(self, source, target):
        return nk.distance.BidirectionalDijkstra(self.G, source, target).run().getDistance()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.ApproxNeighborhoodFunction(G).run().getNeighborhoodFunction()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.ApproxHopPlot(G).run().getHopPlot()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.Diameter(G, networkit.distance.DiameterAlgo.estimatedRange, error=0.1).run()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.Diameter(G, networkit.distance.DiameterAlgo.exact).run()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.EffectiveDiameter(G).run().getEffectiveDiameter()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.EffectiveDiameterApproximation(G).run().getEffectiveDiameter()
github networkit / networkit / benchmark / nk.py View on Github external
def run(self, G):
		return networkit.distance.NeighborhoodFunction(G).run().getNeighborhoodFunction()