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 <[email protected]> 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:
>
> http://igraph.sourceforge.net/doc/python/igraph.Graph-class.html#add_edge
> http://igraph.sourceforge.net/doc/python/igraph.Graph-class.html#add_edges
>
> http://igraph.sourceforge.net/doc/python/igraph.Graph-class.html#delete_edges
>
> Members of the edge sequence also have a delete() method:
>
> graph.es[1].delete()
>
> By the way, out of curiosity, why do you import the igraph module using
> the alias "nx"? "nx" usually refers to the NetworkX module.
>
> --
> 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

Reply via email to