Skip to contents

Transform distance matrix in edge properties of minimal spanning tree

Usage

edge_count_global_variables(d, n1, k = 1L)

Arguments

d

A matrix of dimension \((n1+n2)x(n1+n2)\) containing the distances between all the elements of the two samples put together.

n1

An integer giving the size of the first sample.

k

An integer specifying the density of the minimal spanning tree to generate.

Value

A list of edge properties of the minimal spanning tree.

Examples

n1 <- 30L
n2 <- 10L
gnp_params <- list(n = 24L, p = 1/3)
degree_params <- list(out_degree = rep(2, 24L), method = "configuration")
x <- nvd(sample_size = n1, model = "gnp", !!!gnp_params)
#>  Calling the `tidygraph::play_gnp()` function with the following arguments:
#> • n: 24
#> • p: 0.333333333333333
#> • directed: TRUE
#> • loops: FALSE
y <- nvd(sample_size = n2, model = "degree", !!!degree_params)
#>  Calling the `tidygraph::play_degree()` function with the following arguments:
#> • out_degree: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, …, 2, and 2
#> • method: configuration
#> • in_degree: NULL
d <- dist_nvd(x, y, representation = "laplacian", distance = "frobenius")
e <- edge_count_global_variables(d, n1, k = 5L)