[Top][All Lists]

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

Re: [igraph] shortest paths and ram

From: Tamas Nepusz
Subject: Re: [igraph] shortest paths and ram
Date: Thu, 11 Jun 2009 18:50:03 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi Davide,

I think I found a workaround for you; this is not a final solution as
there's a leak somewhere in igraph's Python interface and I didn't
manage to track it down. Anyway, the following should work:

ws = g.es["weight"]     # copy the weights into a separate list
for i in range(len(g.vs)):
    # use the pre-populated list here
    dSum += sum(g.shortest_paths_dijkstra(i, weights=ws)[0])

By the way, you can try doing shortest_paths_dijkstra in chunks of 100
vertices or so, as the call to shortest_paths_dijkstra implicitly
converts the graph into a lazy adjacency list representation in the
background, and this has to be done every time you call


Attachment: pgpKDhMe5krkV.pgp
Description: PGP signature

reply via email to

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