RL: Relocating Links algorithm (RL algorithm)

Description Usage Arguments Value Author(s) Source Examples

View source: R/RL.R

Description

The function generate random network considering the selected types of triads.

Usage

1
RL(ideal.net, initial.net, triads = "forb", k = 100, custom.triads = NULL)

Arguments

ideal.net

Network with an ideal (desired) blockmodel; of class matrix.

initial.net

Initial network; of class matrix.

triads

Which types of triads has to be considered (allowed allow, forbidden forb, all all or custom cust).

k

Number of iterations.

custom.triads

Additional terms to be considered. Only if terms = "cust".

Value

A list contiainig: new.network which is the generated network; and CR which is a vector of CR values (a value is calculated after each iteration).

Author(s)

Marjan Cugmas

Source

Cugmas M, Ferligoj A, ?iberna A (2018) Generating global network structures by triad types. PLoS ONE 13(5): e0197514. https://doi.org/10.1371/journal.pone.0197514

Examples

1
2
3
4
5
6
7
8
# generate initial and ideal network
cohesiveBM <- rbind(c("com", "nul"), c("nul", "com"))
ideal <- gen.network.LE(BM = cohesiveBM, LE = 0, n = 12, size = rep(0.5, 2))
random <- gen.network.LE(BM = cohesiveBM, LE = 1, n = 12, size = rep(0.5, 2))
# generate network with the RL algorithm
generatedNetwork <- RL(ideal.net = ideal, initial.net = random, triads = "all", k = 1000)
# evaluate the obtained network
res <- blockmodeling::optRandomParC(M = generatedNetwork[[1]], k = 2, approaches = "bin", blocks = c("null", "com"), rep = 1000, nCores = 1)

nem documentation built on April 23, 2021, 3 p.m.

Related to RL in nem...