Skip to contents

Samples a graph from a sparsified graphon given by a_n W, where W is the graphon and a_n is generally a sequence converging to zero.

Usage

sample_sparse_graphon(W, rho_n = NULL, n)

Arguments

W

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

rho_n

A function. Default is 1.

n

The number of nodes in the graph to sample

Value

gr A graph sampled from rho_n W.

Examples

library(igraph)
f1 <- function(n) 10/n
W <- matrix(0.2, nrow = 100, ncol = 100)
gr <- sample_sparse_graphon(W, f1, n = 100)
gr
#> IGRAPH f11ff9c U--- 100 92 -- 
#> + edges from f11ff9c:
#>  [1]  2-- 6  2--53  2--68  2--72  3--10  3--51  3--65  3--99  4--28  4--47
#> [11]  6--36  6--61  6--93  8--20  8--46  8--62  9--12  9--49  9--95 10--63
#> [21] 11--96 12--97 13--41 13--82 13--95 14--17 14--33 14--63 15--49 15--90
#> [31] 16--82 18--74 18--76 20--86 21--48 21--95 22--99 23--60 23--70 24--57
#> [41] 25--91 26--32 27--30 27--69 28--50 28--64 29--56 29--90 30--32 31--58
#> [51] 31--70 31--73 34--36 35--84 35--88 36--74 37--72 39--65 40--44 42--63
#> [61] 42--98 43--84 43--96 45--51 45--98 48--61 49--53 53--92 54--62 54--65
#> [71] 55--59 55--61 56--87 56--99 57--87 58--62 58--64 58--84 59--81 59--93
#> [81] 61--85 64--90 64--98 65--93 66--92 68--92 79--87 82--95 83--91 87--99
#> + ... omitted several edges