Skip to contents

Joins two graphs randomly connecting vertices

Usage

graph_join(gr1, gr2, p = 0.5, option = 2)

Arguments

gr1

The first graph to join

gr2

The second graph to join

p

The proportion of edges in gr1 to be added as part of the joining

option

Two options. 1 does the disjoint union, 2 does the random edges union.

Value

The joined graph

Examples

W <- create_exp_matrix(100, 100)
# create the sparse part - a disjoint set of stars
wts <- c(0.5, 0.3, 0.2)
grdense <- sample_graphon(W, 100)
grsparse <- generate_star_union(wts, 200)
gr <- graph_join(grdense, grsparse, opt = 2)