given_degree_list: Adjacency list version of pairing algorithm for generating...

Description Usage Arguments Details Value Note Examples

Description

given_degree_list creates an adjacency matrix representation of an undirected graph generated with a given degree sequence

Usage

1
given_degree_list(N, degree, max_iterations = 1000)

Arguments

N

Number of vertices / nodes in the network.

degree

number of neighbours of each node.

Details

This functon generates an undirected random graph of size N, each node having degree given by the user. The code only generates "simple" graphs: Self and repeated edges are not permitted. For this reason so for speed reasons checks are performed during edge creation.

Value

adjacency list representation of the resultant network

Note

For speed reasons, checks are performed during an edge creation to ensure the pairing does not create a loop nor multiple edges between the same nodes. This may introduce some bias in the algorithm. I need to read up on this but for the time being I think this is ok.

Examples

1
2
3
N <- 1000
degree <- rep(2, N)
gr <- given_degree_list(N, degree)

tjtnew/graphr documentation built on May 19, 2019, 9:38 p.m.