gseg_kmst: Construct a k-MST Similarity Graph

View source: R/canonical-interface.R

gseg_kmstR Documentation

Construct a k-MST Similarity Graph

Description

Constructs the k-MST used by default in the data-level gSeg interface.

Usage

gseg_kmst(x = NULL, dissimilarity = NULL, k = NULL)

Arguments

x

Optional data matrix with observations in rows.

dissimilarity

Optional square dissimilarity matrix or a dist object. Supply exactly one of x and dissimilarity.

k

Number of complete MST layers. The default is floor(sqrt(N)); the largest allowed value is floor(N/2).

Value

A two-column edge matrix containing the union of the first k MST layers.

Examples

set.seed(1)
x <- matrix(rnorm(60), nrow = 20)
E <- gseg_kmst(x = x)
attr(E, "k")

gSeg documentation built on Sept. 9, 2026, 5:07 p.m.