Abstract 1 Introduction 2 Preliminary 3 Computing 𝒅 in 𝟐 4 Computing 𝒅𝟏 in 𝟐 5 Computing 𝒅 in 𝟑 6 Conclusion References

Computing the Bottleneck Distance Between Persistent Homology Transforms

Michael Kerber ORCID Institute of Geometry, Graz University of Technology, Austria    Elena Xinyi Wang ORCID Institute of Geometry, Graz University of Technology, Austria
University of Fribourg, Switzerland
Abstract

The Persistent Homology Transform (PHT) summarizes a shape in m by collecting persistence diagrams obtained from linear height filtrations in all directions on 𝕊m1. It enjoys strong theoretical guarantees, including continuity, stability, and injectivity. A natural way to compare two PHTs is to use the bottleneck distance between their diagrams as the direction varies. Prior work has either compared PHTs by sampling directions or, in 2D, computed the exact integral of bottleneck distance over all angles via a kinetic data structure. We improve the integral objective to O~(n5) in place of the earlier O~(n6) bound, where n denotes the number of simplices. For the max objective, we give an O~(n3) expected-time algorithm in 2 and an O~(n5) expected-time algorithm in 3.

Keywords and phrases:
Kinetic data structure, bottleneck distance, persistent homology transform, vineyards
Funding:
Michael Kerber: Supported by the Austrian Science Fund (FWF) 10.55776/P33765.
Elena Xinyi Wang: Supported by the Austrian Science Fund (FWF) 10.55776/P33765.
Copyright and License:
[Uncaptioned image] © Michael Kerber and Elena Xinyi Wang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Algebraic topology
; Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/pdf/2512.00821
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Persistent homology captures the multiscale evolution of homology classes along a filtration induced by a real-valued function on a space. It has proved useful across fields such as materials science [9, 14], computational biology [12, 19], as well as machine learning [3, 13], providing robust descriptors for high-dimensional data. A persistence diagram is a concise multiset summary of persistent homology, recording the birth–death times of features. Similarity between objects is then assessed by comparing their diagrams, most commonly via the bottleneck distance. Computationally, this reduces to a minimum-bottleneck perfect matching on a bipartite graph with diagonal copies, and algorithms for this problem have been studied extensively in both theory and practice [2, 6, 10, 15, 16].

Since a single diagram depends on the chosen filter and may miss geometry, the Persistent Homology Transform (PHT) collects diagrams from all directions to retain fuller information [20]. It assigns to a shape in m the collection of persistence diagrams obtained from linear height filtrations over all directions on 𝕊m1. It possesses many desirable theoretical properties such as continuity, stability, and injectivity [5, 11, 20]. These properties make the PHT an effective topological descriptor for applications. However, unlike other directional-transform–based signatures such as the Euler Characteristic Transform, the PHT lacks efficient comparison algorithms, limiting its practical use. A natural way to compare PHTs is to sample directions and compute the bottleneck distance only at those angles. This inevitably leads to information loss. To integrate the bottleneck distance over the parameter domain (e.g., 𝕊m1), prior work by Munch, Wang, and Wenk introduced a kinetic “hourglass” approach that maintains matchings as the parameter moves. It computes this integral with an O~(n6) bound for data in 2 [18]. In this work, we focus on the max variant, which we define as the supremum of the bottleneck distance over all directions.

Our Contributions.

We provide an O~(n3) expected-time algorithm to compute the max bottleneck distance between PHTs of shapes in 2 and an O~(n5) expected-time algorithm in 3, where O~ means the logarithmic factor is ingored. Additionally, we improve the computation of the integral distance from the previous O~(n6) bound to O~(n5) in 2.

For the max bottleneck distance, we use techniques from computational geometry and topology and inspired by the strategy of Bjerkevik and Kerber for computing the matching distance for two-parameter modules [1]. At a high level, the solution for 2D and 3D are similar. We first reformulate the problem as a decision problem: given a threshold λ, we determine whether the max bottleneck distance is at most λ. To solve this, we sweep the direction parameter around the sphere while maintaining the bottleneck matching between the two persistence diagrams. The key insight is that this matching changes only at discrete “events”: points where persistence diagrams change combinatorially or where edge weights cross the threshold λ. At each event, we update the matching using a single augmenting path search in the geometric bipartite graph, exploiting the fact that only local changes occur.

We then identify that the maximum bottleneck distance must occur at one of a finite set of candidate values, corresponding to critical points and intersections of the difference functions between simplices. While there are O(n4) candidates in 2D and O(n6) in 3D, we avoid exhaustive enumeration through a randomized incremental construction. We maintain a band containing the true maximum and iteratively refine it by processing simplices in random order, testing whether their associated candidates lie within the current band. The randomization ensures that we expect only O(logn) refinements, reducing the expected complexity to O~(n3) in 2D and O~(n5) in 3D.

Outline.

We begin in Section 2 with a brief overview of persistent homology, persistence diagrams, and the PHT, and we formalize the problem. Section 3 presents our 2 algorithm: first at a high level, then with full technical details. The improvement for the integral distance is shown in Section 4. Section 5 extends the approach to 3 before concluding in Section 6.

2 Preliminary

2.1 Persistent homology

Persistent homology is a multi-scale summary of the connectivity of objects in a nested sequence of subspaces; see [7, 8] for an introduction. For the purposes of this section, we define a persistence diagram to be a finite collection of points {(bi,di)}i with dibi for all i.

Given two persistence diagrams X and Y, a partial matching is a bijection η:XY on a subset of the points XX and YY; we denote this by η:XY. The cost of a partial matching is the maximum over the L-norms of all pairs of matched points and the distance between the unmatched points to the diagonal:

c(η)=max({xη(x)xX}{12|z2z1|(z1,z2)(XX)(YY)}) (1)

and the bottleneck distance is defined as dB(X,Y)=infη:XYc(η).

We can reduce finding the bottleneck distance between persistence diagrams to the problem of finding the bottleneck cost of a bipartite graph. Let X and Y be two persistence diagrams given as finite lists of off-diagonal points. For any off-diagonal point z=(z1,z2), the orthogonal projection to the diagonal is z=((z1+z2)/2,(z1+z2)/2). Let X¯ (resp. Y¯) be the set of orthogonal projections of the points in X (resp. Y). Set U=XY¯ and V=YX¯. We define the complete bipartite graph G=(UV,U×V,c), where for uU and vV, the weight function c is given by

c(uv)={uvif uX or vY0if uX¯ and vY¯.

An example of the bipartite graph construction is shown in Figure 1. This graph can be used to compute the bottleneck distance of the input diagrams because of the following lemma.

Lemma 1 (Reduction Lemma [8]).

For the above construction of G, dB(G)=dB(X,Y).

Figure 1: Construction of the bipartite graph G based on the persistence diagrams X and Y.

2.2 Persistent homology transform

Let K be a finite simplicial complex embedded in m. For any direction ω𝕊m1, the height function hω:|K| is defined by hω(x)=x,ω. The lower-star filtration induced on the abstract complex K is given by:

hω(σ)=max{hω(v)vσ},

and the sublevelset at height a is the full subcomplex induced by vertices {vKhω(v)a}. Filtering K by hω produces a persistence diagram Dgmk(hωK). We focus on k=0,1 for m=2, and k=0,1,2 for m=3.

The persistent homology transform (PHT) is defined as:

PHT(K):𝕊m1𝒟,ωDgm(hωK),

where 𝒟 is the space of persistence diagrams. The PHT is injective [20, 5], making it a faithful shape representation.

2.3 Maximum bottleneck distance

In this work, we are interested in comparing two finite embedded simplicial complexes, K,Km, m=2 or 3, by comparing their PHTs. We define the maximum bottleneck distance between K and K to be:

d(PHT(K),PHT(K))=maxω𝕊m1dB(Dgm(hωK),Dgm(hωK)).

This distance is a variant of a similar integral distance that has been studied previously by Munch, Wang, and Wenk [18]:

d1(PHT(K),PHT(K))=𝕊m1dB(Dgm(hωK),Dgm(hωK))𝑑ω.

Both d and d1 inherit stability from the bottleneck distance. However, they differ from a computational perspective. Computing d1 requires full knowledge of the whole domain, which is inevitably expensive. Our d metric seeks the maximum value, which allows us to reformulate the problem as finding the supremum over a finite set of candidate values rather than tracking the bottleneck distance continuously.

A key property that makes our algorithmic approach feasible is that the bottleneck distance function is Lipschitz continuous, which is a direct consequence of the stability of the bottleneck distance (see the full version for a complete proof):

Lemma 2.

Let H(ω):=dB(Dgm(hωK),Dgm(hωK)) denote the bottleneck distance between persistence diagrams. Then the function H:𝕊m1 is Lipschitz continuous with constant RK+RK, where RK=maxvK(0)v and RK=maxv(K)(0)v.

3 Computing 𝒅 in 𝟐

Our setup in this section is as follows: we are given two geometric simplicial complexes K, K in 2 with at most n simplices each. The goal is to compute d: we first introduce the necessary notation, then give a high-level overview, and finally present the technical details.

3.1 Events

For each simplex αKK, we define an insertion curve Iα(ω). These curves record the height at which each simplex enters the sublevel-set filtration induced by direction ωS1. Explicitly, if the k-simplex α has vertices {v0,,vk}V(K), its insertion curve is

Iα(ω):=max0ikhω(vi),hω(x)=x,ω.

Each Iα is a piecewise-trigonometric function on S1.

There are at most 2n such curves. We now define difference curves that capture both matched and unmatched contributions to the bottleneck distance. For distinct simplices α,σ:

Δα,σ(ω):={|Iα(ω)Iσ(ω)|if α,σ are from different complexes12|Iα(ω)Iσ(ω)|if α,σ are from the same complex

These are real-valued functions on S1; geometrically, one can picture their graphs as curves in S1×0. The factor of 12 corresponds to the contribution of unmatched points to the bottleneck distance, see Equation 1. There are O(n2) such curves for |K|,|K|=O(n). We call the vertex vi achieving max0jkvj,ω the active vertex of α at ω. As ω varies, the active vertex changes at discrete directions where two vertices achieve the same height. Within any interval where the active vertices remain fixed, the difference curve simplifies to either |uw,ω| (for different complexes) or 12|uw,ω| (for same complex), which is a simple trigonometric function. See Figure 2 for an example. The insertion and difference curves are both well-behaved. See Figure 3 for an example.

Figure 2: On the left are two simplices with vertices v0,1,2 and w0,1,2 respectively. On the right is 𝕊1 partitioned into regions with the same active vertex pairs (vi,wj).
Lemma 3.

Each difference curve Δα,σ crosses any horizontal line y=λ at most O(1) times as ω varies over [0,2π]. Since there are O(n2) difference curves in total, this yields O(n2) crossings with any horizontal line. In particular, there are O(n2) insertion-curve intersections, as these correspond to difference curves crossing the line y=0.

The bound on insertion-curve intersections follows immediately since we have O(n) curves total, giving at most (O(n)2)=O(n2) pairwise intersections. For threshold crossings, each difference curve Δα,σ is piecewise trigonometric with O(1) pieces (as simplices in 2 have at most 3 vertices), and crosses any threshold λ at most O(1) times. With O(n2) pairs total, this yields O(n2) threshold crossings. The detailed geometric analysis is in the full version.

In each direction ω, the bottleneck distance is realized by the value of a difference curve Δα,σ(ω). When this maximum is unique in a neighborhood of ω, the continuity of the bottleneck function H(ω):=dB(Dgm(hωK),Dgm(hωK)) ensures that the same curve or persistence value realizes the bottleneck distance in an ε-neighborhood. We call the points in S1 where the realizing curve or value changes locally events, and the values H attains at events are the candidate values.

Theorem 4 (Events for d in 2).

The direction ω attaining d occurs at either

  1. 1.

    a local maximum of a difference curve Δα,σ, or

  2. 2.

    an intersection of two difference curves. See Figure 3 for an illustration.

Proof.

Let ω be the direction that attains d. By Lemma 2, if the bottleneck distance at ω is realized by a unique difference curve in a neighborhood, then ω must be a local maximum of that difference curve, giving case (1). This includes both matched pairs (when αK,σK) and unmatched point persistence (when α,σ are from the same complex). Otherwise, at least two curves achieve the same maximum value at ω, giving case (2). Note that intersections of insertion curves (where the persistence diagram changes combinatorially) form a special case of (2), as when two insertion curves Iα,Iβ from the same complex coincide, all difference curves of the form Δα,σ and Δβ,σ are equal.

 Remark 5.

When we refer to “intersections” of difference curves, we mean isolated transverse crossings, not intervals of coincidence. Endpoints of overlaps also count as intersections, since the realizing curve may change at those boundaries.

Refer to caption

(a)

Refer to caption

(b)

Refer to caption

(c)

Figure 3: (a) An insertion curve Iα(ω). (b) A difference curve Δα,σ(ω). (c) Arrangement of four difference curves; local maxima and pairwise intersections mark the candidate values of Theorem 4.
Corollary 6.

There are O(n4) candidate values where d may be attained.

Proof.

There are O(n2) difference curves: O(n2) from pairs (α,σ)K×K, plus O(n2) from pairs within the same complex. Each has O(1) local maxima (see the full version for the explicit bound), contributing O(n2) type-(1) candidates. For type-(2) candidates, each pair of difference curves intersects at O(1) heights, giving (O(n2)2)=O(n4) intersections total. Thus the total number of candidates is O(n4).

 Remark 7.

When simplices share vertices, their difference curves may partially coincide. For instance, if α,βK share vertex v and σ,τK share vertex w, then Δα,σ and Δβ,τ coincide in regions where v and w are simultaneously active. Despite these overlaps, each difference curve retains a unique identity at the combinatorial level through its defining simplex pair. In particular, our candidate enumeration remains valid: if the maximum bottleneck distance is achieved at direction ω, then at least one combinatorially distinct difference curve must realize this maximum, and this curve’s critical points and intersections are in our candidate set. The full technical detail is in the full version.

3.2 Overview of the algorithm

We describe the high-level structure of our algorithm next. On this level, our approach is similar to the algorithm of Bjerkevik and Kerber to compute the matching distance [1]. However, the approaches differ in the technical realization of the predicates which are described in the subsequent subsections.

Decision procedure.

Given a threshold λ0, we decide whether dλ by sweeping ω around 𝕊1 and maintaining a bottleneck matching. As ω rotates, we update the persistence diagrams at O(n2) insertion-curve intersections and perform single augmenting-path updates whenever an edge weight crosses the threshold. This decision procedure runs in O~(n3) time.

Basic algorithm.

By Theorem 4, d is attained at one of O(n4) candidate values corresponding to intersections of difference curves and their local maxima. These candidates can be enumerated and sorted in O(n4logn) time. Combined with binary search using our decision procedure, this yields an O(n4logn+n3polylog(n))=O~(n4) algorithm.

Improved algorithm via band refinement.

By Theorem 4, there are O(n4) total candidates where d could be attained. To achieve O~(n3) time, we avoid enumerating all candidates.

We call a candidate an α-candidate if it arises from a difference curve Δα,σ for some σ (when αK), from Δτ,α for some τ (when αK), or from |Iα(ω)Iβ(ω)|/2 for some β in the same complex as α.

We maintain a height band (λ1,λ2] satisfying d>λ1 and dλ2. We process simplices from both complexes in random order. For each simplex α, we apply:

  1. 1.

    Existence predicate: Tests if any α-candidate lies in (λ1,λ2] in O(n2polylog(n)) time. If no candidate exists in the band, we skip to the next simplex.

  2. 2.

    Band-refinement predicate: If the existence test is positive, we enumerate all O(n3) α-candidates in the band and refine via binary search in O(n3polylog(n)) time.

The resulting total running time is O(nn2polylog(n)+Cn3polylog(n)), where C is the number of band-refinement calls. As we will show, processing the simplices in a random order ensures 𝔼[C]=O(logn), yielding expected time O~(n3).

3.3 Decision problem

We now describe how to decide whether dλ for a given threshold λ0. The key idea is to sweep the direction ω around S1 and check if the bottleneck distance ever exceeds λ.

By Lemma 1, at each direction ω, the bottleneck distance dB equals the cost of a minimum-bottleneck matching in a bipartite graph G(ω) constructed from the two persistence diagrams X=Dgm(hωK) and Y=Dgm(hωK) with diagonal copies. Define the subgraph Gλ(ω) to contain only those edges of G(ω) whose weights are λ. Then dB(X,Y)λ if and only if Gλ(ω) admits a perfect matching.

Our strategy is to maintain a perfect matching in Gλ(ω) as ω sweeps from 0 to 2π. If at any point no perfect matching exists, we conclude d>λ; otherwise, if the sweep completes with a valid matching at every direction, then dλ.

Sweep algorithm.

We initialize at ω=0 by computing a perfect matching in Gλ(0) using Hopcroft-Karp in O(n2.5) [15]; if none exists, d>λ.

As ω increases from 0 to 2π, the bipartite graph Gλ(ω) changes only at discrete events:

  • Diagram changes: At intersections of insertion curves, points move to or from the diagonal in the persistence diagrams, updating the bipartite graph structure.

  • Threshold crossings: When a difference curve Δα,σ(ω) crosses the threshold λ, the corresponding edge enters or leaves Gλ(ω).

Maintaining the matching.

A matching M is maintained across the sweep. At each event:

  • If a new edge enters Gλ(ω) (weight decreases below λ), M remains valid.

  • If an edge leaves Gλ(ω) (weight exceeds λ) and is not in M, then M remains valid.

  • If an edge (u,v)M becomes invalid, Hall’s theorem guarantees that a new perfect matching exists if and only if there is an augmenting path from the newly exposed vertices. We search for such a path in O(nlogn) time using the geometric structure [10]. If found, we augment along this path to restore a perfect matching. If no augmenting path exists, then Gλ(ω) has no perfect matching, so dB>λ at this ω, implying d>λ.

At diagram change events (insertion curve intersections), we update the persistence diagrams using the vineyard algorithm [4]. When two insertion curves Iα and Iβ from the same complex intersect, the relative order of exactly two simplices changes in the filtration. Following Bjerkevik and Kerber [1], this corresponds to a single transposition in the barcode pairing, which can be updated in O(n) time.

If the sweep completes with a valid perfect matching at every ω, then dλ.

Lemma 8.

The decision procedure runs in O~(n3) time.

Proof.

At each event, we either update the diagram structure in O(n) time (vineyard update for insertion curve intersections) or search for a single augmenting path in O(nlogn) time (for threshold crossings). With O(n2) total events from Lemma 3, the total time is O~(n3).

3.4 Candidate pruning via band refinement

Recall that we have O(n4) total candidates where d may be attained. To find d efficiently, we maintain a height band (λ1,λ2] containing d and iteratively shrink it by processing simplices from both complexes in random order.

We distinguish between two types of intersections between difference curves. Intra-intersections occur when two difference curves share a common simplex: either Δα,σ1 and Δα,σ2 sharing simplex α, or Δβ1,τ and Δβ2,τ sharing simplex τ. Inter-intersections occur when Δα,σ and Δβ,τ meet with all four simplices distinct: αβ and στ.

Pre-refinement.

Before processing individual simplices, we refine the band to exclude certain events from its interior: let S be the set containing all local maxima of difference curves Δα,σ for all pairs (including both different-complex and same-complex pairs), all intra-α intersections where Δα,σ1(ω)=Δα,σ2(ω) for some ω𝕊1 and distinct σ1,σ2, and all intra-τ intersections where Δβ1,τ(ω)=Δβ2,τ(ω) for distinct β1,β2.

Since there are O(n2) difference curves, each with O(1) local maxima, we have O(n2) maxima total. For intra-intersections, each of the O(n) simplices in K contributes (O(n)2)=O(n2) pairs of curves that could intersect, with O(1) intersection points each, giving O(n3) intra-α intersections. Similarly for intra-τ intersections. Thus |S|=O(n3).

We binary search with the decision procedure to find the largest value in S below d and the smallest at or above it, setting these as λ1 and λ2. The resulting band (λ1,λ2] contains no intra-events in its interior. This takes O(n3polylogn) time.

3.4.1 Predicate 1: Existence test

After pre-refinement, we process simplices to detect inter-intersections.

Lemma 9.

For fixed αK, determining whether any inter-intersection involving α lies in (λ1,λ2] takes O(n2logn) time.

Proof.

We seek intersections of the form Δα,σΔβ,τ where βα. For each τK, we define the red curves Rα={Δα,σ:σα} as all curves involving simplex α, and the blue curves Bτ={Δβ,τ:βτ} as all curves involving simplex τ. (See Figure 2 for the geometric setting; the red and blue curves are real-valued functions on S1, and we detect their intersection as real-valued crossing events while sweeping around S1.)

The key insight from pre-refinement is that within the band (λ1,λ2], no two red curves can intersect (these would be intra-α intersections), and no two blue curves can intersect (these would be intra-τ intersections).

Each difference curve Δα,σ(ω) consists of O(1) trigonometric pieces, switching between different expressions at directions where the active vertex changes. Since simplices in 2 have at most 3 vertices, there are O(1) such transition points. When we clip to the band [λ1,λ2], each curve crosses the boundary at O(1) points, subdividing into O(1) monotone arcs within the band.

We apply the standard Bentley-Ottmann sweep-line algorithm to all O(n) arcs. Since red arcs do not intersect each other and blue arcs do not intersect each other (by pre-refinement), any intersection must be between a red and blue arc. We terminate immediately upon detecting the first such intersection. This takes O(nlogn) time per choice of τ. Testing all O(n) choices of τK takes O(n2logn) total time for fixed α.

3.4.2 Predicate 2: Band refinement

When the existence test detects an inter-intersection, we must enumerate all candidates involving α to refine the band.

Lemma 10.

When an inter-intersection involving α is detected, we can enumerate all O(n3) α-candidates in (λ1,λ2] and compute a refined band with no α-candidates in its interior in O(n3polylogn) time.

Proof.

After pre-refinement, only inter-intersections remain in the band’s interior. For simplex α, there are O(n3) such intersections (choosing σ,β,τ with O(n) choices each). We enumerate these candidates, sort them, and refine the band using binary search with the decision procedure, taking O(n3polylogn) time.

Theorem 11.

After global pre-refinement, processing each simplex α takes O(n2logn+𝟙αn3polylogn) total time, where 𝟙α is the indicator function of the existence test.

Proof.

This follows directly from Lemma 9 and 10.

3.4.3 Randomized analysis

Theorem 12.

Processing simplices from both K and K in uniformly random order yields 𝔼[C]=O(logn) refinements, where C counts positive existence tests.

Proof.

For each simplex α, define xα as the smallest α-candidate that is d and yα as the largest α-candidate that is <d. Since d is realized by at least one candidate, for some simplex α we have xα=d. Every interval (yα,xα] contains d, so our maintained band always has the form (yαi,xαj] for some processed simplices αi,αj.

When processing simplices in random order, we obtain random permutations of the sequences {xα} and {yα}. Simplex α passes the existence test and the refinement is triggered if and only if there exists an α-candidate in the current band. This occurs when xα is smaller than all previously seen xα values (making it a left-to-right minimum), or yα is larger than all previously seen yα values (making it a left-to-right maximum).

Indeed, if xα is not a minimum, then some previously processed α satisfies xαxα, so the band’s upper bound is already at most xα, excluding all α-candidates with value xα. Likewise, if yα is not a maximum, the band’s lower bound already exceeds yα, excluding all α-candidates with value yα. Thus, when neither xα nor yα improves the band boundaries, every α-candidate lies outside (yα,xα), and none can fall in the current band.

By a classical result on random permutations [17]: in a uniformly random ordering of n distinct values, the i-th element is a left-to-right minimum with probability 1/i (being the smallest of the first i elements). By linearity of expectation, the expected number of left-to-right minima is Hn=i=1n1i=O(logn). The same bound holds for maxima. Therefore, the expected number of refinements is at most the expected number of minima in {xα} plus the expected number of maxima in {yα}, giving 𝔼[C]O(logn)+O(logn)=O(logn).

Corollary 13.

The candidate pruning algorithm runs in expected time

O(nn2logn+lognn3polylog(n))=O~(n3).
Proof.

We process O(n) simplices from both complexes. Each requires an O(n2logn) existence test. In expectation, only O(logn) trigger the O(n3polylog(n)) band refinement. The refinement cost dominates, giving O~(n3) expected time.

4 Computing 𝒅𝟏 in 𝟐

Our framework also improves the computation of the integral bottleneck distance d1 from the previous O~(n6) bound [18] to O~(n5).

The integral requires maintaining the bottleneck matching as ω sweeps around 𝕊1. As ω varies, the bottleneck distance H(ω) changes only at the O(n4) difference curve intersection events identified in Section 3. At each event, we update the matching in O(nlogn) time via an augmenting path search to identify which difference curve realizes the new bottleneck. Between consecutive events at angles ωi and ωi+1, the bottleneck distance is given by a single difference curve that can be integrated analytically.

Thus the integral distance can be computed in O~(n5) total time: O(n4) events, each requiring O(nlogn) processing. This improves upon the hourglass data structure approach of [18], which maintained two kinetic heaps and required O~(n6) time.

5 Computing 𝒅 in 𝟑

We now consider embedded complexes in 3. Directions range over the sphere 𝕊2, difference curves become surfaces, and intersections occur along curves rather than at points. The algorithm follows the same framework as 2D, but requires traversing an arrangement on 𝕊2 via an Euler tour rather than sweeping a circle. This yields expected complexity O~(n5).

5.1 Events

Let K,K3 be finite simplicial complexes with at most n simplices each. For each simplex αKK, ωS2, the insertion surface is:

Iα:S2,Iα(ω):=maxvαv,ω

Each Iα is the upper envelope of at most 4 trigonometric forms on S2. The loci where the maximizing vertex changes are great circles {ωS2:vivj,ω=0}.

For distinct simplices α,σ, the difference surface is a real-valued function on 𝕊2:

Δα,σ(ω):={|Iα(ω)Iσ(ω)|if α,σ are from different complexes12|Iα(ω)Iσ(ω)|if α,σ are from the same complex

Within each region where the active vertices are fixed, Δα,σ simplifies to |uw,ω| for active vertices uα and wσ. Two difference surfaces Δα,σ and Δβ,τ intersect along curves on 𝕊2 where Δα,σ(ω)=Δβ,τ(ω).

Lemma 14.

For simplicial complexes in 3:

  1. 1.

    Each pair of insertion surfaces intersects along O(1) great circle arcs on 𝕊2.

  2. 2.

    Each pair of difference surfaces intersects along O(1) great circle arcs on 𝕊2.

  3. 3.

    Each intersection curve between difference surfaces has O(1) local maxima.

  4. 4.

    Each difference surface crosses any threshold λ along O(1) curves on 𝕊2.

The proof follows from the piecewise structure: since simplices in 3 have at most 4 vertices, each insertion surface has O(1) regions of fixed active vertex. Within each region, the surfaces are trigonometric forms and their intersections are great circles. The detailed geometric analysis is in the full version.

Theorem 15 (Events for d in 3).

The direction ω attaining d occurs at one of:

  1. 1.

    A local maximum of a difference surface Δα,σ

  2. 2.

    A local maximum along an intersection curve on 𝕊2 where two difference surfaces meet

  3. 3.

    A triple intersection point where three difference surfaces meet

Proof.

The bottleneck distance function H(ω) is continuous on S2. At any ωS2 where d is attained, consider the difference surfaces achieving the maximum value H(ω).

If a unique surface Δα,σ achieves this maximum in a neighborhood of ω, then by continuity, ω must be a local maximum of that surface (case 1). This covers both matched pairs and unmatched persistence. If exactly two surfaces achieve the maximum at ω but no other surface does so nearby, then ω lies on their intersection curve on 𝕊2. Since H is locally determined by these two surfaces along the curve, ω must be a local maximum along this curve (case 2). If three or more surfaces achieve the maximum at ω, then generically three surfaces meet at isolated points, giving case 3.

Corollary 16.

There are O(n6) candidate values where d may be attained.

Proof.

We count candidates by type. Type 1 has O(n2) difference surfaces (including both between-complex and within-complex pairs), each having O(1) maxima, contributing O(n2) candidates. Type 2 consists of (O(n2)2)=O(n4) pairs with O(1) maxima per intersection curve, giving O(n4) candidates. Type 3 is (O(n2)3)=O(n6) triple intersection points. This gives us the total of O(n6) candidates.

5.2 Overview of algorithm

Decision procedure.

Given threshold λ, we decide whether dλ by traversing an arrangement on 𝕊2. Similar to the 2D case, we track two types of events:

  • Diagram changes: O(n2) intersection curves between insertion surfaces where the persistence diagrams change combinatorially;

  • Threshold crossings: O(n2) curves on 𝕊2 where difference surfaces cross the threshold λ.

Overlaying these curves yields an arrangement of O(n4) complexity on 𝕊2. We traverse the dual of this arrangement via an Euler tour by traversing each edge twice, maintaining a bottleneck matching throughout. Each diagram change requires O(n) time to update the barcode pairing using the vineyard algorithm, while each threshold crossing may require O(nlogn) time for augmenting path search. The total complexity is O~(n5).

Improved algorithm via band refinement.

We maintain a band (λ1,λ2] containing d and process simplices in random order. For each simplex α:

  1. 1.

    Existence predicate: Test if any α-candidate lies in the band. Following the approach from 2D adapted to surfaces: for fixed α and σK, consider the surface Δα,σ. For each βK{α}, compute intersection curves with all Δβ,τ surfaces. Within the band, these O(n) curves form disjoint arcs on 𝕊2 (no intra-β intersections after pre-refinement). Similarly get O(n) disjoint arcs from surfaces involving γK{α,β}. Check for red-blue intersections in O(nlogn) time. Testing all combinations takes O(n4logn).

  2. 2.

    Band refinement: If positive, enumerate all α-candidates in the band: O(n5) triple intersections, O(n3) curve maxima, O(n) surface maxima. Then refine via binary search in O~(n5) time.

Using the same randomization analysis as 2D, we expect O(logn) refinements. This results in total expected complexity of O(nn4logn+lognn5polylogn)=O~(n5).

5.3 Decision problem

Given threshold λ0, we decide whether dλ by constructing and traversing an arrangement on 𝕊2. Unlike the 2D case where we sweep around a circle, here we must systematically explore the entire sphere.

We first construct an arrangement 𝒜 on 𝕊2 consisting of:

  • O(n2) curves from insertion surface intersections (where persistence diagrams change)

  • O(n2) curves where difference surfaces equal λ (threshold crossings)

Each insertion surface is piecewise trigonometric with O(1) pieces, so pairs intersect along O(1) curves each. Similarly, each difference surface crosses the threshold λ along O(1) curves. The overlay of all these curves forms an arrangement with O(n4) vertices, edges, and faces.

Theorem 17.

Whether dλ can be decided in O~(n5) time.

Proof.

We construct the arrangement 𝒜 and compute an Euler tour of its dual graph, treated as a planar graph embedded on 𝕊2. The tour visits each edge twice, once in each direction.

Starting from an arbitrary face with a perfect matching in Gλ(ω), we traverse the tour and maintain the matching throughout. At insertion curve crossings where the persistence diagram changes, we update the barcode pairing via a single transposition in O(n) time using the vineyard algorithm. At threshold crossings where an edge weight exceeds λ, we search for an augmenting path in O(nlogn) time. If no augmenting path exists, we conclude d>λ and terminate. If the tour completes with valid matchings maintained throughout, then dB(ω)λ for all ω𝕊2, hence dλ.

The arrangement has O(n4) edges in total. The O(n4) diagram changes contribute O(n5) total time at O(n) each, while the O(n2) threshold crossings contribute O~(n3) at O(nlogn) each. However, the bottleneck arises from traversing all O(n4) edges of the arrangement, where at each edge crossing we may need to update the matching. Since each edge crossing potentially requires O(nlogn) time for augmenting path search, the total complexity is O(n4nlogn)=O~(n5).

5.4 Candidate pruning via band refinement and complexity analysis

As in the 2D case, we maintain a band (λ1,λ2] containing d and process simplices in random order. We first apply a pre-refinement to exclude all intra-events from the band.

Pre-refinement.

Before processing individual simplices, we refine the band to exclude all intra-events from its interior. We call a triple intersection point Δα,σΔβ,τΔγ,ρ an intra-event if any two of the six involved simplices are equal. Let S be the set containing all O(n2) local maxima of difference surfaces, all O(n4) local maxima along surface intersection curves, and all intra-event triple intersections. Since there are O(n5) ways to choose 5 distinct simplices and O(1) ways to make two of them equal, we have |S|=O(n5). We use binary search with the decision procedure to find the largest value in S that is <d (setting λ1) and the smallest value in S that is d (setting λ2), yielding the band (λ1,λ2] that contains d but excludes all values of S from its interior. This takes O(n5polylogn) time.

Lemma 18.

For fixed αK, we can test whether any inter-intersection involving α lies in the band (λ1,λ2] in O(n4logn) time.

Proof.

Fix αK and σK, giving the difference surface Δα,σ. We seek triple intersection points of the form Δα,σΔβ,τΔγ,ρ where β,γK{α} and τ,ρK, with the intersection value lying in (λ1,λ2].

For fixed βK{α}, compute the intersection curves between Δα,σ and all surfaces Δβ,τ for τK. Each pair of surfaces intersects along great circle arcs on 𝕊2 where Δα,σ(ω)=Δβ,τ(ω). We obtain O(n) intersection curves on 𝕊2.

The crucial observation is that when we restrict to the band {ω:λ1<Δα,σ(ω)λ2}, these O(n) curves become disjoint arcs. Any intersection between curves Δα,σΔβ,τ1 and Δα,σΔβ,τ2 would yield a triple point where Δα,σ=Δβ,τ1=Δβ,τ2. This is an intra-event (two surfaces share β), excluded from the band’s interior via pre-refinement.

Similarly, for fixed γK{α,β}, the intersection curves between Δα,σ and all Δγ,ρ surfaces yield another set of O(n) disjoint arcs within the band. We now have two collections of arcs on the restricted domain of Δα,σ: the “red” arcs from β-surfaces and the “blue” arcs from γ-surfaces. A red-blue intersection corresponds to a triple point Δα,σΔβ,τΔγ,ρ, which is an inter-intersection involving α.

To detect red-blue intersections, we apply stereographic projection from the north pole of 𝕊2 to map the band region to a planar domain and use a sweep-line algorithm. As shown in the full version, the projection preserves the disjointness of red and blue arc families while mapping great circle arcs to well-behaved curves (circles and lines) that intersect O(1) times. The sweep-line algorithm thus detects all red-blue intersections in O(nlogn) time.

Iterating over all choices of σK, βK{α}, and γK{α,β} gives total complexity O(nnnnlogn)=O(n4logn).

Lemma 19.

When the existence test is positive for simplex α, we can enumerate all O(n5) candidates involving α that lie in (λ1,λ2].

Proof.

For each α, the pre-refinement step excludes the O(n) local maxima of difference surfaces and O(n2) local maxima of intersection curves. We only need to consider triple intersection points Δα,σΔβ,τΔγ,ρ: with O(n) choices each for σ,β,τ,γ,ρ, and O(1) intersection points per triple, we get O(n5) candidates. Total enumeration takes O(n5) time. Binary search with the decision procedure then refines the band in O~(n5) time.

Theorem 20 (Total complexity in 3D).

The algorithm runs in expected time O~(n5).

Proof.

We process O(n) simplices from both complexes. For each simplex α, we perform the existence test in O(n4logn) time. If positive, we enumerate and refine in O~(n5) time. We expect O(logn) refinements using the same analysis as in 2D. The total expected complexity is therefore O(nn4logn+lognn5polylogn)=O~(n5).

6 Conclusion

We have presented the first algorithms for computing the maximum bottleneck distance between Persistent Homology Transforms, achieving expected time complexity of O~(n3) in 2 and O~(n5) in 3. As a byproduct, our framework also improves the integral bottleneck distance computation from O~(n6) to O~(n5) in 2D. Using similar techniques, the integral version in 3 can be computed in O~(n7) time by maintaining matchings across all O(n6) events, though we leave the technical details for future work.

Our adaptation of the framework introduced by Bjerkevik and Kerber [1] reveals a broader principle: directional transforms that vary continuously over parameter spaces can often be optimized through event-driven algorithms and randomized candidate pruning. This suggests potential applications beyond the PHT to other parametric problems in computational topology, such as the Euler Characteristic Transform or persistence-based shape signatures.

From a practical perspective, the cubic complexity in 2D makes exact PHT comparison feasible for moderate-sized datasets, potentially enabling new applications in shape matching and retrieval where sampling-based approximations were previously necessary. However, significant challenges remain: extending to the Wasserstein distance would require fundamentally different techniques due to its non-combinatorial nature, and handling higher-dimensional ambient spaces faces steep complexity barriers.

References

  • [1] Havard Bakke Bjerkevik and Michael Kerber. Asymptotic improvements on the exact matching distance for 2-parameter persistence. Journal of Computational Geometry, 14(1):309–342, December 2023. doi:10.20382/jocg.v14i1a12.
  • [2] Sergio Cabello, Siu-Wing Cheng, Otfried Cheong, and Christian Knauer. Geometric Matching and Bottleneck Problems. In Wolfgang Mulzer and Jeff M. Phillips, editors, 40th International Symposium on Computational Geometry (SoCG 2024), volume 293 of Leibniz International Proceedings in Informatics (LIPIcs), pages 31:1–31:15, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SoCG.2024.31.
  • [3] Mathieu Carrière, Frederic Chazal, Yuichi Ike, Theo Lacombe, Martin Royer, and Yuhei Umeda. Perslay: A neural network layer for persistence diagrams and new graph topological signatures. In Silvia Chiappa and Roberto Calandra, editors, Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pages 2786–2796. PMLR, 26–28 August 2020. URL: https://proceedings.mlr.press/v108/carriere20a.html.
  • [4] David Cohen-Steiner, Herbert Edelsbrunner, and Dmitriy Morozov. Vines and vineyards by updating persistence in linear time. In Proceedings of the Twenty-Second Annual Symposium on Computational Geometry, SCG ’06, pages 119–126, New York, NY, USA, 2006. Association for Computing Machinery. doi:10.1145/1137856.1137877.
  • [5] Justin Curry, Sayan Mukherjee, and Katharine Turner. How many directions determine a shape and other sufficiency results for two topological transforms. Transactions of the American Mathematical Society, Series B, 2018.
  • [6] Tamal K. Dey and Cheng Xin. Computing Bottleneck Distance for 2-D Interval Decomposable Modules. In Bettina Speckmann and Csaba D. Tóth, editors, 34th International Symposium on Computational Geometry (SoCG 2018), volume 99 of Leibniz International Proceedings in Informatics (LIPIcs), pages 32:1–32:15, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SoCG.2018.32.
  • [7] Tamal Krishna Dey and Yusu Wang. Computational Topology for Data Analysis. Cambridge University Press, 1 edition, 2017. arXiv:1708.09359v2.
  • [8] Herbert Edelsbrunner and John Harer. Computational Topology - an Introduction. American Mathematical Society, 2010.
  • [9] Herbert Edelsbrunner and Teresa Heiss. Merge trees of periodic filtrations, 2024. doi:10.48550/arXiv.2408.16575.
  • [10] Alon Efrat, Alon Itai, and Matthew J. Katz. Geometry helps in bottleneck matching and related problems. Algorithmica, 31(1):1–28, September 2001. doi:10.1007/s00453-001-0016-8.
  • [11] Robert Ghrist, Rachel Levanger, and Huy Mai. Persistent homology and Euler integral transforms. Journal of Applied and Computational Topology, 2(1):55–60, October 2018. doi:10.1007/s41468-018-0017-1.
  • [12] Chad Giusti, Eva Pastalkova, Carina Curto, and Vladimir Itskov. Clique topology reveals intrinsic geometric structure in neural correlations. Proceedings of the National Academy of Sciences, 112(44):13455–13460, 2015. doi:10.1073/pnas.1506407112.
  • [13] Felix Hensel, Michael Moor, and Bastian Rieck. A survey of topological machine learning methods. Frontiers in Artificial Intelligence, Volume 4 - 2021, 2021. doi:10.3389/frai.2021.681108.
  • [14] Yasuaki Hiraoka, Takenobu Nakamura, Akihiko Hirata, Emerson G. Escolar, Kaname Matsue, and Yasumasa Nishiura. Hierarchical structures of amorphous solids characterized by persistent homology. Proceedings of the National Academy of Sciences, 113(26):7035–7040, 2016. doi:10.1073/pnas.1520877113.
  • [15] John E. Hopcroft and Richard M. Karp. An n5/2 algorithm for maximum matchings in bipartite graphs. SIAM J. Comput., 2(4):225–231, December 1973. doi:10.1137/0202019.
  • [16] Michael Kerber, Dmitriy Morozov, and Arnur Nigmetov. Geometry helps to compare persistence diagrams. ACM J. Exp. Algorithmics, 22, September 2017. doi:10.1145/3064175.
  • [17] Donald E. Knuth. The Art of Computer Programming, Volume 3: Sorting and Searching. Addison-Wesley, 2nd edition, 1998. Section 5.1.1.
  • [18] Elizabeth Munch, Elena Xinyi Wang, and Carola Wenk. The kinetic hourglass data structure for computing the bottleneck distance of dynamic data, 2025. doi:10.48550/arXiv.2505.04048.
  • [19] Michael W. Reimann, Max Nolte, Martina Scolamiero, Katharine Turner, Rodrigo Perin, Giuseppe Chindemi, Paweł Dłotko, Ran Levi, Kathryn Hess, and Henry Markram. Cliques of neurons bound into cavities provide a missing link between structure and function. Frontiers in Computational Neuroscience, Volume 11 - 2017, 2017. doi:10.3389/fncom.2017.00048.
  • [20] Katharine Turner, Sayan Mukherjee, and Doug M. Boyer. Persistent homology transform for modeling shapes and surfaces. Information and Inference: A Journal of the IMA, 3(4):310–344, December 2014. doi:10.1093/imaiai/iau011.