|
From: | Nils Schweinsberg |
Subject: | [igraph] Keeping track of reassigned IDs in C |
Date: | Mon, 30 Jul 2012 20:49:42 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 |
Hi, I'm currently working on Haskell language bindings to the igraph C library and have stumbled upon functions like "igraph_subgraph" which reassign the IDs of a graph such that all IDs go from 0 to n-1. Since my Haskell implementation is using values that are internally attached to C IDs this messes everything up for my graphs. E.g. if I select the 2nd and 3rd vertices from the original graph 'a' -- 'b' -- 'c' I get 'a' -- 'b' instead of 'b' -- 'c' (the expected result) since the IDs have changed and my (ID -> Value) dictionary is not up to date. The Python lib somehow keeps track of those ID changes (see for example the mailing list post [1]) and I had a look at the source code for the Python bindings but I can't find out how it manages to do so. Is there any way to find out which IDs were changed to what? Are there any pointers in the graph struct that point to the original vertex ID or is it noted somewhere what IDs are changed to what? Is there any other trick I might have to do? Thanks for your help - Nils [1] http://lists.gnu.org/archive/html/igraph-help/2011-07/msg00030.html
[Prev in Thread] | Current Thread | [Next in Thread] |