We describe an elementary algorithm for recursively constructing diagonal approximations on those finite regular CW-complexes for which the closure of each cell can be explicitly collapsed to a point. The algorithm is based on the standard proof of the acyclic carrier theorem, made constructive through the use of explicit contracting homotopies. It can be used as a theoretical tool for constructing diagonal approximations on families of polytopes in situations where the diagonals are required to satisfy certain coherence conditions. We compare its output to existing diagonal approximations for the families of simplices, cubes, associahedra and permutahedra. The algorithm yields a new explanation of a magical formula for the associahedron derived by Markl and Shnider [Trans. Amer. Math. Soc. 358 (2006), pp. 2353–2372] and Masuda, Thomas, Tonks, and Vallette [J. Éc. polytech. Math. 8 (2021), pp. 121–146] and Theorem 4.1 provides a magical formula for other polytopes. We also describe a computer implementation of the algorithm and illustrate it on a range of practical examples including the computation of cohomology rings for some low-dimensional manifolds. To achieve some of these examples the paper includes two approaches to generating a regular CW-complex structure on closed compact
3
3
-manifolds, one using an implementation of Dehn surgery on links and the other using an implementation of pairwise identifications of faces in a tessellated boundary of the
3
3
-ball. The latter is illustrated in Proposition 8.1 with a topological classification of all closed orientable
3
3
-manifolds arising from pairwise identifications of faces of the cube.