
Generate a (U,W) mixture graph
sample_mixed_graph.RdGenerate a (U,W) mixture graph from a dense graphon W and a mass partition corresponding to a line graph graphon U.
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 == 1then a disjoit union is considered. Ifoption == 2the two graphs are joined randomly with the number of edges specified byp.
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 bcd40d8 U--- 300 931 -- 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 bcd40d8:
#> [1] 1-- 7 1-- 11 1-- 13 1-- 16 1-- 42 1-- 46 1-- 51 1-- 54 1-- 61 1-- 68
#> [11] 1-- 74 1-- 86 1-- 99 1--100 1--129 1--150 2-- 11 2-- 14 2-- 15 2-- 19
#> [21] 2-- 29 2-- 41 2-- 52 2-- 54 2-- 55 2-- 57 2-- 61 2-- 65 2-- 82 2-- 94
#> [31] 3-- 7 3-- 8 3-- 10 3-- 18 3-- 33 3-- 40 3-- 57 3-- 63 3-- 68 3-- 73
#> [41] 3-- 92 3--167 3--209 3--281 4-- 15 4-- 21 4-- 23 4-- 26 4-- 30 4-- 53
#> [51] 4-- 60 4-- 78 4-- 85 4-- 97 5-- 35 5-- 48 5-- 49 5-- 53 5-- 56 5-- 73
#> [61] 5-- 78 5-- 80 5-- 85 5-- 96 5--100 5--160 5--245 6-- 12 6-- 18 6-- 22
#> + ... omitted several edges