Skip to contents

Generate a (U,W) mixture graph from a dense graphon W and a mass partition corresponding to a line graph graphon U.

Usage

sample_mixed_graph(W, wts, nd, ns, p = 0.5, option = 2)

Arguments

W

The dense graphon. This is a symmetric matrix with values in [0,1]

wts

The degree proportions of the hub degrees. Need to add up to 1. This is the mass partition corresponding to the line graph graphon U.

nd

The number of nodes in the dense part of the graph

ns

The number of nodes in the sparse part of the graph

p

The nodes to be added as a proportion of the edges in the dense part

option

Graph joining option. If option == 1 then a disjoit union is considered. If option == 2 the two graphs are joined randomly with the number of edges specified by p.

Value

A graph sampled from the (U,W) mixture.

Examples

library(igraph)
W <- matrix(0.1, nrow = 100, ncol = 100)
wts <- c(0.5, 0.3, 0.2)
ns <- 200
nd <- 100
p <- 0.5
gr <- sample_mixed_graph(W, wts, nd, ns, p, option = 2)
gr
#> IGRAPH 384075c U--- 300 943 -- Star
#> + attr: name_1 (g/c), name_2 (g/c), mode_1 (g/c), mode_2 (g/c),
#> | center_1 (g/n), center_2 (g/n), name (g/c), mode (g/c), center (g/n)
#> + edges from 384075c:
#>  [1] 1--  5 1-- 12 1-- 29 1-- 70 1-- 95 1-- 97 1--236 2--  4 2-- 19 2-- 49
#> [11] 2-- 56 2-- 60 2-- 62 2-- 65 2-- 77 2-- 92 2-- 96 3--  6 3--  8 3-- 13
#> [21] 3-- 24 3-- 25 3-- 30 3-- 42 3-- 58 3-- 68 3-- 70 3-- 80 3-- 88 3-- 90
#> [31] 3-- 93 3--114 3--228 4-- 14 4-- 15 4-- 27 4-- 42 4-- 43 4-- 58 4-- 64
#> [41] 4-- 70 4-- 74 4-- 87 4-- 90 4-- 92 4--235 5-- 11 5-- 46 5-- 57 5-- 64
#> [51] 5-- 73 5-- 80 5-- 89 5-- 98 5--127 6-- 14 6-- 29 6-- 35 6-- 44 6-- 66
#> [61] 6-- 73 6-- 78 6-- 80 6-- 85 6--245 7--  8 7--  9 7-- 10 7-- 24 7-- 26
#> + ... omitted several edges