[Top][All Lists]

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

Re: [igraph] Data structure of network

From: Zhige Xin
Subject: Re: [igraph] Data structure of network
Date: Thu, 11 Apr 2013 09:46:38 -0700

I used NetworkX before so some name was not changed in my code. BTW, igraph is faster than NetworkX if we want to parse a gml file.

On Thu, Apr 11, 2013 at 3:01 AM, Tamás Nepusz <address@hidden> wrote:
> I mean I can traverse and change the label of any node in that network.
This can be done by manipulating the "label" attribute of a node. Nodes can be accessed by indexing the "vs" vertex sequence of the graph. E.g.:

graph.vs[1]["label"] = "new label"

Edges can be manipulated similarly by indexing the "es" edge sequence:

graph.es[1]["weight"] = 42

> For example, node 0 has two neighbors 1 and 2. After some time, node 0 may only connect to node 2 or 3. So how can I change this by manipulating the object of network (network = nx.read(net_path))?
Please take a look at the add_edge(), add_edges(), delete_edge() and delete_edges() method of the Graph object in the documentation:


Members of the edge sequence also have a delete() method:


By the way, out of curiosity, why do you import the igraph module using the alias "nx"? "nx" usually refers to the NetworkX module.


igraph-help mailing list

reply via email to

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