calculate_reachability_distance: Compute mutual-reachability (reachability) distances

View source: R/disco.R

calculate_reachability_distanceR Documentation

Compute mutual-reachability (reachability) distances

Description

For every pair of points (i, j), the mutual-reachability distance is

d_{\text{reach}}(i,j) = \max\bigl(\text{core}_k(i),\; \text{core}_k(j),\; d(i,j)\bigr)

where \text{core}_k(i) is the distance from point i to its k-th nearest neighbour (k = \texttt{min\_points} - 1) and d(i,j) is the Euclidean distance.

Usage

calculate_reachability_distance(points, min_points = 5)

Arguments

points

A numeric matrix of shape n \times p.

min_points

A positive integer \geq 2 giving the neighbourhood size used for the core-distance calculation. Corresponds to MinPts in HDBSCAN. Default is 5.

Value

A symmetric n \times n numeric matrix of mutual-reachability distances with zeros on the diagonal.


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