Thanks! This works. :) On Wed, Dec 30, 2015 at 6:55 PM, Tamas Nepusz <[email protected]> wrote:
> > I want to get the adjacency list of a subgraph. I am obtaining the > subgraph > > of a graph by passing a set of vertices. Using the adjacency get_adjlist > > method I can get the adjacency list for this subgraph. However, the > > subgraph now uses a completely different set of ids. How can I get the > > original mapping? > You don't need to do that; you can simply get the adjacency list of a > subgraph by calling neighbors() repeatedly: > > adjlist = [g.neighbors(v) for v in vs] > > But if you really need the mapping back to the original vertex IDs, > create a vertex attribute named "original_id" before taking the > subgraph, and then use this vertex attribute from the subgraph to find > the original ID of any vertex. > > T. > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help >
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
