FlagGenerator

org.appliedtopology.tda4j.LayeredInorderSimplexStream.FlagGenerator
See theFlagGenerator companion object
open class FlagGenerator(val n: Int, val threshold: Double, val candidates: Candidates, edgeList: Edges, val deadline: Array[Double])

Builds the layers of the flag complex of a weighted graph on the vertices 0 until n, up to threshold: a set of vertices is a simplex when all its pairs are edges, and its value is the largest edge weight, the diameter in the paper. Vietoris-Rips is the graph with an edge for every pair within threshold (Generator).

The paper writes vertices in decreasing order and lets the facet without the largest vertex generate a simplex when it can. Here vertices ascend and the smallest vertex plays that part, which makes simplices with the same first longest edge come out colexicographically descending. For a simplex u0 < u1 < ... < uk of diameter α whose first longest edge (the full-length edge a < b with the largest a, then the largest b) is ab:

  1. any w < u0 within α of every vertex gives w u0 ... uk;
  2. if a = u0 (every full-length edge contains u0), any u0 < w < u1 within α of u0 and closer than α to the rest gives u0 w u1 ... uk;
  3. if moreover b = u1 (the only full-length edge is u0 u1), any u1 < w < u2 (any w > u1 for an edge) closer than α to every vertex gives u0 u1 w u2 ... uk.

In each case the new simplex keeps the first longest edge ab, so the diameter is never recomputed. The candidates are emitted largest first. On points in general position (no two distances equal) that is already the colexicographically descending order of each tie; elsewhere a run of equal diameters that comes out of order is sorted, and counted in tieRunsSorted.

Only the edge weights are read, so any flag filtration whose simplices take the largest weight of their edges can be built with it. A vertex w can also leave: with deadline(w) < α the vertex is added to no simplex of value α (Sheehy's sparse Rips complex, where a point vanishes from the nerve after a scale); an empty deadline means no vertex does. A vertex's own value never matters for the layers from dimension 1 on, provided no edge is below the values of its ends, as in the DTM filtration.

Value parameters

deadline

per vertex, the last value at which it can join a simplex; empty for no deadline

edges

the edges within threshold, unsorted, each once with a < b (FlagGenerator.ofEdges checks and builds them)

Attributes

Companion
object
Source
LayeredInorderSimplexStream.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Generator

Members list

Value members

Concrete methods

def cofacets(layer: Layer): Layer

Dimension layer.dim + 1, from layer in filtration order.

Dimension layer.dim + 1, from layer in filtration order.

Attributes

Source
LayeredInorderSimplexStream.scala
def colexCompare(layer: Layer, x: Int, y: Int): Int

Colexicographic comparison of simplices x and y of layer: the larger top vertex wins, then the next.

Colexicographic comparison of simplices x and y of layer: the larger top vertex wins, then the next.

Attributes

Source
LayeredInorderSimplexStream.scala
def diameter(layer: Layer, i: Int): Double

Concrete fields

val deadline: Array[Double]
val edgeA: Array[Int]
val edgeB: Array[Int]
val edgeCount: Int
val edgeLength: Array[Double]
val n: Int
val threshold: Double
var tieRunsSorted: Long

Runs of equal diameter that came out of cofacets in the wrong tie order and were sorted.

Runs of equal diameter that came out of cofacets in the wrong tie order and were sorted.

Attributes

Source
LayeredInorderSimplexStream.scala