igraph-help
[Top][All Lists]
Advanced

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

[igraph] Getting verticies ids' after igraph_delete_vertices()


From: Sergey Aleynikov
Subject: [igraph] Getting verticies ids' after igraph_delete_vertices()
Date: Sat, 3 Jan 2009 20:44:33 +0800

I've discovered igraph after searcing over Internet for fast graph path computing library. I'm writing appication in perl, and CPAN's native Graph.pm is very slow on dijkstra path finding. Igraph beats it (on my not really large task) by ~250 times. My task in really simple (immutable graph with changing weights), but i want to write a full perl wrapper for igraph. And here i've got a problem.

While i just add vertexes, i can easily get their ids' - they're just incresaing. So there's no problem maintaining object->vertex correspondence. But what to do when any vertex is deleted? How to get new ids? The only solution that figures out of released 0.5.1 documentation is store with each vertex some attribute (object ref) and then re-scan all vertexes, getting attributes and setting obj->vertex correspondence. But that can be really heavy on large number of vertexes.

Is there any simplier way to do this? As i hope, Python/Ruby modules have some workaround.

reply via email to

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