The function generates random partitions. The function is meant to be caled by the function opt.random.par
genRandomPar(k, n, seed = NULL, mingr = 1, maxgr = Inf,
addParam = list(genPajekPar = TRUE, probGenMech = NULL))
Number of clusters (by modes)
Number of units (by modes)
Seed for generating random numbers (partitions)
Minimal alowed group size
Maximal alowed group size
This has to be a list with the following parameters (any or all can be missing, then the default values (see usage) are used):
"genPajekPar" - Should the partitions be generated as in Pajek (Batagelj and Mrvar, 2006). If FALSE
, all partitions are selected completly at random while making sure that the partitions have the required number of clusters.
"probGenMech" - Here the probabilities for 4 diferent generating mechanichems can be specified. If this is not specified, the value is set to c(1/3,1/3,1/3,0)
if genPajekPar
is TRUE
and to c(0,0,0,1)
if genPajekPar
is FALSE
. The first 3 mechanisems are the same as implemetned in Pajek (the second one has almost all units in only one cluster) and the fourth is completly random (from uniform distribution).
A random partition in the format required by opt.random.par
. If a netowork has several modes, than a list of partitions, one for each mode.
BATAGELJ, Vladimir, MRVAR, Andrej (2006): Pajek 1.11, http://mrvar.fdv.uni-lj.si/pajek/ (accessed January 6, 2006).