Computational topology turns questions about connectivity, loops and higher-dimensional structure into finite representations and algorithms. It helps a reader move from a mesh, point cloud or image to a checkable mathematical answer: what object was constructed, which features were counted, and which changes would alter the result?
The gold standard is a computation whose model, coefficients, scale and limitations are explicit. A convincing barcode is only one part of that standard. The examples below show how to calculate small answers independently, diagnose a missing face or misleading threshold, and distinguish an invariant of a constructed complex from a claim about the physical world.
Use the Gold Standard master for the wider collection, Topology for the surrounding mathematics, and How X Works for mechanism-based reading. The learning aim follows The Gold Standard of Education: understanding that remains useful when the representation or question changes.
Choose your computational topology route
Chapters 4–6: Compute and cross-check
Chapters 7–9: Work geometric and image examples
Chapters 10–12: Implement and diagnose
Chapter index
Build the model · Chapters 1–3
1. Decide which object the computation describes
Compute and cross-check · Chapters 4–6
4. Turn the complex into a matrix calculation
5. Use independent checks without confusing them with proofs
Work geometric and image examples · Chapters 7–9
7. Calculate a complete four-point persistence example
Implement and diagnose · Chapters 10–12
10. Understand what persistence reduction preserves
11. Budget for the complex, not only the input points
12. Diagnose discrepancies and interpret stability carefully
Transfer and continue · Chapters 13–14
Separate the observation from the model
A photograph, a list of coordinates and a triangle mesh are different inputs. A photograph supplies sampled intensities. Coordinates supply locations and perhaps distances. A mesh supplies vertices, edges and faces, together with information about how they meet. None automatically specifies the same topological space as another, even when all depict the same object.
Suppose four measurements lie near the corners of a square. As a finite set of distinct points with its usual subspace topology, they form four isolated components. Drawing four connecting segments makes a different space with one component and one loop. Filling the square makes another space in which that loop bounds an included region. The decision to connect or fill is part of the mathematical model.
This distinction helps frame a useful question before selecting software. Are you measuring the topology of an already specified mesh, constructing a model from samples, or comparing how a model changes across thresholds? The first task needs reliable mesh interpretation. The second also needs a justified construction. The third needs a coherent relationship between successive constructions.
Write a question with a checkable output
For a teaching mesh, a precise request might be: compute ordinary homology over the two-element field through dimension two, treating every listed triangle as filled and every unlisted triangle as absent. That request defines an answer a second implementation can reproduce. “Find the holes” leaves the dimension, coefficients and even the represented object unclear.
Computational topology also includes algorithmic questions about surfaces, maps and other topological structures. Homology and persistence provide a particularly accessible starting route because finite examples can be reduced to linear algebra. They do not settle every question of equivalence between spaces. The existing Algebraic Topology guide explains the wider relationship between invariants, loops and homotopy.
CHAPTER 2 OF 14 · Build the model
2. Build a finite complex without losing its faces
Vertices, edges and filled simplices
A simplex is the elementary piece represented by a nonempty finite set of vertices: one vertex gives a point, two an edge, three a filled triangle and four a filled tetrahedron. In an abstract simplicial complex, every nonempty subset of an included simplex must also be included. This closure rule makes the boundary of each piece available to the computation.
For example, entering the triangle ABC requires vertices A, B and C and edges AB, AC and BC. Merely entering those three edges does not require the triangle. The direction of the implication is crucial. A triangular frame and a filled triangular patch share the same edge drawing but differ in their two-dimensional content.
An implementation may automatically insert missing faces when a simplex is added. That convenience does not remove the modeller’s responsibility to know what was inserted. Inspect the resulting simplex list on a small example. Check vertex identities too: two coordinates that happen to be equal are not necessarily the same vertex in a combinatorial input unless the construction identifies them.
A square gives an immediate consistency test
Represent a filled square using triangles ABC and ACD, where A, B, C and D follow the boundary. The complex has four vertices, five edges and two triangles. The diagonal AC belongs to both triangles. It is one shared edge, not two unrelated copies. If the copies are accidentally kept separate, the data describe a different gluing.
This offers a practical import test. List each simplex by sorted vertex identifiers, remove duplicate entries and verify face closure. Count the diagonal once. Then export the complex again and compare identities rather than only checking that the rendered picture still looks like a square. A display can hide cracks, duplicated vertices or absent faces that the algebra will correctly treat as real.
CHAPTER 3 OF 14 · Build the model
3. Understand cycles and boundaries before counting holes
Work over a stated coefficient system
For the worked examples, use the field F₂, whose elements are zero and one and whose addition satisfies 1 + 1 = 0. A chain is then a selection of simplices of one dimension. Adding two chains keeps simplices present in exactly one of them. Shared terms cancel, making the arithmetic especially easy to audit by hand.
The boundary of edge AB is A + B. The boundary of triangle ABC is AB + AC + BC. Taking the boundary again gives A + B + A + C + B + C = 0. Every vertex appears twice. This is the concrete mechanism behind the identity that the boundary of a boundary vanishes.
A cycle has zero boundary. A boundary is a chain obtained as the boundary of a chain one dimension higher. Homology distinguishes cycles after identifying differences that are boundaries. Hatcher’s Algebraic Topology, Chapter 2 gives the formal construction and its relationship to other models of a space.
Why a filled triangle changes the answer
In the triangular frame, AB + BC + AC is a cycle: there are no endpoints left after cancellation. There is no triangle in the complex, so that cycle cannot be the boundary of a two-dimensional chain. It represents a nonzero first-homology class.
Add the filled triangle ABC. The same three-edge chain remains a cycle, but it is now a boundary. It no longer gives a nonzero homology class. Nothing about the coordinates of A, B or C needed to change. The difference came entirely from including one higher-dimensional piece.
This is a useful explanation test. If someone says that filling the triangle “removes the edges,” ask them to inspect the simplex list. The edges remain. What changes is their relationship to the newly available triangle. Homology does not merely count visible closed walks; it accounts for the fillings already present in the model.
CHAPTER 4 OF 14 · Compute and cross-check
4. Turn the complex into a matrix calculation
Rows and columns have geometric meanings
Let Dₖ be the boundary matrix from k-dimensional chains to chains one dimension lower. Its columns correspond to k-simplices and its rows to their possible faces. Over F₂, an entry is one when the row’s simplex occurs in the column’s boundary. Matrix multiplication applies the boundary operation to an entire chain at once.
If nₖ is the number of k-simplices, the Betti number is βₖ = nₖ − rank(Dₖ) − rank(Dₖ₊₁). The first subtraction counts independent cycles; the second removes independent boundaries. For ordinary dimension-zero homology, D₀ is zero. All ranks here must be calculated over the chosen field. The Duke matrix-reduction notes explain the underlying change-of-basis method.
Calculate the triangle completely
Order rows A, B, C and columns AB, AC, BC. The three columns of D₁ are (1,1,0), (1,0,1) and (0,1,1). Their sum is zero, while the first two are independent. Therefore rank(D₁) = 2. The triangular frame has n₀ = 3, n₁ = 3 and no triangles, giving β₀ = 3 − 2 = 1 and β₁ = 3 − 2 − 0 = 1.
When ABC is included, D₂ has one column, (1,1,1), indexed by the three edges. Its rank is one. Now β₁ = 3 − 2 − 1 = 0 and β₂ = 1 − 1 − 0 = 0. The component count stays one. This calculation distinguishes a frame from a disk without relying on their appearance.
For the triangulated square in Chapter 2, rank(D₁) = 3 and rank(D₂) = 2. Its two triangle-boundary columns are independent because each has boundary edges the other lacks. Hence β₁ = 5 − 3 − 2 = 0. The shared diagonal cancels in the sum of the two triangle boundaries, leaving precisely the outer square boundary.
CHAPTER 5 OF 14 · Compute and cross-check
5. Use independent checks without confusing them with proofs
Euler characteristic catches some mistakes
For a finite complex, the alternating simplex count equals the alternating sum of Betti numbers. The triangulated square gives 4 − 5 + 2 = 1, matching β₀ − β₁ + β₂ = 1. The triangular frame gives 3 − 3 = 0, matching 1 − 1. This supplies a useful second calculation from a different view of the same input.
Agreement is necessary, but it is not a complete correctness certificate. A result with both β₀ and β₁ too large by one has the same difference. A mistaken complex can also have a perfectly consistent Euler characteristic. Combine the check with direct component search, matrix-rank checks and a visual or combinatorial inspection of the intended gluing.
A hollow tetrahedron tests dimension handling
Take all four triangular faces of a tetrahedron, but omit its filled interior. There are four vertices, six edges and four triangles. The ranks of D₁ and D₂ are three and three. Thus β₀ = 1, β₁ = 0 and β₂ = 1. The sum of all four faces is a two-dimensional cycle because every edge appears twice.
Add the filled tetrahedron. Its boundary is that sum of faces, so D₃ has rank one and β₂ becomes zero. This is the higher-dimensional version of filling the triangular frame. It also explains why computing H₂ generally requires knowing the three-dimensional cells that can fill two-dimensional cycles.
Keep both tetrahedron variants in a test collection. If a pipeline reports identical H₂ for them, investigate whether it discarded three-dimensional cells, ignored the highest requested dimension or reused results from an earlier complex. A small object with a known answer often reveals a configuration error more clearly than a large scientific dataset.
CHAPTER 6 OF 14 · Compute and cross-check
6. Make the filtration parameter part of the question
Nested models let features be followed
A filtration is an increasing family of complexes: an earlier complex is contained in every later one. Each simplex has an entry value, and every face must enter no later than the simplex containing it. These conditions permit the inclusion maps that persistent homology uses to relate features across the family.
The parameter might be a distance threshold, an image intensity or a measured score. Its units and direction matter. Increasing a distance threshold usually adds connections. Increasing a threshold in a sublevel image includes cells with progressively larger values. Calling both parameters “scale” does not make their numerical values comparable.
A barcode records intervals over which homology classes persist in that family. In the finite examples here, use the convention that a feature is present at its birth value and absent at its death value, written [birth, death). An infinite endpoint means it survives the specified filtration; it is not a claim about infinite physical size or eternal existence.
Distinguish a scale sweep from a changing system
Consider snapshots of a transport network in which roads both open and close. Those snapshots need not be nested. Applying an ordinary increasing-filtration interpretation to their timestamps would silently change the question. The Dynamic Graph Algorithms root instead asks how to maintain answers under specified updates.
A distance sweep on one fixed dataset is different: points stay fixed while the construction admits more relationships. Before interpreting a persistence interval as duration, inspect the parameter. A loop that survives from a distance threshold of one to two metres has a scale interval, not a one-second lifetime. This simple distinction prevents a mathematically correct output from acquiring an unsupported real-world meaning.
CHAPTER 7 OF 14 · Work geometric and image examples
7. Calculate a complete four-point persistence example
State the Rips convention explicitly
Place A = (0,0), B = (1,0), C = (1,1) and D = (0,1). Define Rₜ to include a simplex exactly when all pairwise distances among its vertices are at most t. This is the diameter-threshold Vietoris–Rips convention, with equality included. The GUDHI Rips manual explains the clique construction and warns that another common convention rescales the parameter by two.
For 0 ≤ t < 1, the four vertices are isolated. Thus β₀ = 4 and β₁ = 0. At t = 1, the four side edges appear. The graph is a square cycle, so β₀ = 1 and β₁ = 1. No triangle appears yet because every three vertices include a diagonal of length √2.
At t = √2, both diagonals appear. Every triple now gives a triangle, and all four vertices give a tetrahedron. The full complex is a filled simplex, with β₀ = 1 and all positive-dimensional Betti numbers zero. The first-homology interval is therefore [1, √2), with length √2 − 1, approximately 0.4142 in the coordinate units.
Read the component intervals too
Four components begin at zero. Three merge at threshold one, while one remains. The ordinary H₀ barcode consists of three intervals [0,1) and one [0,∞). Because all births tie, the choice of which labelled vertex represents the surviving component is not unique. The interval multiset is the meaningful invariant here.
Now deliberately retain only the graph when the diagonals arrive. It has six edges, four vertices and one component, giving cycle-space dimension 6 − 4 + 1 = 3. Reporting three persistent loops would be correct for that graph and wrong for the full Rips complex. The missing filled triangles explain the discrepancy. An algorithm cannot repair a modelling decision it was never told to make.
CHAPTER 8 OF 14 · Work geometric and image examples
8. Keep the nerve, Čech and Rips constructions distinct
Pairwise overlap is less information than common overlap
A nerve has one vertex per set in a cover. It includes a simplex when the corresponding sets have a common intersection. Three pairwise overlaps give three edges, but they do not necessarily give a filled triangle. That triangle requires one point belonging to all three sets simultaneously.
For a concrete geometric comparison, take three centres forming an equilateral triangle of side two. Closed disks of radius 1.05 overlap pairwise, since twice the radius exceeds two. Their triple intersection is empty: the smallest disk centred at their circumcentre that reaches all three centres has radius 2/√3, approximately 1.1547. A Čech nerve therefore has a triangular frame at radius 1.05.
The Rips complex using edge threshold 2.10 contains the filled triangle, because all three pairwise centre distances are two. These constructions can differ even after their edge thresholds are aligned. The example demonstrates exactly which extra information a common-intersection test supplies.
Check the theorem that connects a model to a space
The existing specialist article on good covers and the nerve lemma explains why suitable contractibility and cover hypotheses matter. A nerve theorem can justify the relationship between a cover and its union. It does not automatically identify that union with an unknown object from which measurements were sampled.
In practice, record two separate arguments. First explain how the complex represents the chosen neighbourhoods. Then explain why those neighbourhoods are an adequate model of the phenomenon of interest. Sampling gaps, outliers or an inappropriate distance function can undermine the second argument while leaving the first entirely valid. Keeping those arguments separate makes it easier to repair the right part of an analysis.
CHAPTER 9 OF 14 · Work geometric and image examples
9. Respect image cells and boundary conventions
Pixels and voxels suggest cubical models
Cubical complexes use grid-shaped cells and their faces. They are natural for images because the data already occupy a regular arrangement. The GUDHI cubical-complex manual describes this representation and its periodic-boundary option. A point-cloud construction on pixel centres is a different model and may answer a different question.
Consider a three-by-three array of filled unit squares with the central square omitted. Include the boundaries of the eight remaining squares. There are sixteen vertices, twenty-four edges and eight square faces. The complex is connected and has one enclosed missing region, so β₀ = 1 and β₁ = 1. Its Euler characteristic is 16 − 24 + 8 = 0, matching 1 − 1.
Insert the central square. No new edges or vertices are needed because its whole boundary is already present. The face count becomes nine, the missing region is filled and β₁ becomes zero. This supplies a compact image test with a known before-and-after answer, including the precise cell whose inclusion changes it.
Cropping and identification change the space
If opposite sides of a fully filled rectangular grid are identified in both directions, the resulting space is a torus rather than a disk. Its loop structure comes partly from those identifications. Periodic boundaries may be appropriate for a model, but they cannot be added merely to avoid awkward edges without changing the topological question.
Likewise, two closed pixels touching at a corner share a point in their geometric union. A separate image-processing convention that counts only side-adjacent pixels as connected can disagree with that union. State which convention is being implemented before treating a mismatch as a software defect.
For a physical application, continue into pore connectivity and filtration scales. That guide shows why phase selection, segmentation, resolution and transport measurements remain necessary when topology is applied to soil images.
CHAPTER 10 OF 14 · Implement and diagnose
10. Understand what persistence reduction preserves
The ordering carries information
To compute persistence from a finite filtered simplicial complex, order simplices by entry value, putting faces before cofaces when values tie. A boundary matrix in this order contains both incidence information and the sequence in which pieces become available. Treating it as an unordered static matrix would lose the history needed to pair births and deaths.
In the standard column-reduction algorithm over F₂, repeatedly add an earlier reduced column to the current column when both have the same lowest nonzero row. Each addition cancels that shared pivot. Continue until the current column is zero or has a pivot not used by an earlier nonzero reduced column. The filtration-compatible order restricts which operations are allowed.
The Zomorodian–Carlsson paper on computing persistent homology develops the algebra and algorithm over a field. A nonzero reduced column pairs its pivot’s birth index with a death index; a zero column represents a birth that may be paired later or remain essential in the filtration.
Trace one cancellation rather than memorising a barcode
For vertices A, B, C followed by edges AB, BC, AC, the first two edges merge components. The boundary of AC is A + C. Add the BC boundary B + C to obtain A + B, then add the AB boundary to obtain zero. The closing edge therefore creates a cycle instead of merging two previously disconnected components.
If triangle ABC enters later, it fills that cycle and supplies its death. This tiny reduction links the geometric story to the column operations. It is a better debugging example than an unexplained large matrix because every cancellation can be traced to an edge endpoint.
Equal filtration values can create zero-length intervals during a simplex-by-simplex ordering. Such intervals do not describe persistence across a positive parameter range. Record whether the software suppresses them, and avoid interpreting ordering-dependent representatives as uniquely located physical structures.
CHAPTER 11 OF 14 · Implement and diagnose
11. Budget for the complex, not only the input points
A small coordinate file can imply many simplices
With n vertices all mutually adjacent, there are n(n − 1)/2 edges and n(n − 1)(n − 2)/6 triangles. At n = 100, that is 4,950 edges and 161,700 triangles before considering tetrahedra. A full simplex has 2ⁿ − 1 nonempty faces. Counting points alone therefore badly understates the possible computational workload.
This combinatorial growth explains why a dimension limit matters. For H₁, triangles are needed to determine which cycles bound; tetrahedra do not change H₁. For H₂, three-dimensional cells can matter, as the hollow-tetrahedron example showed. Set the construction dimension from the homology question, then check how the implementation treats its highest dimension.
The cost of building distances, generating simplices and reducing the boundary information should be measured separately. A run that spends most of its time expanding cliques will not necessarily improve when only the matrix routine is optimised. Record peak memory as well as elapsed time; exhausting memory is often the practical limit before arithmetic speed becomes decisive.
Simplification needs a stated preservation claim
Subsampling, truncating a filtration and applying a mathematically justified reduction are different operations. They may respectively change the input, restrict the observed parameter range or preserve a specified invariant. Do not group them together under “make it faster” without identifying what answer is still promised.
For an initial implementation, keep the exact small examples as a baseline. Compare a proposed acceleration against them and against manageable subsets of real data. Save approximation parameters and random seeds when applicable. If an optimisation comes with an error bound, attach its metric and assumptions to the report. A speed improvement is useful only when readers can understand the corresponding change, or lack of change, in the mathematical claim.
CHAPTER 12 OF 14 · Implement and diagnose
12. Diagnose discrepancies and interpret stability carefully
Start with the earliest changed assumption
When two pipelines disagree, first compare the inputs after preprocessing, then the distance or adjacency rule, then the included cells and filtration values. Only after these agree should you compare coefficients, arithmetic and algorithm settings. A disagreement caused by one pipeline filling triangles cannot be repaired by adjusting a barcode display.
Check face closure and the identity Dₖ₋₁Dₖ = 0. Compare β₀ with an independent connectivity search on the complex’s edges. Check Euler characteristic and rerun the triangle, square, tetrahedron and image-ring examples. If only real data fail, inspect duplicate coordinates, exceptional distance values and threshold equality cases before blaming the algebra.
Use exact finite-field arithmetic for these combinatorial calculations. A numerical rank routine over the real numbers is solving a different algebraic problem. Likewise, arithmetic modulo a composite integer is not automatically arithmetic in a field. The GUDHI coefficient-field implementation explicitly checks primality for its prime-field option.
Stability is a bounded comparison, not a truth detector
The Cohen-Steiner–Edelsbrunner–Harer stability paper bounds bottleneck distance between persistence diagrams by the uniform difference between suitable functions on the same space. For tame functions under the theorem’s hypotheses, a uniform perturbation of at most ε yields a diagram distance of at most ε.
For example, if the applicable bound is 0.03, a feature with persistence 0.20 is more than 0.03 away from the diagonal: its diagonal distance is half its lifetime, or 0.10. It cannot be matched to the diagonal within that bound. This is a conclusion about diagram matching, not proof that the feature has a particular biological or engineering cause.
Changing the distance function, cropping an image or identifying boundaries may fall outside that comparison. Describe the actual perturbation before invoking stability. Long persistence can motivate investigation; it does not supply missing sampling evidence, physical measurements or a causal mechanism.
CHAPTER 13 OF 14 · Transfer and continue
13. Transfer the calculation to a changed geometry
Exercise: stretch the square into a rectangle
Replace the four unit-square points by A = (0,0), B = (2,0), C = (2,1) and D = (0,1). Keep the diameter-threshold Rips convention with equality included. Determine the component intervals and the first-homology interval. Then explain whether their lengths should match the unit-square example simply because both drawings are rectangles.
The two vertical side lengths are one, the two horizontal side lengths are two and the diagonals have length √5. Before threshold one, there are four components. At one, AD and BC appear, leaving two components. At two, AB and CD appear, joining those components and completing the four-edge cycle. At √5, all triangles and the tetrahedron appear, filling the cycle.
The H₀ intervals are two copies of [0,1), one [0,2) and one [0,∞). The H₁ interval is [2, √5), whose length is approximately 0.2361. Its lifetime differs from the square’s approximately 0.4142. There is no contradiction: this filtration depends on metric distances, not only on the topological type suggested by a continuous outline.
Change the units, then change the preprocessing
If every coordinate is multiplied by ten, all these distance thresholds and interval lengths multiply by ten. The sequence of combinatorial events is unchanged. A report comparing raw persistence lengths across datasets measured in different units would therefore be misleading even though every individual calculation was correct.
Now scale only the horizontal coordinate by one half. The rectangle becomes the unit square. This anisotropic transformation changes relative distances and therefore changes the filtration itself. It is more than a harmless conversion of units. If a data pipeline standardises each feature separately, ask what metric that creates and whether it matches the scientific question.
The transferable skill is to identify which part of a previous answer depended on geometry, which depended on incidence and which depended on a convention. Reusing the square’s interval without recalculating the rectangle would demonstrate memory of an answer rather than understanding of the method.
Does matching homology prove two spaces are the same?
No. Homology records selected structure. Two spaces can share homology without being homeomorphic or homotopy equivalent. Even a contractible interval and a contractible disk have the same ordinary homology while differing as spaces. State the equivalence you actually need before deciding that a collection of Betti numbers settles the question.
Can I discard every short interval as noise?
Not without a reason tied to measurement and purpose. A short interval may reflect an artefact, but it may also correspond to a small or narrow feature relevant to the application. Keep the thresholding rule explicit, assess sensitivity and relate the feature back to the original data where possible. A convenient display cutoff is not a scientific noise model.
What should I learn and implement first?
Start with finite sets, graphs and linear algebra over F₂. Construct the triangular frame and filled triangle, write their matrices and reproduce their Betti numbers. Add the square filtration and explain every birth and death. Only then move to a small image or point cloud whose preprocessing you can inspect completely.
For a practical project, retain the original input, the constructed complex or its reproducible recipe, coefficient field, filtration units, dimension limits, software version and complete parameters. Include one independent hand-checkable example in the report. Explain why the selected invariant helps answer the actual question and what evidence would be needed to move from a mathematical descriptor to a physical conclusion.
Continue through the verified Topology root, the Algebraic Topology mechanism guide, and the specialist good-cover and pore-connectivity articles linked above. Use the primary mathematical papers for theorem assumptions and the official software manuals for implementation conventions. Dependable computational topology connects those levels clearly enough that another person can reconstruct both the answer and the limits of its meaning.