
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 73a86ee U--- 300 939 -- 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 73a86ee:
#> [1] 1-- 5 1-- 24 1-- 25 1-- 32 1-- 56 1-- 60 1-- 65 1-- 81 1-- 85 1-- 88
#> [11] 1-- 90 1-- 95 1--169 2-- 9 2-- 12 2-- 30 2-- 32 2-- 41 2-- 46 2-- 62
#> [21] 2-- 63 2-- 64 2-- 69 2-- 78 2-- 92 2--100 3-- 9 3-- 35 3-- 42 3-- 46
#> [31] 3-- 51 3-- 61 3-- 81 3-- 83 4-- 15 4-- 17 4-- 20 4-- 22 4-- 51 4-- 56
#> [41] 4-- 80 4-- 89 4-- 92 4-- 96 4-- 97 4-- 99 4--114 5-- 50 5-- 73 5-- 76
#> [51] 5-- 87 5-- 91 5-- 97 6-- 21 6-- 23 6-- 25 6-- 26 6-- 27 6-- 43 6-- 48
#> [61] 6-- 50 6-- 65 6-- 79 6-- 84 6-- 94 7-- 14 7-- 36 7-- 47 7-- 54 7-- 82
#> + ... omitted several edges