igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Distance()


From: Tamas Nepusz
Subject: Re: [igraph] Distance()
Date: Wed, 3 Dec 2008 11:59:51 +0000

Hi Marco,

If not, which way should i take? get_all_shortest_path doesn't let me
decide the endvertex of the path, and bfsiter iters thru all vertices
too.
Start with bfsiter() then simply break the iteration when you found your desired vertex. That's what any other uninformed shortest path algorithm would do anyway:

def distance(g, v1, v2):
  for vertex, distance, _ in g.bfsiter(v1, advanced=True):
    if vertex.index == v2:
      return distance

--
T.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]