Examples for 'igraph::sample_sbm'


Sample stochastic block model

Aliases: sample_sbm sbm.game sbm

Keywords: graphs

### ** Examples


## Two groups with not only few connection between groups
pm <- cbind( c(.1, .001), c(.001, .05) )
g <- sample_sbm(1000, pref.matrix=pm, block.sizes=c(300,700))
g
IGRAPH 5fa3138 U--- 1000 16898 -- Stochastic block model
+ attr: name (g/c), loops (g/l)
+ edges from 5fa3138:
 [1]  1-- 4  2-- 9  5-- 9  7--11  9--11  2--13  4--14  5--14 12--14 12--15
[11]  3--16  4--17  7--18  8--18 11--18 15--18  2--19 15--19  2--20 14--20
[21] 15--20 19--20  7--21 14--22  1--23 16--23 10--24  9--25 12--25  4--26
[31]  5--27 19--27  7--28 14--28 20--28 25--28 14--29 15--29 25--29 27--29
[41] 11--30 23--30  1--31 12--31 15--31  9--32 10--32 13--32  1--33  4--33
[51]  6--33  9--33 11--33 16--33  3--34  6--34 11--34 12--35 28--35  2--36
[61]  6--36 12--36 26--36 28--36  2--37  3--37  7--37 19--37 12--38 16--38
[71]  2--39  6--39  9--39 10--39 16--39 17--39 23--39 32--39 33--39  6--40
+ ... omitted several edges

[Package igraph version 1.3.1 Index]