Last chance! 50% off unlimited learning
Sale ends in
Finds blocks of nodes with intra-positive and inter-negative edges
signed_blockmodel(g, k, alpha = 0.5, annealing = FALSE)
igraph object. Must have a "sign" edge attribute.
number of blocks
see details
logical. if TRUE, use simulated annealing (Default: FALSE)
numeric vector of block assignments and the associated criterion value
The function minimizes P(C)=
Doreian, Patrick and Andrej Mrvar (2009). Partitioning signed social networks. Social Networks 31(1) 1-11
# NOT RUN {
library(igraph)
g <- sample_islands_signed(10,10,1,20)
clu <- signed_blockmodel(g,k = 10,alpha = 0.5)
table(clu$membership)
clu$criterion
# Using simulated annealing (less change of getting trapped in local optima)
data("tribes")
clu <- signed_blockmodel(tribes,k = 3,alpha=0.5,annealing = TRUE)
table(clu$membership)
clu$criterion
# }
Run the code above in your browser using DataLab