Abstract 1 Introduction 2 Preliminaries 3 Algorithm 4 ETH-optimality 5 Discussion References

ETH-Tight Complexity of Optimal Morse Matching on Bounded-Treewidth Complexes

Geevarghese Philip ORCID Chennai Mathematical Institute, India
CNRS IRL ReLaX, Chennai, India
   Erlend Raa Vågset ORCID Western Norway University of Applied Sciences (HVL), Førde, Norway
Abstract

The Optimal Morse Matching (OMM) problem asks for a discrete gradient vector field on a simplicial complex that minimizes the number of critical simplices. It is NP-hard and has been studied extensively in heuristic, approximation, and parameterized complexity settings. Parameterized by treewidth k, OMM has long been known to be solvable on triangulations of 3-manifolds in 2O(k2)nO(1) time and in FPT time for triangulations of arbitrary manifolds, but the exact dependence on k has remained an open question. We resolve this by giving a new 2O(klogk)n-time algorithm for any finite regular CW complex, and show that no 2o(klogk)nO(1)-time algorithm exists unless the Exponential Time Hypothesis (ETH) fails.

Keywords and phrases:
Discrete Morse Theory, Simplicial Complexes, Optimal Morse Matching, Treewidth, Parameterized Algorithms, Computational Topology, Dynamic Programming, Exponential Time Hypothesis, Topological Data Analysis
Funding:
Erlend Raa Vågset: Supported in part by the Research Council of Norway, grant “Parameterized Complexity for Practical Computing (PCPC)” (No. 274526).
Copyright and License:
[Uncaptioned image] © Geevarghese Philip and Erlend Raa Vågset; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithms
; Theory of computation Algorithm design techniques ; Mathematics of computing Combinatorial algorithms ; Mathematics of computing Algebraic topology
Related Version:
Full Version: https://arxiv.org/abs/2603.05406 [39]
Acknowledgements:
Geevarghese Philip thanks Priyavrat Deshpande for introducing him to Morse matchings and to questions concerning their efficient computation.
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Classical Morse theory [37] and its discrete counterpart [21, 22] provide a framework for simplifying spaces while preserving their essential topological features (see Figure 1). They do so by relating scalar functions to gradient flows in the smooth setting and discrete Morse functions to discrete gradient vector fields (Morse matchings) in the combinatorial setting. Much of the computational work on discrete Morse theory has focused on the matching perspective [32, 34, 40, 27, 1, 23], with the pioneering work on treewidth in computational topology [12] being no exception. At first sight, this close relationship suggests that the two formulations are interchangeable. In reality, they form diverging roads in the algorithmic landscape; let us follow the one less traveled by.

Figure 1: Discrete Morse theory can simplify a space while preserving its homotopy type.

Morse theory has applications in topological data analysis and computational topology [27, 2, 33, 38, 23, 16], robotics and configuration spaces [20, 24], molecular modeling [14], and mesh and image processing [35, 18]. A recurring primitive in these works is to construct a discrete gradient vector field, also known as a Morse matching, with few critical simplices, yielding strong homotopy-preserving simplifications. Intuitively, such a field is a discrete vector field without “swirls”: there are no loops in the flow lines, so one can contract the space along them without changing the homotopy type. Combinatorially, such a field corresponds to a matching in the Hasse diagram of the complex such that reversing the matched edges does not create any directed cycles. This motivates the Optimal Morse Matching (OMM) problem, also known as Min-/Max-Morse Matching, depending on whether the objective is to minimize the number of critical simplices or maximize the number of matched pairs:

Problem 1 (Optimal Morse Matching (OMM)).

Input: A finite simplicial complex K and a weight function ω:K0.

Task: Find a discrete gradient vector field W on K.

Optimize: Minimize the total weight of critical (i.e., unmatched) simplices.

From a computational complexity perspective, OMM and closely related variants are highly intractable: they are NP-hard [32], admit strong classical inapproximability bounds [3], and are linked to other hard topological decision problems such as Collapsibility [42, 36], Erasibility of 2-complexes [12, 3], and Shellability [25]. Algorithmic work includes approximation algorithms for Max-Morse Matching [40] and a variety of heuristic and workflow-based methods for practical simplification [2, 34, 27, 23, 1]. On the parameterized side, using the optimum number of critical simplices as parameter, Erasability and Min-Morse Matching are 𝖶[𝖯]-hard and admit no FPT approximation schemes [12, 4].

Figure 2: Three spaces from left to right, all of relatively low (but increasing) treewidth.

To circumvent these complexity barriers we turn to treewidth, which intuitively measures how close a combinatorial object is to being a tree; see Figure 2. An early systematic use of treewidth in discrete Morse theory is the fixed-parameter algorithm of [12] for OMM, which runs in time 2O(t2)nO(1) when parameterized by the treewidth t of an associated spine graph for 2-complexes, and by the treewidth of either the spine graph or the dual graph for triangulated 3-manifolds. This was complemented by a Courcelle-style metatheorem for MSO-definable properties on triangulations [11], which yields fixed-parameter tractability for OMM on triangulated manifolds of fixed dimension when parameterized by the treewidth of the dual graph. Since then, treewidth has become central in computational topology, leading to FPT algorithms for a range of NP-hard topological problems and invariants [10, 13, 6], ETH-tight lower bounds for several of these problems [8, 5, 7, 43], and detailed studies of the width of triangulated 3-manifolds [30, 28, 29].

 Remark 2.

Across the literature, “treewidth k” is measured on different associated graphs (dual graphs, spine graphs, Hasse diagrams), chosen to suit the problem at hand. For fixed dimension, [11] shows that the treewidth of the Hasse diagram of a triangulation is bounded by a constant factor times the treewidth of its dual graph, and [12] shows that in dimension 3 the spine treewidth is likewise linearly bounded in terms of the dual treewidth. Thus, for fixed dimension these parameters coincide up to constant factors hidden in the O()-notation. In this paper we simply write “treewidth k” and, in practice, work with the Hasse diagram.

1.1 Contributions

Algorithmic.

We give an explicit dynamic program (DP) for a digraph formulation of Optimal Morse Matching parameterized by treewidth k, which in particular solves OMM on all finite regular CW complexes of treewidth k. It runs in time 2O(klogk)n, thereby extending and improving both the earlier explicit treewidth-based algorithms for 2-complexes and triangulated 3-manifolds with running time 2O(k2)nO(1) [12] and the implicit MSO-based algorithm for triangulated manifolds in [11]. The simple invariant and state space allowed us to implement the algorithm and verify it on small instances by exhaustive search.

Optimality.

Under ETH, our running time is optimal: using a known treewidth-based lower bound for Directed Feedback Vertex Set (DFVS), we show that there is no 2o(klogk)nO(1)-time algorithm for Optimal Morse Matching parameterized by treewidth k, even on 2-dimensional complexes of top coface degree at most 4. This follows from a new polynomial-time reduction from DFVS to Erasability, to which we apply the recent Width Preserving Strategy (WiPS) framework of [43] to ensure that treewidth is preserved. Combined with the standard equivalence between Erasability and OMM on 2-dimensional complexes, this yields the ETH-tight 2Θ(klogk) dependence.

Conceptual.

Our order-based formulation (Feedback Morse Order) shows that working indirectly with vertex orders rather than directly with matchings captures exactly what a treewidth DP for OMM needs to remember. This ordering viewpoint transfers to Alternating Cycle-Free/Uniquely Restricted Matchings (AC-FM/URM) on bipartite graphs, but the connection breaks on general graphs. Here, AC-FM and URM still only admit 2Θ(k2)nO(1)-time algorithms and lack tight-ETH lower bounds. We therefore point to AC-FM and URM as natural candidates for genuinely 2Θ(k2)-time problems in treewidth and as targets for either 2O(klogk)n-time algorithms or matching 2o(k2)nO(1) lower bounds.

 Remark 3.

Some proofs of correctness, running-time analyses, and additional details are deferred to the full version [39].

2 Preliminaries

We use standard terminology from parameterized complexity [19, 17] and discrete Morse theory [21, 22, 41]. We write n for the input size; for OMM, n is the number of cells of the complex, which equals the number of vertices of its Hasse diagram.

2.1 Parameterized complexity theory

Treewidth and nice tree decompositions.

When we speak of the treewidth of a digraph or a complex, we mean the treewidth of the natural underlying undirected graph in the first case, and of the Hasse diagram in the second. Informally, treewidth measures how close a graph is to being a tree (see also Figure 2): we cover the graph by overlapping bags of vertices arranged in a tree so that each edge lies entirely inside some bag and the bags containing any fixed vertex form a connected subtree; the width is one less than the size of the largest bag, and the treewidth k is the minimum width over all such decompositions; this k will be our parameter throughout the paper. Such decompositions let us localize global constraints: a dynamic program only needs to maintain partial solutions on a bag of size k+1 and combine them along the tree, so we can brute-force over states per bag rather than over the whole graph and obtain running times of the form f(k)nO(1). We use rooted nice tree decompositions; unless stated otherwise, we fix an arbitrary root bag and process the decomposition bottom–up. Formal definitions are given in the full version [39, App. A.1]. In this paper we work with the standard nice node types (leaf, introduce-vertex, forget-vertex, and join), and we also use auxiliary introduce-edge bags: unary nodes whose bag is identical to that of their child and that are annotated with a single edge uv in the bag, marking the point where that edge is processed in the dynamic program or reduction. This is a standard refinement that preserves width.

Figure 3: A graph G (right) and a tree decomposition T (left). Each node of T carries a bag XtV(G), drawn as a blob containing vertices of G. Adjacent bags overlap so that every vertex and every edge of G is covered.

FPT and ETH.

A parameterized problem with parameter k is fixed-parameter tractable (FPT) if it can be solved in time f(k)nO(1) for some computable function f; such running times are considered efficient when k is small compared to n, since the combinatorial explosion is confined to f(k) while the dependence on the input size remains polynomial. For conditional lower bounds we assume the Exponential Time Hypothesis (ETH) [31], which states that 3-SAT on n variables cannot be solved in time 2o(n); ETH is a strengthening of PNP that has withstood decades of algorithmic progress and underpins many tight running-time lower bounds. Our hardness source is Directed Feedback Vertex Set parameterized by the treewidth k of the underlying undirected graph of the input digraph D, where a feedback vertex set in a digraph D=(V,E) is a set JV such that DJ is acyclic.

Problem 4 (Directed Feedback Vertex Set (DFVS)).

Input: A directed graph D=(V,E) and an integer s.

Question: Does D contain a feedback vertex set of size at most s?

Figure 4: An instance of DFVS, a valid solution of size 2 and an optimal solution of size 1.
Theorem 5 (Bonamy et al. [9]).

Unless ETH fails, DFVS parameterized by the treewidth k of the underlying undirected graph of the input digraph cannot be solved in 2o(klogk)nO(1)-time.

2.2 Discrete Morse theory

Complexes and Hasse diagrams.

We use the standard notions of finite regular CW complexes and discrete Morse theory in the sense of Forman [21], and keep the topological preliminaries brief. Face relations are given by closure containment, so the face poset and its directed Hasse diagram encode the incidence data we use. We write H(X) for the directed Hasse diagram of a complex X; it has one vertex per cell and an arc στ whenever σ is an immediate face of τ (a cover relation in the face poset), and hence dim(τ)=dim(σ)+1. Let H(X) be the underlying undirected graph; we measure treewidth on H(X), denoted k. Simplicial complexes are the special case where cells are simplices (points, lines, triangles, tetrahedra, etc.); we use them in figures and in our reduction.

Figure 5: A discrete Morse function (top) on the Hasse diagram of a simplicial complex (left) and its geometric realization (right). Below, the induced discrete gradient vector field (Morse matching) is shown both on the Hasse diagram (left) and geometrically as a gradient vector field (right).

Discrete Morse theory on complexes.

Forman’s discrete Morse theory can be phrased entirely in terms of matchings on the Hasse diagram H(X) of a finite regular CW complex X. A discrete vector field is a matching W on H(X), i.e. a set of pairs (σ,τ) with στ an arc of H(X) such that each cell appears in at most one pair. From W we obtain a new digraph H(X)W by reversing exactly the matched arcs and leaving all others unchanged; if H(X)W is acyclic, then W is a discrete gradient vector field. Forman’s correspondence states that (i) every discrete Morse function on X induces such a gradient vector field, and (ii) conversely, every discrete gradient vector field arises from some discrete Morse function; in both directions, the unmatched cells in W are precisely the critical cells of the corresponding Morse function. Collapsing X along the gradient flow yields a smaller Morse complex (see Figure 1) that is homotopy equivalent to X and can make downstream topological computations much cheaper. The Optimal Morse Matching problem (Problem 1) asks for a discrete gradient vector field minimizing the total weight of these unmatched cells.

Erasibility in 2D.

For our lower bound we use the notion of erasibility of 2-dimensional simplicial complexes K. A 1-simplex (edge) e is free if it is contained in exactly one 2-simplex τ, and removing e together with τ is an elementary collapse. A 2-simplex is erasible if it can be removed through a sequence of elementary collapses, and K is erasible if every 2-simplex can be eliminated in this way, that is, if K collapses to a 1-dimensional complex.

Figure 6: A triangulation of a square that is erasible with S=: free edges are marked in red and elementary collapses by arrows. In contrast, a triangulation of a sphere has no free edges, so any erasibility requires |S|>0.

Problem 6 (Erasibility).

Input: A 2-dimensional simplicial complex K and an integer B0.

Question: Is there a set S of 2-simplices in K such that |S|B and KS is erasible?

Theorem 7 (Folklore; cf. [21, 32, 3]).

For finite 2-dimensional simplicial complexes, Erasibility and Optimal Morse Matching are computationally equivalent.

3 Algorithm

We give a fixed-parameter algorithm for Feedback Morse Matching, a digraph generalization of Optimal Morse Matching, on digraphs whose underlying undirected graph has treewidth k. The algorithm rests on three ingredients: (i) we work in the general setting of arbitrary digraphs rather than Hasse diagrams only; (ii) we adopt the Morse-function viewpoint and encode solutions as vertex orders (Feedback Morse Orders) instead of matchings; and (iii) this yields a very simple dynamic program whose state at each bag consists only of an order on the bag and a subset of its vertices. This order–mask formulation avoids the more involved connectivity machinery of previous approaches and leads to a running time of 2O(klogk)n.

3.1 Of feedback Morse matchings and feedback Morse orders

Generalizing OMM to digraphs.

For our algorithmic purposes it is convenient to generalize the matching viewpoint from Hasse diagrams to arbitrary digraphs, and to allow both positive and negative weights. Given a digraph D=(V,E) and a matching ME, let DM be the digraph obtained by reversing every edge of M and leaving all other edges unchanged; we call M a feedback Morse matching if DM is acyclic. In the resulting Feedback Morse Matching (FMM) problem (Problem 3.1), the input is a digraph D and a weight function ω:V(D), and the task is to find a feedback Morse matching minimizing the total weight of unmatched vertices. When D is the Hasse diagram H(K) of a simplicial complex K and V(D) is identified with the simplices of K, discrete gradient vector fields on K are exactly feedback Morse matchings on D. Thus OMM is the special case of FMM where D comes from a complex and ω is nonnegative; in the classical unweighted case ω1, the objective is simply the number of critical simplices [32, 3]. Mixed-sign weights in this framework allow one to favour or penalize particular cells (useful for extending a Morse Matching), while the purely negative-weight variant (e.g. ω1) on general digraphs corresponds to finding a smallest feedback Morse matching, that is, a minimum-size matching whose reversals destroy all directed cycles in D.

Problem 8 (Feedback Morse Matching (FMM)).

Input: A finite directed graph D=(V,E) and a weight function ω:V(D).

Question: Find a feedback Morse matching ME(D) that minimizes the total weight of unmatched vertices.

Figure 7: Feedback Morse matchings on digraphs. Top: an instance that admits feedback Morse matchings; two optimal solutions to FMM are shown. Bottom: an instance with no feedback Morse matching.
Theorem 9.

Let D=(V,E) be a digraph whose underlying undirected graph has treewidth k, and let n:=|V(D)|. Given vertex weights ω:V, Feedback Morse Matching on (D,ω) can be solved in time 2O(klogk)n.

Shifting from matchings to orders.

As committed procrastinators, we now do our best to avoid thinking about matchings. Instead, we turn to vertex orders. Let π=(v1,,vn) be a total order of V. An edge (u,v)E is backward with respect to π if v appears before u in π, and let M(π):={(u,v)E:(u,v) is backward w.r.t. π} be the set of backward edges. Once π is fixed, the set of edges to reverse is determined: we always take M(π) and reverse exactly these edges. We call π a feedback Morse order if M(π) is a matching (no two edges in M(π) share a vertex).

Problem 10 (Feedback Morse Order (FMO)).

Input: A digraph D=(V,E) and a weight function ω:V.

Question: Find a feedback Morse order π that minimizes the total weight of vertices that are unmatched in M(π).

Figure 8: Two feedback Morse orders of the same digraph, drawn as permutations of the vertices. In both orders, the same set of backward edges (highlighted) forms a feedback Morse matching M, showing that one matching may admit many compatible orders; other orders can yield different backward-edge sets (and different matchings), or even no matching at all. For example, DCBA induces the other optimal matching {AB,CD}, CDBA induces only {AB}, and ADCB has backward edges CA and DC, which is not a matching.
Lemma 11 (Matchings vs. orders).

Let D=(V,E) be a digraph. If π is a feedback Morse order, then M(π) is a feedback Morse matching on D. Conversely, if M is a feedback Morse matching on D, then there exists a feedback Morse order π with M(π)=M.

Proof.

For any order π, reversing all backward edges makes every edge point forward along π, so reversing all backward edges yields an acyclic digraph; if M(π) is a matching, it is a feedback Morse matching. Conversely, if M is a feedback Morse matching, then DM is acyclic, and any topological order π of DM satisfies M(π)=M.

A Forman correspondence.

By Lemma 11, FMO and FMM are equivalent optimization problems: every optimal feedback Morse order induces an optimal feedback Morse matching and vice versa, so in what follows we work entirely with the order-based formulation.

3.2 R-FMO: The boundary subproblem on bags

Orders and masks on bags.

We run our dynamic program over a rooted nice tree decomposition of the underlying undirected graph of D, refined with introduce-edge bags as in Section 2. For a bag t let Xt be its vertex set, Tt the subtree rooted at t, Wt the vertices appearing in bags of Tt, and Gt the subgraph on Wt whose edges are exactly those whose introduce-edge bags lie in Tt. Intuitively, Gt is the part of the graph already processed when we are at t, and Xt is its boundary. A global feedback Morse order π on D restricts at t to a total order g on Xt and a set UXt of boundary vertices already matched inside Gt; we view U as a mask on Xt, marking which boundary vertices are already matched. This leads to the following boundary subproblem.

Problem 12 (Restricted Feedback Morse Order (R-FMO)).

Input: A digraph G=(W,E) with vertex weights ω:W, a boundary set XW, a total order g of X, and a subset UX.

Question: Among all feedback Morse orders π on G with π|X=g and V(M(π))X=U, minimize vWX:vV(M(π))ω(v); if no such π exists, the optimum is defined as +.

The global optimum of FMO (and hence of FMM) is the value of an R-FMO instance at the root bag, whose boundary is empty; in particular, every state in our dynamic program will consist of an order on the bag together with a mask of matched boundary vertices.

Figure 9: An instance of a Restricted Feedback Morse Order (R-FMO) subproblem (left), together with two feasible solutions (right): two different feedback Morse orders on the same instance (top and bottom) inducing different sets of matched and unmatched vertices.

3.3 Dynamic program on a tree decomposition

We now describe the dynamic program at a high level. Full recurrences and a formal DP invariant are presented in [39, App. A]. For each bag t and each state (g,U) on Xt as above, we maintain a table entry c[t,g,U], defined as the optimum of the R-FMO instance (Gt,Xt,g,U), that is, the minimum total weight of unmatched vertices in WtXt over all feedback Morse orders on Gt compatible with (g,U); if no such order exists, we set c[t,g,U]=+. Figure 10 illustrates how such states are propagated along a tree decomposition and how locally invalid states are discarded. We process the nice tree decomposition bottom–up. At each bag type we update the table using only local information.

Figure 10: Dynamic program on the example from Figure 8. Bags of the tree decomposition are shown on the left; representative states (bag orders and matched subsets) on the right. States violating local adjacency, matching, or acyclicity constraints are discarded (grey).

Leaf.

The processed subgraph is empty, so there is a single state with empty order and empty matched set, and cost 0.

Introduce-vertex.

A new vertex v enters the bag (and the graph) with no incident edges yet. It cannot already be matched, so vU is forbidden. Otherwise we extend the order g by inserting v at its chosen position; the cost does not change.

Introduce-edge.

A new edge (u,v) is introduced between vertices already in the bag. The order g determines whether it is forward or backward: (i) if (u,v) is forward in g, it can never be backward in any extension and thus can never enter the matching; (ii) if (u,v) is backward in g, it must be in the matching, and this is the unique place where it is introduced along the path. In the backward case we insist that u and v are currently unmatched in the child and become matched in the parent. Any state where this would create a double match in Gt is discarded.

Forget-vertex.

A vertex v leaves the bag. At this moment all edges incident to v have already been introduced below, so v’s matching status is final. We branch on whether v is matched in the child: if v is unmatched, we add ω(v) to the cost; if v is matched, v never contributes again. We then take the minimum over all child states in which v appears at some position in the child order and the projected order on the remaining bag is g.

Join.

Two subtrees with the same bag Xt are merged. The processed subgraph Gt is the union of Gs and Gs, and the bag order g is the same in all three bags. The order g already decides which bag-internal edges are backward, and hence which bag vertices are forced to be matched via those edges; call this set MI(g). Every feasible state (g,U) must satisfy MI(g)U for the parent and both children (if g induces conflicting backward edges, all such states are infeasible and c[t,g,]=+). Outside MI(g), a bag vertex can be matched strictly below t in at most one of the two subtrees (there are no edges between the forgotten parts of the two subgraphs). Thus for a parent state (g,Ut) we look over all pairs of child matched sets (Us,Us) such that MI(g)Us,Us,Ut and UtMI(g)=(UsMI(g))˙(UsMI(g)). We then set c[t,g,Ut] to the minimum of c[s,g,Us]+c[s,g,Us] over all such pairs.

A formal DP invariant and soundness/completeness proofs can be found in [39, App. A]. At the root bag r, the bag is empty, so there is a single state (,); its value c[r,,] is exactly the optimum of FMO on D, and hence of FMM and OMM.

3.4 Running time

We sketch the running-time bound; the full accounting is given in [39, App. A.11]. Let k be the treewidth of the underlying undirected graph of D and set n:=|V(D)|. In a nice tree decomposition of width k, each bag has size at most k+1. A DP state is a pair (g,U) where g is a total order on the current bag and U is a subset of its vertices. Hence the number of states per bag is at most (k+1)!2k+1(k+1)k+12k+1= 2(k+1)log2(k+1)+(k+1)= 2O(klogk). For each fixed state, leaf/introduce-vertex/introduce-edge transitions take kO(1) time, and a forget transition branches over k+2 insertion positions. At a join bag, the order g is shared by both children, and combining solutions amounts to splitting the bag-mask information between the two subtrees, yielding at most 2k+1 admissible child pairs per state. Thus the work per bag is 2O(klogk), and since the decomposition has O(n) bags, the total running time is 2O(klogk)n.

4 ETH-optimality

How expensive is treewidth for OMM? Our 2O(klogk)n-time algorithm shows what is achievable, and in this section we prove that this is indeed the true price under the Exponential Time Hypothesis (ETH). Starting from the ETH-based lower bound for Directed Feedback Vertex Set (DFVS) parameterized by treewidth, we give a new polynomial-time reduction from DFVS to Erasibility on 2-dimensional complexes of bounded coface degree. We then realize this reduction bag-by-bag using the Width Preserving Strategy (WiPS), which performs structural induction along a tree decomposition and keeps treewidth within a constant factor. As a consequence, any 2o(klogk)nO(1)-time algorithm for OMM (even in this restricted setting) would yield such an algorithm for DFVS, contradicting ETH and pinning down the dependence on k as 2Θ(klogk).

Theorem 13.

Assuming ETH, Erasibility parameterized by treewidth k admits no 2o(klogk)nO(1)-time algorithm, even when the input is restricted to 2-dimensional simplicial complexes of top coface degree at most 4.

4.1 Gadgets and obstructions

Vertex gadgets: fuses and locks.

Let D be a DFVS instance. For each vertex vV(D) we build a local gadget Yv=(v)(v), illustrated in Figure 11. The fuse (v) is a 2-dimensional simplicial complex homeomorphic to a hollow cylinder S1×I with two boundary circles: one is a free boundary circle (marked in red) from which we can start collapsing the complex, “unravelling” the fuse by elementary collapses along the cylinder; the other boundary circle is non-free and is glued to the lock (v). The lock (v) is a 2-dimensional simplicial complex homeomorphic to a compact orientable surface of genus deg+(v) with a single boundary component, which is attached to this non-free boundary circle of the fuse. For each outgoing arc vw in D, we select a distinct simple closed curve on (v) and glue it to a cross-section circle of the fuse (w), so that each such curve acts like a finger pinching the fuse: it prevents (w) from collapsing past that cross-section as long as the lock (v) is present. In the interior of (v) we mark a single triangle deton(v) (the detonator); deleting this triangle makes the entire lock collapsible, eliminates all its pinches, and simultaneously releases every constraint that (v) imposes on neighbouring fuses. We triangulate (v) so that it becomes collapsible in either of two situations: after deleting deton(v), or after its attached fuse (v) has been completely collapsed. In particular, as long as deton(v) is present and (v) is intact, the lock cannot be collapsed while it still pinches some neighbouring fuse.

Figure 11: Schematic vertex gadget for a vertex v: the fuse (v) and the lock region (v).

Ouroboroi as obstructions.

Fix a directed cycle C=(v1,,v) in D. For each arc (vi,vi+1) (indices modulo ) we use one outgoing handle of (vi) and glue it so that it pinches the fuse (vi+1) as described above. Taking exactly these pieces along the cycle yields a closed ring of vertex gadgets in which each lock pinches the next fuse; because of the visual similarity to a snake eating its own tail, we call such a ring an -ouroboros, see Figure 12. Along an ouroboros, each fuse can be collapsed from its free boundary until it reaches the first pinch, but it cannot be collapsed past that point while the corresponding lock is present. By construction, every edge in this ring belongs to at least two triangles (coming from the fuse, the lock, or their intersection), so inside this subcomplex there are no free edges and hence no elementary collapses. In particular, an ouroboros persists under any sequence of elementary collapses until at least one of its locks is destroyed, and we will use these rings as obstructions witnessing the presence of directed cycles in D.

Figure 12: A directed 3-cycle in D and the corresponding 3-ouroboros: three vertex gadgets arranged in a ring, each lock pinching the next fuse. No edge on this ring is free, so it remains non-erasible until some detonator is deleted.

4.2 Correctness of the reduction

Let Y be the complex constructed from a DFVS instance D, and for each vertex v let deton(v) be its detonator triangle in the gadget Yv. We show that this construction yields a parameter-preserving polynomial-time reduction from DFVS to Erasibility: for every integer s, D has a feedback vertex set of size at most s if and only if Y becomes erasible after deleting at most s triangles.

Forward direction.

Let SV(D) be a feedback vertex set of size at most s, and let T:={deton(v)vS}. Deleting deton(v) makes the entire lock (v) collapsible and removes all its pinches on neighbouring fuses, so in YT we can collapse every lock (v) with vS. Since DS is acyclic, we can order its vertices topologically and, in that order, collapse each remaining gadget Yv: once all incoming locks to (v) have been removed, the fuse (v) collapses completely, and by the gadget design the remaining lock (v) then collapses as well. At the end only gadgets for vertices in S remain, but their locks have already been removed and their fuses are just cylinders with a free boundary, so they also collapse. Thus YT is erasible after deleting |T|=|S|s triangles.

Backward direction.

Conversely, let T be a set of at most s triangles such that YT is erasible, and define S:={vV(D)YvT}. Clearly |S||T|s. Suppose for contradiction that DS still contains a directed cycle C=(v1,,v). By construction, the gadgets Yv1,,Yv contain an -ouroboros subcomplex Z. Since no gadget on C intersects T, Z is disjoint from T, and every edge of Z still lies in at least two triangles in YT. Hence no edge of Z is ever free, so no sequence of elementary collapses can remove Z, and YT is not erasible – a contradiction. Thus DS is acyclic, and S is a feedback vertex set of size at most s.

4.3 Preserving width via WiPS

Width blow-up.

Hardness reductions for problems parameterized by treewidth must control the width of the target instance: a naïve “glue all gadgets at once” construction can easily turn a bounded-treewidth graph into a complex whose Hasse diagram has very large treewidth. In our setting, globally attaching all vertex gadgets Yv would allow long fuses and many handles to interact and form large grid-like regions in the Hasse diagram, even when D itself has small treewidth; see [5] for a concrete construction or Figure 13 for intuition.

Figure 13: Naïve global gluing of all gadgets. The digraph (top) has small treewidth, but the assembled space (bottom) may develop large intertwined regions in the Hasse diagram, with no a priori width bound.

WiPS.

To avoid this blow-up, we assemble the same gadgets incrementally along a nice tree decomposition of D, following the Width Preserving Strategy (WiPS) [43]. For each bag Xt we maintain a partial complex Yt together with a small interface of boundary circles associated with the vertices in Xt, and when moving from a child bag to its parent we only apply constant-size local updates touching this interface: at an introduce-vertex bag we attach a fresh gadget (v)(v); at an introduce-edge bag we add a single pinching handle between (u) and (v); at a forget-vertex bag we cap off the remaining boundary components of v; and at a join bag we merge the two partial gadgets for each v along a constant-size interface (on the lock side via a pair-of-pants, on the fuse side by attaching both child cylinders to a common boundary circle and extending it by a short cylinder). Intuitively, each bag only “sees” a bounded portion of the complex, and only a bounded number of new simplices is introduced per bag; see Figure 14.

Figure 14: WiPS-style construction. Left: a nice tree decomposition of the digraph in Figure 13 Right: the space is grown bag-by-bag, each bag exposing only a small interface and adding only constant-size pieces. This ensures that the Hasse diagram maintains treewidth O(k).

Summary.

Instantiating WiPS with our gadgets, we obtain that if D has treewidth k, then the complex Y produced by the above construction has a Hasse diagram of treewidth at most ck+c0 for fixed constants c,c0 independent of D, and |Y| remains polynomial in |D|. A detailed WiPS induction invariant and the exact bag-by-bag construction are in [39, App. B]. Here we only use this width bound together with the gadget behavior described above. Together with the correctness of the DFVS-to-Erasibility reduction proved above, this yields Theorem 13.

5 Discussion

Table 1 summarises our treewidth-parameterized bounds. For FMM/FMO on digraphs, OMM on Hasse diagrams, and 2D Erasability with coface degree at most 4 we obtain algorithms running in time 2O(klogk)n, and our width-preserving reduction from DFVS shows that no 2o(klogk)nO(1) algorithm exists under ETH. Thus these problems have optimal 2Θ(klogk)nO(1) dependence on treewidth. The rows with unknown ETH bounds in Table 1 show that the same dynamic programme extends to OMM on triangulated manifolds and to negative-weight FMM/FMO, and it remains open whether ETH lower bounds also carry over or whether the extra structure allows faster algorithms. Our algorithm also applies to AC-FM on bipartite graphs. In the single-level bipartite incidence-graph setting used in the matching-based formulation of discrete Morse theory (e.g. spine graphs), AC-FM, URM [26], and the corresponding discrete Morse matching problem are equivalent; see [12]. Hence we obtain a 2O(klogk)nO(1)-time algorithm for bipartite AC-FM/URM. Our ETH lower bound already holds for bipartite incidence graphs of maximum degree at most 4, in particular for those arising from 2-complexes, so the 2Θ(klogk)nO(1) dependence is ETH-tight in the bipartite setting. By contrast, on general graphs the recent treewidth-based dynamic programme of [15] runs in 2O(k2)nO(1) time. Whether the 2O(klogk) dependence can also be achieved for general graphs remains open.

Table 1: Upper and lower running-time bounds in the treewidth parameter k for the problems considered in this paper, suppressing polynomial factors in n. The first block contains the problems we study explicitly, ordered from more general to more restricted settings. The bottom block records bounds for AC-FM/URM; the bounded-degree row indicates that the ETH lower bound already holds for bipartite incidence graphs arising from 2D Erasability.
Problem Setting Algorithm ETH
FMM/FMO General digraphs, any weights 2O(klogk) 2o(klogk)
FMM/FMO General digraphs, negative weights 2O(klogk)
OMM DAGs/Hasse diagrams 2O(klogk) 2o(klogk)
OMM Triangulated d-manifolds 2O(klogk)
2D Erasability Coface degree 4, unweighted 2O(klogk) 2o(klogk)
Conjectured Coface degree 3, embeddable in 3 2O(klogk) 2o(klogk)
AC-FM/URM General graphs, algorithm from [15] 2O(k2) 2o(klogk)
AC-FM/URM Bipartite graphs 2O(klogk) 2o(klogk)
AC-FM/URM Bipartite graphs, maximum degree 4 2O(klogk) 2o(klogk)

Representation matters.

Forman’s correspondence identifies discrete Morse matchings with Morse functions or orders on the underlying Hasse diagram, but these viewpoints behave very differently for treewidth-based algorithms. Most prior work, including Hasse-based formulations of OMM and the parameterized algorithm of [12], stays in the matching language: discrete gradients are matchings and gradient paths are alternating paths. In that setting one either appeals to meta-theorems such as Courcelle’s theorem, with non-elementary state spaces, or designs ad-hoc state summaries based on alternating-path patterns on each bag of a tree decomposition. Figure 15 shows that such summaries are delicate: alternating reachability is not transitive, and merging states solely on the basis of their alternating pattern can silently discard globally optimal extensions. In particular, our example suggests that the union–find based invariant used in [12], which implicitly treats alternating connectivity as an equivalence relation, is too coarse as stated; one really needs to know which vertices are alternating-reachable from which, not just which “components” they lie in. The recent AC-FM/URM dynamic program of [15] can be seen as a systematic matching-based repair: on each bag it stores an “alternating matrix” recording, for every pair of vertices, whether they are connected by an alternating path with respect to the current matching, that is, the full relation RMB×B of alternating reachability. This avoids over-pruning and, on bipartite incidence graphs (such as spines or Hasse diagrams), yields a faithful matching-based implementation of discrete Morse matchings, but at the price of a 2Θ(k2) state space for bags of size O(k), as reflected in Table 1. Beyond the bipartite/Hasse case the relationship between AC-FM and FMM breaks down, and we do not currently see how to compress alternating information on general graphs to obtain a 2O(klogk) dependence without a substantially different representation.

Figure 15: Summaries based only on alternating-path patterns can over-prune. Left: the DP merges states whenever the alternating-path pattern on the current bag is the same; in particular, states that differ only in how they treat a and d are identified. Right: after introducing x,y, the matching {ax,yd} is a valid extension and can be arranged to be uniquely optimal, but no surviving state represents it, because all states that kept a and d separate were merged earlier.

Conclusion.

We give an order-based dynamic program for Optimal Morse Matching on bounded-treewidth complexes with running time 2O(klogk)n and, via WiPS-style width-preserving reductions, ETH-tight lower bounds that persist even under strong restrictions on the input. For discrete Morse theory, our results suggest that for treewidth, taking the path of functions and orderings has made all the difference. Looking ahead, the road keeps going:

  • Three gaps suggested by Table 1. First, prove the conjectured ETH-tight lower bound for 2D Erasability on complexes of coface degree 3 embeddable in 3. Second, for triangulated manifolds can we obtain a 2O(k)nO(1)-time algorithm for OMM? Third, for AC-FM/URM we have an ETH-tight 2Θ(klogk)nO(1) running time on bipartite graphs, while on general graphs the best known DP runs in 2O(k2)nO(1) time [15]. Can we show under ETH that a quadratic dependence on treewidth in the exponent is unavoidable in the general-graph case?

  • A locality constraint for OMM. With solution-size parameterizations remaining 𝖶[𝖯]-hard [12, 4], it is natural to look for complementary structural parameters. One concrete direction is to enforce local simplification by bounding (or minimizing) the length of the longest gradient path, equivalently the longest alternating path in the Hasse diagram after reversing matched edges. What is the complexity of OMM under such a locality constraint, and how does it interact with bounded treewidth?

  • WiPS beyond this paper. Our ETH lower bound relies on the Width Preserving Strategy (WiPS) [43], which enables reductions to be carried out bag-by-bag while keeping treewidth under control. Can WiPS be developed into a general toolbox for proving tight treewidth lower bounds (and perhaps transferring XNLP-hardness) for other problems studied via treewidth in topology and geometry, for example quantum invariants and decision problems on triangulations [10, 13, 6]?

References

  • [1] Madjid Allili, Tomasz Kaczynski, Claudia Landi, and Filippo Masoni. Acyclic partial matchings for multidimensional persistence: Algorithm and combinatorial interpretation. Journal of Mathematical Imaging and Vision, 61(2):174–192, 2019. doi:10.1007/s10851-018-0843-8.
  • [2] Ulrich Bauer, Carsten Lange, and Max Wardetzky. Optimal topological simplification of discrete functions on surfaces. Discrete & Computational Geometry, 47(2):347–377, 2012. doi:10.1007/s00454-011-9350-z.
  • [3] Ulrich Bauer and Abhishek Rathod. Hardness of approximation for Morse matching. In Timothy M. Chan, editor, Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, San Diego, California, USA, January 6-9, 2019, pages 2663–2674. SIAM, 2019. doi:10.1137/1.9781611975482.165.
  • [4] Ulrich Bauer and Abhishek Rathod. Parameterized inapproximability of Morse matching. Computational Geometry, 126:102148, 2025. doi:10.1016/j.comgeo.2024.102148.
  • [5] Mitchell Black, Nello Blaser, Amir Nayyeri, and Erlend Raa Vågset. ETH-tight algorithms for finding surfaces in simplicial complexes of bounded treewidth. In 38th International Symposium on Computational Geometry (SoCG 2022), volume 224 of Leibniz International Proceedings in Informatics (LIPIcs), pages 17:1–17:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.SoCG.2022.17.
  • [6] Mitchell Black and Amir Nayyeri. Finding minimum bounded and homologous chains in simplicial complexes with bounded-treewidth 1-skeleton. arXiv, 2021. arXiv:2107.10339.
  • [7] Nello Blaser, Morten Brun, Lars M. Salbu, and Erlend Raa Vågset. The parameterized complexity of finding minimum bounded chains. Computational Geometry, 122:102102, 2024. doi:10.1016/j.comgeo.2024.102102.
  • [8] Nello Blaser and Erlend Raa Vågset. Homology localization through the looking-glass of parameterized complexity theory. Journal of Applied and Computational Topology, 9:16, 2025. doi:10.1007/s41468-025-00212-0.
  • [9] Marthe Bonamy, Łukasz Kowalik, Jesper Nederlof, Michał Pilipczuk, Arkadiusz Socała, and Marcin Wrochna. On directed feedback vertex set parameterized by treewidth. In Andreas Brandstädt, Ekkehard Köhler, and Klaus Meer, editors, Graph-Theoretic Concepts in Computer Science (WG 2018), volume 11159 of Lecture Notes in Computer Science, pages 65–78. Springer, 2018. Also available as arXiv:1707.01470. doi:10.1007/978-3-030-00256-5_6.
  • [10] Benjamin A. Burton. The HOMFLY–PT Polynomial is Fixed-Parameter Tractable. 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 18:1–18:14, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SoCG.2018.18.
  • [11] Benjamin A. Burton and Rodney G. Downey. Courcelle’s theorem for triangulations. Journal of Combinatorial Theory, Series A, 146:264–294, February 2017. doi:10.1016/j.jcta.2016.10.001.
  • [12] Benjamin A. Burton, Thomas Lewiner, João Paixão, and Jonathan Spreer. Parameterized complexity of discrete Morse theory. ACM Transactions on Mathematical Software, 42(1):6:1–6:24, March 2016. doi:10.1145/2738034.
  • [13] Benjamin A. Burton, Clément Maria, and Jonathan Spreer. Algorithms and complexity for Turaev–Viro invariants. Journal of Applied and Computational Topology, 2(1-2):33–53, 2018. doi:10.1007/s41468-018-0016-2.
  • [14] Frédéric Cazals, Frédéric Chazal, and Thomas Lewiner. Molecular shape analysis based upon the Morse–Smale complex and the Connolly function. In Proceedings of the 19th Annual Symposium on Computational Geometry, pages 351–360, 2003. doi:10.1145/777792.777845.
  • [15] Juhi Chaudhary, Ignasi Sau, and Meirav Zehavi. A parameterized perspective on uniquely restricted matchings. Procedia Computer Science, 273:509–516, 2025. Also available as arXiv:2508.12004. doi:10.1016/j.procs.2025.10.339.
  • [16] Justin Curry, Robert Ghrist, and Vidit Nanda. Discrete Morse theory for computing cellular sheaf cohomology. Foundations of Computational Mathematics, 16(4):875–897, 2016. doi:10.1007/s10208-015-9266-8.
  • [17] Marek Cygan, Fedor V. Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, Cham, 2015. doi:10.1007/978-3-319-21275-3.
  • [18] Olaf Delgado-Friedrichs, Vanessa Robins, and Adrian Sheppard. Skeletonization and partitioning of digital images using discrete Morse theory. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(3):654–666, 2015. doi:10.1109/TPAMI.2014.2346172.
  • [19] Rodney G. Downey and Michael R. Fellows. Parameterized Complexity. Monographs in Computer Science. Springer, New York, NY, 1999. doi:10.1007/978-1-4612-0515-9.
  • [20] Michael Farber. Invitation to Topological Robotics. Zurich Lectures in Advanced Mathematics. European Mathematical Society (EMS), Zürich, 2008. doi:10.4171/054.
  • [21] Robin Forman. Morse theory for cell complexes. Advances in Mathematics, 134(1):90–145, 1998. doi:10.1006/aima.1997.1650.
  • [22] Robin Forman. A user’s guide to discrete Morse theory. Séminaire Lotharingien de Combinatoire, 48:B48c, 2002. URL: https://www.mat.univie.ac.at/˜slc/wpapers/s48forman.html.
  • [23] Ulderico Fugacci, Federico Iuricich, and Leila De Floriani. Computing discrete Morse complexes from simplicial complexes. Graphical Models, 103:101023, 2019. doi:10.1016/j.gmod.2019.101023.
  • [24] Robert Ghrist. Configuration spaces, braids, and robotics. In Braids: Introductory Lectures on Braids, Configurations and Their Applications, pages 263–304. World Scientific, 2010. doi:10.1142/9789814291415_0004.
  • [25] Xavier Goaoc, Pavel Paták, Zuzana Patáková, Martin Tancer, and Uli Wagner. Shellability is NP-complete. Journal of the ACM, 66(3):21, 2019. doi:10.1145/3314024.
  • [26] Martin Charles Golumbic, Tom Hirst, and Michael Lewenstein. Uniquely restricted matchings. Algorithmica, 31(2):139–154, 2001. doi:10.1007/s00453-001-0004-z.
  • [27] Shaun Harker, Konstantin Mischaikow, Marian Mrozek, and Vidit Nanda. Discrete Morse theoretic algorithms for computing homology of complexes and maps. Foundations of Computational Mathematics, 14(1):151–184, 2014. doi:10.1007/s10208-013-9145-0.
  • [28] Kristóf Huszár and Jonathan Spreer. 3-Manifold Triangulations with Small Treewidth. In Gill Barequet and Yusu Wang, editors, 35th International Symposium on Computational Geometry (SoCG 2019), volume 129 of Leibniz International Proceedings in Informatics (LIPIcs), pages 44:1–44:20, Dagstuhl, Germany, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SoCG.2019.44.
  • [29] Kristóf Huszár and Jonathan Spreer. On the width of complicated JSJ decompositions. Discrete & Computational Geometry, 74(4):917–943, 2025. doi:10.1007/s00454-025-00746-1.
  • [30] Kristóf Huszár, Jonathan Spreer, and Uli Wagner. On the treewidth of triangulated 3-manifolds. Journal of Computational Geometry, 10(2):70–98, 2019. doi:10.20382/jocg.v10i2a5.
  • [31] Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512–530, 2001. doi:10.1006/jcss.2001.1774.
  • [32] Michael Joswig and Marc E. Pfetsch. Computing optimal Morse matchings. SIAM Journal on Discrete Mathematics, 20(1):11–25, 2006. doi:10.1137/S0895480104445885.
  • [33] Harish Kannan, Emil Saucan, Indrava Roy, and Areejit Samal. Persistent homology of unweighted complex networks via discrete Morse theory. Scientific Reports, 9:13817, 2019. doi:10.1038/s41598-019-50202-3.
  • [34] Thomas Lewiner, Helio Lopes, and Geovan Tavares. Toward optimality in discrete Morse theory. Experimental Mathematics, 12(3):271–285, 2003. doi:10.1080/10586458.2003.10504498.
  • [35] Thomas Lewiner, Helio Lopes, and Geovan Tavares. Applications of Forman’s discrete Morse theory to topology visualization and mesh compression. IEEE Transactions on Visualization and Computer Graphics, 10(5):499–508, 2004. doi:10.1109/TVCG.2004.18.
  • [36] Rémy Malgouyres and Angel R. Francés. Determining whether a simplicial 3-complex collapses to a 1-complex is NP-complete. In Discrete Geometry for Computer Imagery (DGCI 2008), volume 4992 of Lecture Notes in Computer Science, pages 177–188. Springer, 2008. doi:10.1007/978-3-540-79126-3_17.
  • [37] Marston Morse. The Calculus of Variations in the Large, volume 18 of American Mathematical Society Colloquium Publications. American Mathematical Society, Providence, RI, 1996. Reprint of the 1934 original. doi:10.1090/coll/018.
  • [38] Soham Mukherjee. Denoising with discrete Morse theory. The Visual Computer, 37(9):2883–2894, 2021. doi:10.1007/s00371-021-02255-7.
  • [39] Geevarghese Philip and Erlend Raa Vågset. ETH-tight complexity of optimal Morse matching on bounded-treewidth complexes, 2026. Full version. arXiv:2603.05406.
  • [40] Abhishek Rathod, Talha Bin Masood, and Vijay Natarajan. Approximation algorithms for Max Morse Matching. Computational Geometry, 61:1–23, 2017. doi:10.1016/j.comgeo.2016.10.002.
  • [41] Nicholas A. Scoville. Discrete Morse Theory, volume 90 of Student Mathematical Library. American Mathematical Society, Providence, RI, 2019. doi:10.1090/stml/090.
  • [42] Martin Tancer. Recognition of collapsible complexes is NP-complete. Discrete & Computational Geometry, 55(1):21–38, 2016. doi:10.1007/s00454-015-9747-1.
  • [43] Erlend Raa Vågset. Optimal parameterized algorithms for solving NP-hard problems in topology. PhD thesis, University of Bergen, Bergen, Norway, 2024. URL: https://urn.nb.no/URN:NBN:no-nb_pliktmonografi_000039725.