Advanced maths

Persistence diagram bottleneck distance calculator with diagonal matching

Match two finite persistence diagrams while allowing points to pair with the diagonal, and minimize the largest sup-norm matching cost.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Match two finite persistence diagrams while allowing points to pair with the diagonal, and minimize the largest sup-norm matching cost.

THE FORMULAdB(D,E) = min_matching max_edge ||p−q||∞; cost(p,diagonal)=(death−birth)/2

A worked example

For diagrams containing (0,2) and (0,4), direct matching costs two. Matching both points to the diagonal also has maximum cost two, so the bottleneck distance is two.

Good to know

At most30 finite birth/death points in each diagram, birth≤death; separate labels by homological degree and compare one degree at a time. Exact rational threshold candidates and perfect bipartite matching with diagonal copies. No automatic homology construction or infinite-death matching initially.

Comparing diagrams rather than constructing them

A persistence diagram lists the birth and death values of topological features obtained from some filtration. This page starts with two supplied diagrams and compares them. It does not reconstruct homology from a point cloud, choose a filtration scale or decide which homological degree the user intended.

Compare one degree and a compatible filtration convention at a time. Mixing connected-component births with loop births would produce a numerical matching but a different mathematical comparison from the usual degree-wise persistence distance. The diagonal-matching convention is also essential because short-lived features may be omitted by matching them to the diagonal instead of to a feature in the other diagram.

Persistence diagram bottleneck distance with diagonal matching(0,2)(0,4)Direct cost = 2Diagonal costs: 1, 2
Scroll across to see the full diagram.
For diagrams containing (0,2) and (0,4), direct matching costs two. Matching both points to the diagonal also has maximum cost two, so the bottleneck distance is two.

Compare this with the Persistent homology calculator for a small point cloud. Compare two supplied birth/death diagrams by an optimal sup-norm matching that permits deletion to the diagonal. Existing persistence page creates a diagram from one cloud and does not solve diagram matching.

The sup norm sets the edge cost

For two birth/death points, the matching cost is the maximum of the absolute birth difference and absolute death difference. This is the sup norm, not the Euclidean distance in the plot. The bottleneck objective then minimizes the largest edge cost over all complete allowed matchings. It does not add the edge costs.

The cost of matching a point to the diagonal is half its persistence, or half death minus birth. The closest diagonal point lies at the midpoint of the birth and death coordinates. This value explains why a feature with a small lifespan can be deleted cheaply, while deleting a long-lived feature requires a large bottleneck threshold.

Completing the matching with diagonal copies

The two diagrams may have different numbers of off-diagonal points. Introduce suitable diagonal copies so every original point can either match a point in the other diagram or be assigned to the diagonal. Diagonal-to-diagonal filler matches have zero cost and complete the augmented bipartite matching without representing an additional topological feature.

Repeated diagram points remain distinct entries with multiplicity, so the matching must account for each copy. Deduplicating equal coordinates would change the problem. Initial support is restricted to finite birth and death values; essential features with infinite death require an explicitly defined additional matching convention rather than an arbitrarily large finite replacement.

Threshold feasibility gives the optimum

For a proposed threshold, keep only augmented matching edges whose costs do not exceed it. A perfect bipartite matching then establishes feasibility at that threshold. Feasibility is monotone: a matching allowed at one threshold remains allowed at any larger threshold, which supports a search through the finite set of candidate costs.

With rational birth/death inputs, every relevant pair cost and half-persistence cost is rational. Searching those exact candidates and verifying the matching yields an exact finite result without a sampled tolerance. A numerical package using an approximate threshold can provide a reference, but its approximation parameter must be distinguished from the exact mode used to validate this calculator.

The single-feature example

The default points share birth zero but have death values two and four. Their direct sup-norm cost is two. If each point instead matches to the diagonal, their costs are one and two, so the largest cost is again two. These two constructions establish feasible matchings at threshold two.

Below threshold two, the point (0,4) cannot match the other point because that pair costs two. It also cannot match the diagonal because its half-persistence is two. Hence no complete matching exists below two, proving that the displayed feasible value is optimal. The example also shows that the optimal matching need not be unique.

Inspecting a returned correspondence

Read each matching edge with its endpoints and cost, including a clear diagonal label for deleted features. The reported distance should equal the maximum of those edge costs. A certificate at the immediately lower candidate threshold can show why no smaller value was feasible, for example through a failed matching or a deficient vertex set.

Do not interpret a diagonal match as evidence that the corresponding feature is meaningless in an application. It states only that deleting it is admissible within this metric at the chosen threshold. Domain knowledge, noise models and scientific interpretation are separate from the combinatorial minimax statement established by the matching.

Limits of the metric comparison

The result compares the entered diagrams under the declared degree and finite-point conventions. It does not prove that their generating datasets are close in every geometric sense. Stability theorems connect diagram distances to particular perturbation models, but using one requires the correct filtration and hypotheses rather than just a small numerical bottleneck value.

For empty diagrams, every point of the nonempty diagram matches to the diagonal, so the answer is the maximum half-persistence. Two empty diagrams have distance zero. These boundary cases, repeated points and zero-lifespan points are useful checks that the implementation follows the full augmented-matching definition rather than assuming an equal-size point-to-point assignment.

A few questions, answered

Is the point cost Euclidean distance?

No. It is the maximum absolute difference in birth and death coordinates.

Can a feature be left unmatched?

It must be matched either to a feature in the other diagram or to the diagonal.

Are repeated coordinates deduplicated?

No. Persistence diagrams retain multiplicity, and every copy participates in the matching.

What is the distance to an empty diagram?

It is the maximum half-persistence of the nonempty finite diagram, or zero when both are empty.

Find your calculator

Start typing to explore the library.