MST-kNN Clustering Algorithm
Overview
Implements the MST-kNN clustering algorithm proposed by Inostroza-Ponta (2008) https://trove.nla.gov.au/work/28729389. The algorithm determines the number of clusters automatically by recursively intersecting the Minimum Spanning Tree (MST) and the k-Nearest Neighbor (kNN) proximity graphs constructed from a pairwise distance matrix. The value of k is selected via a connectivity criterion (the smallest k such that the kNN graph is connected, bounded by floor(log(n))). The package requires only a distance matrix as input and returns cluster assignments, an 'igraph' network, and partition metadata.
- First major release.
- kNN construction uses a partial-sort approach that stores only
floor(log(n))neighbours per node, yielding O(n^2 log n) time and O(n * log(n)) working memory. - MST is computed via
igraph::mst()on a sparse edge list constructed from integer index vectors. - All deprecated igraph function calls replaced with modern equivalents (
components(),intersection(),is_connected(), etc.). - Package structure reorganised following R Packages (2e) conventions: one file per exported function, testthat test suite, pkgdown site.
- Computational performance benchmarks added (see
inst/extdata/benchmark_performance.R). - Added pkgdown website at <https://jorgeklz.github.io/package-mstknnclust/>.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 5 (2 internal)
- Examples that run
- 100%1 run in a plain check
- Exported functions with examples
- 33%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 40%
Downloads
Repository
Stars over time
Forks over time
3 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/jorgeklz/package-mstknnclust on 2026-10-22.
GitHub Pages site last deployed 2026-05-12
pkgdown site last built 2026-05-11, before release 1.0.0 (2026-05-13)
Dependencies
Installing mstknnclust adds 9 packages (6 with compiled code, 8.0 MB of source tarballs). Heaviest: igraph 4.8 MB, vctrs 1.0 MB, rlang 766 KB.
Code & Tests
Datasets
People & History
Maintainer since 0.1.0 (2019)
Pick two releases to compare their code metrics.
- 1.0.0Latest2026-05-13 · current release · diff ↗ ·
removed 4 exports
compute.costs.proximity.graph, generate.complete.graph, generate.knn, generate.mst - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.3.22023-01-27 · diff ↗
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.3.12020-09-17 · diff ↗
- 0.3.02020-07-14 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.2.02019-12-05 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 0.1.02019-02-06
- RR 3.5.0 released · 2018-04-23
Package metadata
- First published
- 2019-02-06
- Total releases
- 6 / 7 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 217 KB / 2 files
- Download size
- 339 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mstknnclust")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.