> Is there a way to create/set user-defined attributes on the vertices of a 
> graph? I have not found anything in the manual on this.

Yes, there is, but it depends on whether you are using R on Python. In R, you 
can set vertex attributes as follows:

V(g)$name <- c("A", "B", "C", "D")

The above sets all the vertex attributes at once. The attribute of a specific 
vertex can be updated as follows:

V(g)[2]$name <- "foo"

In Python, it looks like this:

g.vs["name"] = ["A", "B", "C", "D"]
g.vs[2]["name"] = "foo"

-- 
T.


_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to