BruteForce

org.appliedtopology.tda4j.streams.BruteForce
class BruteForce[VertexT](metricSpace: FiniteMetricSpace[VertexT]) extends SpatialQuery[VertexT]

Attributes

Experimental
true
Graph
Supertypes
trait SpatialQuery[VertexT]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def nearestNeighbors(v: VertexT, k: Int): IndexedSeq[VertexT]

The k nearest points to v (by metricSpace.distance), sorted ascending by distance, v itself included when it belongs to the underlying metric space (a real metric always has distance(v,v) = 0, the smallest possible, so v is always its own nearest neighbour) -- this is the convention streams.DistanceToMeasure needs (Chazal-Cohen-Steiner-Merigot 2011's empirical DTM counts a point among its own k neighbours; verified against GUDHI's own DistanceToMeasure/KNearestNeighbors docstring AND a worked numeric example, see .claude/WORKLOG-dtm-filtrations.md). require(1 <= k && k <= metricSpace.size): a k outside that range has no sensible answer (jvptree's own getNearestNeighbors silently clamps to however many points exist, which would silently under-deliver rather than fail loudly).

The k nearest points to v (by metricSpace.distance), sorted ascending by distance, v itself included when it belongs to the underlying metric space (a real metric always has distance(v,v) = 0, the smallest possible, so v is always its own nearest neighbour) -- this is the convention streams.DistanceToMeasure needs (Chazal-Cohen-Steiner-Merigot 2011's empirical DTM counts a point among its own k neighbours; verified against GUDHI's own DistanceToMeasure/KNearestNeighbors docstring AND a worked numeric example, see .claude/WORKLOG-dtm-filtrations.md). require(1 <= k && k <= metricSpace.size): a k outside that range has no sensible answer (jvptree's own getNearestNeighbors silently clamps to however many points exist, which would silently under-deliver rather than fail loudly).

Attributes

Definition Classes
override def neighbors(v: VertexT, epsilon: Double): Set[VertexT]

Attributes

Definition Classes