# NOT RUN {
#Create a random graph with _some_ edge structure
g.p<-sapply(runif(20,0,1),rep,20) #Create a matrix of edge
#probabilities
g<-rgraph(20,tprob=g.p) #Draw from a Bernoulli graph
#distribution
#Cluster based on structural equivalence
eq<-equiv.clust(g)
#Form a blockmodel with distance relaxation of 15
b<-blockmodel(g,eq,h=15)
#Draw from an expanded density blockmodel
g.e<-blockmodel.expand(b,rep(2,length(b$rlabels))) #Two of each class
g.e
# }
Run the code above in your browser using DataLab