generate_graph.sbm: draw a random graph from a 4group_oneparam_simple stochastic...

View source: R/stochastic_block_model.R

generate_graph.sbmR Documentation

draw a random graph from a 4group_oneparam_simple stochastic blockmodel

Description

Draw a random graph from a stochastic blockmodel using a k-vector of block sizes and a k x k preference matrix

Usage

## S3 method for class 'sbm'
generate_graph(params)

Arguments

params

a list containing block.sizes, pref.matrix, and optionally block.names

Details

This routine is agnostic about the algorithm that was used to produce the preference matrix and the block sizes, so it could potentially be used with a lot of different models.

The igraph object that gets returned is a graph drawn from the stochastic block-model. The vertices each have a 'group' attribute containing the name of the block they have been assigned to. These block names default to 'group.1', 'group.2', ... if none are specified.

Value

the igraph object with each vertex's group membership given by a vertex attribute


dfeehan/nrsimulatr documentation built on Feb. 27, 2024, 3:18 a.m.