EdgeCollapsedMetricSpace

org.appliedtopology.tda4j.streams.EdgeCollapsedMetricSpace

The collapsed graph, reified as a FiniteMetricSpace[Int] over the SAME vertex ids as originalMetricSpace -- exactly the pattern WitnessMetricSpace already established for a non-metric, collapse-derived weighted graph, so it slots directly into EnumeratingCofaceSimplexStream/RipserCofaceSimplexStream unchanged. +Infinity for a collapsed-away (or never-present) pair, matching SparseMetricSpace's own "+Infinity past the cutoff, not excluded" convention.

'''Not a real metric''': collapsed edges can violate the triangle inequality freely (that is the entire point -- a shortcut through a dominating vertex is exactly what gets removed). Never hand this to JVPTree, SparseMetricSpace, RecursiveStackVietorisRipsSimplexStream, or the alpha package, same restriction WitnessMetricSpace's own doc states for the identical reason.

'''The enclosing-radius hazard''' (.claude/WORKLOG-mainstream-feature-gap-analysis.md item 5's own flagged risk, confirmed real): FiniteMetricSpace's default minimumEnclosingRadius is elements.map(x => elements.map(y => distance(x,y)).max).min -- computed against a graph that now has genuine +Infinity entries, that formula can itself evaluate to +Infinity the moment every vertex has at least one collapsed-away incident pair, silently disabling truncation for any downstream consumer that relies on the None default. Fixed structurally, not by caller discipline: minimumEnclosingRadius is overridden here to validUpTo (the bound EdgeCollapse.collapse actually used, itself defaulted from originalMetricSpace's own OWN enclosing radius when the caller passed no explicit bound) -- so a downstream maxFiltrationValue = None is always safe by construction, with nothing for a caller to remember.

Attributes

Experimental
true
Graph
Supertypes
trait FiniteMetricSpace[Int]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def contains(x: Int): Boolean
def distance(x: Int, y: Int): Double

Distance in the metric space. Takes two indices and returns a non-negative real number.

Distance in the metric space. Takes two indices and returns a non-negative real number.

Value parameters

x

Index of first point

y

Index of second point

Attributes

Returns

Distance between x and y

def elements: Iterable[Int]

Access to all points in the metric space. Implemented by eg scala.collections.Range for simple Int-indexed spaces, but this definition gives more space for different underlying possible representations.

Access to all points in the metric space. Implemented by eg scala.collections.Range for simple Int-indexed spaces, but this definition gives more space for different underlying possible representations.

Attributes

Returns

Iterable that returns all points in the metric space

def size: Int

Number of points represented by this metric space.

Number of points represented by this metric space.

Attributes

Concrete fields

lazy override val minimumEnclosingRadius: Double

Beyond this radius, the Vietoris-Rips complex is a cone and will have no further homological structure. See e.g. the Ripser paper, page 412.

Beyond this radius, the Vietoris-Rips complex is a cone and will have no further homological structure. See e.g. the Ripser paper, page 412.

Attributes

val stats: Stats
val validUpTo: Double