[Top][All Lists]

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

Re: [igraph] Subgraph with attributes

From: Matteo Fortini
Subject: Re: [igraph] Subgraph with attributes
Date: Tue, 23 Jul 2013 07:14:25 +0200

Edges get reindexed starting from 0. If you want to refer to the same edge, you must use an attribute such as a 'name' one, which is a string that will be searched for if you do, say


Il giorno 23/lug/2013 04:53, "Thomas Glickson" <address@hidden> ha scritto:
Hi all,

I'm having a little trouble with the subgraph_edges command. See the following snippet of code:

print g.es[0]['weight'] # prints 1223 which happens to be the edge weight of edge 0
g_sub = g.subgraph_edges(edge_incidents) # create a subgraph
print g_sub.es[0]['weight'] # prints None

The problem is that none of my edge attributes are transferring onto the subgraph. No, it's not that all of the ids in my edge list "edge_incidents" have 'weight' attribute None. This happens for all edge attributes (I have a dozen) for all edges in the subgraph. I know edge attributes aren't supposed to disappear, because they don't when I test it on a simple graph. Am I missing something here? Any help or suggestions about what might be causing the problem are much appreciated. 


igraph-help mailing list

reply via email to

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