get_mst_edges: Compute a minimum spanning tree via Prim's algorithm

View source: R/disco.R

get_mst_edgesR Documentation

Compute a minimum spanning tree via Prim's algorithm

Description

Implements Prim's algorithm exactly as in the reference Python code (dctree.py, lines 401–438), operating on a precomputed distance matrix.

Usage

get_mst_edges(dist_matrix)

Arguments

dist_matrix

A symmetric n \times n numeric distance matrix.

Value

A data.frame with n-1 rows and three columns:

i

Integer index of the first endpoint (1-based).

j

Integer index of the second endpoint (1-based).

dist

Edge weight.


discoCVI documentation built on Oct. 28, 2026, 1:07 a.m.