barabasi_albert_blocks {clustAnalytics}R Documentation

Generates a Barabási-Albert graph with community structure

Description

Generates a Barabási-Albert graph with community structure

Usage

barabasi_albert_blocks(
  m,
  p,
  B,
  t_max,
  G0 = NULL,
  t0 = NULL,
  G0_labels = NULL,
  sample_with_replacement = FALSE,
  type = "Hajek"
)

Arguments

m

number of edges added at each step.

p

vector of label probabilities. If they don't sum 1, they will be scaled accordingly.

B

matrix indicating the affinity of vertices of each label.

t_max

maximum value of t (which corresponds to graph order)

G0

initial graph

t0

t value at which new vertex start to be attached. If G0 is provided, this argument is ignored and assumed to be gorder(G0)+1. If it isn't, a G0 graph will be generated with order t0-1.

G0_labels

labels of the initial graph. If NULL, they will all be set to 1.

sample_with_replacement

If TRUE, allows parallel edges.

type

Either "Hajek" or "block_first".

Value

The resulting graph, as an igraph object. The vertices have a "label" attribute.

Examples

B <- matrix(c(1, 0.2, 0.2, 1), ncol=2)
G <- barabasi_albert_blocks(m=4, p=c(0.5, 0.5), B=B, t_max=100, type="Hajek", 
                            sample_with_replacement = FALSE)


[Package clustAnalytics version 0.5.5 Index]