Hello List,
I want to adjust the Watts-Strogatz model in R to  add shortcuts without 
removing (rewiring) the existing edge. Thus i want to preserve the initial 
small world model and add shortcuts with a specified probability,  without 
self-loops and multiple edges. I have attached a copy of what i want to get. 
Using the code below i get what is expected alright but it doesn't satisfy the 
various properties. Eg.  it doesn't satisfy,  the expected number of shortcuts 
added being  ~ N*k*p  for N vertices and k neighbours. 
I would be very grateful if any one has an R code function that gives the 
second type of watts model (thus just adding shortcuts and still preserve the 
initial structure). Thanks for your help.


#I started with the initial model at p=0
library(igraph)
wsk2 <- watts.strogatz.game(1, 100, 1, p=0)

#Create a binomial matrix of 0's and 1's  with a specified probability and then 
convert to graph
bmat2<-matrix(rbinom(100,1,0.1),100,100)                ##Source of the problem
bgh2<-graph.adjacency(bmat2, mode="undirected")   

#Add the binomial graph to initial graphs  
newg2<-simplify(graph.union(wsk2, bgh2))

<<attachment: SmallWord.PNG>>

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

Reply via email to