igraph-help
[Top][All Lists]
Advanced

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

[igraph] How to complete a graph assigning 0 as weight attribute of new


From: Francesco
Subject: [igraph] How to complete a graph assigning 0 as weight attribute of new edges
Date: Fri, 7 Feb 2014 16:16:28 +1100

Hello list,

Please consider the following graph

library(igraph)
g <- erdos.renyi.game(100, 2/100)
E(g)$weight <- sample(1:10, ecount(g), replace=TRUE)

I am interested in "completing" the graph by adding all missing edges (as a result each pair of vertices will be connected by an edge) but making sure the new edges are assign E(g)$weight = 0.

Is it possible?


reply via email to

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