Choosing the landmarks of a witness complex (de Silva and Carlsson, "Topological estimation using witness complexes", 2004), as JavaPlex does: landmarks are a subset of the points, given by their numbers. Assumes the metric space's elements are 0 until size.
The covering radius of an ARBITRARY landmark set, not necessarily one maxmin/random chose -- R = max_x min_{l in landmarks} d(x,l). maxmin/random already compute this as part of their own selection loop and return it via LandmarkSelection; this standalone version is for a caller who already has a landmark set (hand-picked, or reused from an earlier selection) and wants R for it -- e.g. to apply the JavaPlex tutorial's own 2R threshold recipe to landmarks it didn't just pick. O(metricSpace.size * landmarks.size), the same cost random's own inline version (now just this call) always was.
The covering radius of an ARBITRARY landmark set, not necessarily one maxmin/random chose -- R = max_x min_{l in landmarks} d(x,l). maxmin/random already compute this as part of their own selection loop and return it via LandmarkSelection; this standalone version is for a caller who already has a landmark set (hand-picked, or reused from an earlier selection) and wants R for it -- e.g. to apply the JavaPlex tutorial's own 2R threshold recipe to landmarks it didn't just pick. O(metricSpace.size * landmarks.size), the same cost random's own inline version (now just this call) always was.
Maxmin (farthest-point) sampling: start from firstLandmark and repeatedly add the point farthest from the landmarks so far, ties to the lowest index.
Maxmin (farthest-point) sampling: start from firstLandmark and repeatedly add the point farthest from the landmarks so far, ties to the lowest index.
Also returns the covering radius R = max_x min_l d(x, l) (a natural maxFiltrationValue is 2R) and each landmark's insertion radius (its distance to the earlier landmarks; Infinity for the first). With numLandmarks = metricSpace.size this is a greedy permutation of the whole space.
numLandmarks distinct points chosen uniformly at random (reproducibly, from seed). Cheaper than maxmin, with no covering guarantee; the covering radius is still computed and returned.
numLandmarks distinct points chosen uniformly at random (reproducibly, from seed). Cheaper than maxmin, with no covering guarantee; the covering radius is still computed and returned.