
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 e70d92a U--- 300 892 -- 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 e70d92a:
#> [1] 1-- 7 1-- 9 1-- 10 1-- 25 1-- 29 1-- 32 1-- 53 1-- 54 1-- 60 1-- 64
#> [11] 1-- 72 1-- 75 1--100 2-- 6 2-- 9 2-- 11 2-- 24 2-- 47 2-- 56 2-- 62
#> [21] 2-- 67 2-- 71 2-- 74 2-- 88 2-- 91 2-- 96 2--245 2--256 2--280 3-- 5
#> [31] 3-- 19 3-- 30 3-- 37 3-- 66 3-- 98 3--193 4-- 29 4-- 45 4-- 58 4-- 65
#> [41] 4-- 81 4-- 82 4-- 94 4-- 96 4--214 5-- 6 5-- 11 5-- 21 5-- 43 5-- 47
#> [51] 5-- 52 5-- 54 5-- 56 5-- 95 5--237 6-- 43 6-- 55 6-- 61 6-- 74 6-- 82
#> [61] 6--103 6--180 6--248 7-- 9 7-- 12 7-- 16 7-- 20 7-- 23 7-- 32 7-- 41
#> + ... omitted several edges