[igraph] working with graphs without reindexing them
From:
sergiu netotea
Subject:
[igraph] working with graphs without reindexing them
Date:
Tue, 7 Sep 2010 16:52:23 +0200
Hi, I am a bit confused about the igraph labels.
What is the best way to load a subgraph without reindexing the node labels? I am doing some C code that uses igraph to compute a network alignment and needs to use externally stored subgraphs of larger graphs. The subgraphs are stored on file in an edgelist format, but I have them using the old index value (of the nodes in the larger graph). I was trying to use the igraph edgelist reader function, but I later realized my subgraphs must be reindexed in order to be properly read and operated in igraph. (In fact they may be properly read, but I have no way of later specifying a vertex by it's original id, since they are reindexed automatically). I did that using some python scripts, but they are already reindexed once before for other reasons and it is very confusing to work with two extra-layers of reindexing.
So is there a way to read the edgelist then operate on the graph without reindexing? Of course I could write my own graph reader, then perhaps modify all igraph functions that I am using, but I do not have the time for it.. Also, what happens if a node gets removed? The whole set of nodes gets reindexed? That would mean I cannot establish the original identity of a certain node in an evolving network, so I should work with node labels. But then as I understood node labeling is not well supported in igraph, am I right?