Parameterized complexity of untangling knots

Deciding whether a diagram of a knot can be untangled with a given number of moves (as a part of the input) is known to be NP-complete. In this paper we determine the parameterized complexity of this problem with respect to a natural parameter called defect. Roughly speaking, it measures the efficiency of the moves used in the shortest untangling sequence of Reidemeister moves. We show that the II- moves in a shortest untangling sequence can be essentially performed greedily. Using that, we show that this problem belongs to W[P] when parameterized by the defect. We also show that this problem is W[P]-hard by a reduction from Minimum axiom set.


Introduction
A classical and extensively studied question in algorithmic knot theory is to determine whether a given diagram of a knot is actually a diagram of an unknot.This question is known as the unknot recognition problem.The first algorithm for this problem was given by Haken [12].Currently, it is known that the unknot recognition problem belongs to NP ∩ co-NP but no polynomial time algorithm is known.See [13] for the NP-membership and [19] for co-NP-membership (co-NP-membership modulo Generalized Riemann Hypothesis was previously established in [16]).In addition, a quasi-polynomial time algorithm for unknot recognition has been recently announced by Lackenby [20].
One possible path for attacking the unknot recognition problem is via Reidemeister moves (see Figure 2): if D is a diagram of an unknot, then D can be untangled to a diagram U with no crossing by a finite number of Reidemeister moves.In addition, Lackenby [17] provided a polynomial bound (in the number of crossings of D) on the required number of Reidemeister moves.This is an alternative way to show that the unknot recognition problem belongs to NP, because it is sufficient to guess the required Reidemeister moves for unknotting.However, if we slightly change our viewpoint, de Mesmay, Rieck, Sedgwick, and Tancer [23] showed that it is NP-hard to count the number of required Reidemeister moves exactly.(An anologous result for links has been shown to be NP-hard slightly earlier by Koenig and Tsvietkova [15].)More precisely, it is shown in [23] that given a digram D and a parameter k as input, it is NP-hard to decide whether D can be untangled using at most k Reidemeiser moves.For more background on unknotting and unlinking problems, we also refer to Lackenby's survey [18].
The main aim of this paper is to extend the line of research started in [23] by determining the parameterized complexity of untangling knots via Reidemeister moves.On the one hand, it is easy to see that if we consider parameterization by the number of moves, then the problem is in FPT (class of fixed parameter tractable problems).This happens due to a somewhat trivial reason: if a diagram D can be untangled with at most k moves, then D contains at most 2k crossings, thus we can assume that the size of D is (polynomially) bounded by k.In notions of parameterized complexity, this gives a kernel of size bounded by k which immediately gives the FPT membership.In the full version, we provide a bit more details; see Observation 1 in the full version.
On the other hand, we also consider parameterization with an arguably much more natural parameter called the defect (used in [23]).This parameterization is also relevant from the point of view of above guarantee parameterization introduced by Mahajan and Raman [21].Here we show that the problem is W[P]-complete with respect to the defect.This is the core of the paper.
In order to state our main result more precisely, we need a few preliminaries on diagrams and Reidemeister moves.For purposes of this part of the introduction, we also assume that the reader is at least briefly familiar with complexity classes FPT and W [P]. Otherwise we refer to the end of the introduction, where we briefly overview these classes.

Diagrams and Reidemeister moves.
A diagram of a knot is a piecewise linear map D : S 1 → R 2 in general position; for such a map, every point in R 2 has at most two preimages, and there are finitely many points in R 2 with exactly two preimages (called crossings).Locally at a crossing two arcs cross each other transversely, and the diagram contains the information of which arc passes "over" and which "under".This we usually depict by interrupting the arc that passes under.Diagrams are always considered up-to isotopy.The unique diagram without crossings is denoted U (untangled).See Figure 1 for an example of a diagram.
Let D be a diagram of a knot.Reidemeister moves are local modifications of the diagram depicted in Figure 2. We distinguish Reidemeister moves of types I, II, and III as depicted in the figure.In addition, for types I and II, we distinguish whether the moves remove crossings (types I − and II − ) or whether they introduce new crossings (types I + and II + ).
A diagram D is a diagram of an unknot if it can be transformed to the untangled diagram U by a finite sequence of Reidemeister moves.(This is well known to be equivalent to stating that the lift of the diagram to R 3 , keeping the underpasses/overpasses, is ambient isotopic to the unknot, that is standardly embedded S 1 in R 3 .)The diagram on Figure 1 is a diagram of an unknot.Diagrams may be encoded purely combinatorially as 4-regular plane graphs (with some additional combinatorial information) and the size of this encoding is comparable to the number of crossings.Similarly, the Reidemeister moves can be encoded by purely combinatorial data.For more details we refer to Sections 2 and 3 of the full version.

Parameterization via defect.
As we discussed earlier, parameterization in the number of Reidemeister moves has the obvious disadvantage that once we fix k, the problem becomes trivial for arbitrarily large inputs (they are obviously a NO instance).We also see that if we have a diagram D with n crossings and want to minimize the number of Reidemeister moves to untangle D, presumably the most efficient way is to remove two crossings in each step, thus requiring at least n/2 steps.This motivates the following definition of the notion of defect.
Given where n is the number of crossings in D. Note that ℓ is just the number of Reidemeister moves in the untangling.It is easy to see that def(D) ≥ 0 and def(D) = 0 if and only if all moves in the untangling are II − moves.Therefore, def(D) in some sense measures the number of "extra" moves in the untangling beyond the trivial bound.(Perhaps, a more accurate expression for this interpretation would be ℓ − n/2 = 1 2 def(D) but this is a minor detail and it is more convenient to work with integers.)In addition, it is possible to get diagrams with arbitrarily large number of crossings but with defect bounded by a constant (even for defect 0 this is possible).The defect also plays a key role in the reduction in [23] which suggests that the hardness of the untangling really depends on the defect.
As we have seen above, asking the question whether a diagram can be untangled with defect at most k is same as asking if it can be untangled in k/2 moves above the trivial, but tight lower bound of n/2.This fits perfectly in the framework of above guarantee parameterization, which was introduced by Mahajan and Raman [21] for Max-Sat and Max-Cut problems.In this framework, when there is a trivial lower bound for the solution in terms of the size of the input, parameterizing by solution size trivially gives an FPT algorithm by either giving a trivial answer if the input is large, or bounding size of the input by a function of the solution size.Hence, for those problems, it makes more sense to parameterize above a tight lower bound.The paradigm of above guarantee parameterization has been very successful in the field of parameterized complexity and many results have been obtained [1,4,5,9,10,11,22].
For these reasons, we find the defect to be a more natural parameter than the number of Reidemeister moves.Therefore, we consider the following problem.The proof of Theorem 1 consists of two main steps: W[P]-membership and W[P]-hardness.Both of them are non-trivial.
For W[P]-membership, roughly speaking, the idea is to guess a small enough set of special crossings on which we perform all possible Reidemeister moves, while we remove other crossings in a greedy fashion.In order to succeed with such an approach we will need some powerful and flexible enough lemmas on changing the ordering of Reidemeister moves in some untangling by swapping them.In Section 2 we provide an algorithm for W[P]-membership but we only sketch why it works correctly.For more details, we refer to Sections 4 and 5 of the full version.
For W[P]-hardness, we combine some techniques that were quite recently used in showing parameterized hardness of problems in computational topology [2,3], along with the tools in [23] for lower bounding the defect.Namely, we use a reduction from the Minimum axiom set problem, which proved to be useful in [2,3].Roughly speaking, from an instance I of the Minimum axiom set problem, we need to build a diagram which has a small defect if and only if I admits a small set of axioms.For the "if" part, we use properties of Brunnian rings to achieve our goal.For the "only if" part, we need to lower bound the defect of our construction.We use the tools from [23] to show that the defect (of some subinstances) is at least 1.Then we use the very simple but powerful boosting lemma (Lemma 9) that shows that the defect is actually high.We describe the reduction in Section 4 and we sketch in a bit more detail why it may work.We refer to the Section 6 of the full version for a proof of correctness.
We conclude this part of introduction by proving a lemma on the properties of the defect which we will use soon after.Given a Reidemeister move m, let us define the weight of this move w(m) via the following table: The lemma is proved in the full version by a simple induction.
A brief overview of the parameterized complexity classes.Here we briefly overview the notions from parameterized complexity needed for this paper.For further background, we refer the reader to monographs [6,7,8].A parameterized problem is a language L ⊆ Σ * × N, where Σ * is the set of strings over a finite alphabet Σ and the input strings are of the form (x, k).Here the integer k is called the parameter.In the rest of the paper, given an input for a parameterized problem, n denotes the size of the input and k denotes the value of the parameter on this input.
A parameterized problem belongs to the class FPT (fixed parameter tractable) if it can be solved by a deterministic Turing machine in time f (k) • n c where c > 0 is some constant and f (k) is some computable function of k.In other words, if we fix k, then the problem can be solved in polynomial time while the degree of the polynomial does not depend on k.This is, of course, sometimes not achievable and there is a wider class XP of problems, that can be solved in time O(n f (k) ) by a deterministic Turing machine.The problems in XP are still polynomial time solvable for fixed k, however, at the cost that the degree of the polynomial depends on k.
Somewhere in between FPT and XP there is an interesting class W[P].A parameterized problem belongs to the class W[P] if it can be solved by a nondeterministic Turing machine in time h(k) • n c provided that this machine makes only O(f (k) log n) non-deterministic choices where f (k), h(k) are computable functions and c > 0 is some constant.Given an algorithm for some computational problem Π, we say that this algorithm is a W[P]-algorithm if it is represented by a Turing machine satisfying the conditions above.
Given two parameterized problems Π and Π ′ , we say that Π reduces to Π ′ via an FPT-reduction if there exist computable functions f : for some computable function g ′ ; and (iii) there exists computable function h and a fixed constant c > 0 such that for all input string, f (x, k) can be computed by a deterministic Turing-machine in O(h(k)n c ) steps.Our definition of reduction is consistent with [8, Definition 2.1] or [6, Definition 13.1], though some authors, e.g., [7,Definition 20 The classes FPT, W[P] and XP are closed under FPT-reductions.A problem Π is said to be C-hard where C is a parameterized complexity class, if all problems in C can be FPT-reduced to Π.Moreover, if Π ∈ C, we say that Π is C-complete.

An algorithm for W[P]-membership
In this section we provide the algorithm used to prove W[P]-membership in Theorem 1.

Brute force algorithm.
First, let us however look at a brute force algorithm for Unknotting via defect which does not give W[P]-membership.Spelling it out will be useful for explaining the next steps.We will exhibit this algorithm as a non-deterministic algorithm, which will be useful for comparison later on.In the algorithm, D is a diagram, and k is an integer, not necessarily positive.Also, given a diagram D and a feasible Reidemeister move m, then D(m) denotes the diagram obtained from D after performing m.
BruteForce(D, k): Yes.In all other cases continue to the next step.2. (Non-deterministic step.)Enumerate all possible Reidemeister moves m 1 , . . ., m t in D up to isotopy.Make a "guess" which move m i is the first to perform.Then, for such m i , run Therefore, altogether, the algorithm outputs Yes, if there is a sequence of guesses in step 2 which eventually yields Yes in step 1.
It can be easily shown that the algorithm terminates because whenever step 2 is performed, It can be also easily shown by induction that this algorithm provides a correct answer due to Lemma 2. Indeed, step 1 clearly provides a correct answer, and regarding step 2, if D(m i ) can be untangled with defect at most k − w(m i ), then Lemma 2 shows that D can be untangled with defect at most k.Because, this way we try all possible sequences of Reidemeister moves, the algorithm outputs Yes if and only if D can be untangled with defect at most k.
On the other hand, this algorithm (unsurprisingly) does not provide W[P]-membership as there are at least n/2 Reidemeister moves, which is unbounded in k.Thus not all moves can be guessed non-deterministically.
Naive greedy algorithm.In order to fix the problem with the previous algorithm, we want to reduce the number of non-deteministic steps.It turns out that the problematic nondeterministic steps in the previous algorithm are those where k does not decrease.(Because the other steps appear at most k times.)Therefore, we want to avoid non-deterministic steps where we perform a II − move.The naive way is to perform such steps greedily and hope that if D untangles with defect at most k, there is also such a "greedy" untangling (and therefore, we do not have to search through all possible sequences of Reidemeister moves).This is close to be true but it does not really work in this naive way.Anyway, we spell this naive algorithm explicitly, so that we can easily upgrade it in the next step, though it does not always provide the correct answer to Unknotting via defect.
Yes.In all other cases continue to the next step.The algorithm must terminate for the same reason why BruteForce terminates.It can be shown that this is a W[P]-algorithm.However, we do not do this here in detail as this is not our final algorithm.The key is that the step 3 is performed at most (k + 1)-times.
If the algorithm outputs Yes, then this is a correct answer from the same reason as in the case of BruteForce.However, as we hinted earlier, outputting No need not be a correct answer to Unknotting via defect.Indeed, there are known examples of diagrams of an unknot when untangling requires performing a II + move, see for example [14].With NaiveGreedy, we would presumably undo such II + move immediately in the next step, thus we would not find any untangling using the II + move.We have to upgrade the algorithm a little bit to avoid this problem (and a few other similar problems).

Special greedy algorithm.
The way to fix the problem above will be to guess in advance a certain subset S of so-called special crossings.This set will be updated in each nondeterministic step described above so that the newly introduced crossings will become special as well.Then, in the greedy steps we will allow to perform only those II − moves which avoid S. (This also means that a II + move cannot be undone by a II − move avoiding S in the next step.)It will turn out that we may also need to perform II − moves on S but there will not be too many of them, thus such moves can be considered in the non-deterministic steps.
For the description of the algorithm, we introduce the following notation.Let D be a diagram of a knot and S be a subset of the crossings of D; we will refer to crossings in S as special crossings.Then we say that a feasible Reidemeister II − move m is greedy (with respect to S), if it avoids S; that is, the crossings removed by m do not belong to S. On the other hand, a feasible Reidemeister move m is special (with respect to S) if it is a I − or a II − move removing only crossings in S; or a III move such that all three crossings affected by m are special; or a I + or a II + move performed on the edges with all their endpoints in S. The bulk of the proof of W[P]-membership in Theorem 1 will be to show that the algorithm SpecialGreedy(D, k) provides a correct answer to Unknotting via defect.Of course, if the algorithm outpus Yes, then this is the correct answer by similar arguments for the previous two algorithms.Indeed, Yes answer corresponds to a sequence of Reidemeister moves performed in step 2 or guessed in step 3 (no matter how we guessed S in step 0 and the role of S in the intermediate steps of the run of the algorithm is not important if we arrived at Yes).The defect of the untangling given by this sequence of moves is at most k by Lemma 2. On the other hand, we also need to show that if D untanlges with defect at most k, then we can guess some such untangling while running the algorithm.This is based on the following two auxiliary results.
For stating the results, we inductively define the notation We also say that a sequence (m 1 , . . ., m k ) is a feasible sequence of Reidemeister moves for Roughly speaking, the idea of the proof of Lemma 3 is to add into S all crossings that will eventually become affected by some of the moves m 1 , . . ., m ℓ which are not II − moves.These moves must be special.However, if we have a II − move removing a crossing that we have already added to S, then this move also has to be special and we add the other crossing to S as well.This does not propagate further, and we can bound the number of special II − moves which also provides a bound on S. Details are given in the full version.Proof of Theorem 4 requires more work and we sketch it in Section 3.

Correctness of the algorithm.
Here we explain that the algorithm SpecialGreedy(D, k) provides the answer Yes whenever there is an untangling with defect at most k modulo Lemma 3 and Theorem 4. We also need to know that this is a W[P]-algorithm (mainly) by bounding the number of non-deterministic steps.This part is relatively straightforward and we refer to Section 4 of full version for details.
Given an input (D, k) such that D admits an untangling with defect k, by Lemma 3, there is a set of crossings S in D of size at most 3k such that there is a sequence M of Reidemeister moves feasible for (D, S) inducing an untangling of D with defect at most k.Thus it is sufficient to show that SpecialGreedy(D, S, k) outputs Yes if such a sequence for a given S exists.(In fact this is if and only if but we only need the if case.)We will show this by a double induction on k and cr(D), where cr(D) is the number of crossings in D. The outer induction is on k, the inner one is on cr(D).It would be sufficient to start our induction with the pair (k, cr(D)) = (0, 0); however, whenever cr(D) = 0, then the algorithm outputs Yes in step 1.Thus we may assume that cr(D) > 0.
If (D, S) admits any greedy move, then we are in step 2. For every greedy move m there is a sequence of Reidemeister moves starting with m feasible for (D, S) inducing an untangling of D with defect at most k by Theorem 4. This move has weight 0. Thus by Lemma 2 there is a sequence of Reidemeister moves feasible for (D(m), S(m)) inducing an untangling of D(m) with defect at most k.In addition cr(D(m)) < cr(D), thus SpecialGreedy(D(m), S(m), k) outputs Yes by induction.
If (D, S) does not admit any greedy move, then we are in step 3. We in particular know that the first move in the sequence M must be special.We guess this move as we are in a non-deterministic step and denote it m i (in consistence with the notation in step 3).Now, if we remove m i from M, this is a feasible sequence for (D(m i ), S(m i )) inducing an untangling of D(m i ) with defect at most k − w(m i ) by Lemma 2. Thus Special Greedy(D(m i ), S(m i ), k − w(m i )) outputs Yes by induction, as we need.

Sketch for a proof of Theorem 4
Here we sketch a proof of Theorem 4. In general, the Reidemeister moves are not commutative: if (m, m ′ ) is a feasible sequence of Reidemeister moves in a diagram D, we cannot even expect that m ′ is feasible in D. A fortiori we cannot expect that (m ′ , m) is feasible in D and that the resulting diagram would be the same when applying (m, m ′ ).For the proof of Theorem 4, we need commutativity of the greedy moves under certain circumstances.
In particular, we need to be able to swap the greedy moves with the neighbors so that we can shift them both forward and backward through the sequence.Hint that this might be sometimes possible is the following: if m and m ′ can be performed inside disjoint balls, then they commute.In this section, we only state the lemmas on rearranging Reidemeister moves.The proofs of these lemmas (and their corollaries) are in the full version.Then we deduce Theorem 4 from the lemmas up to minor details explained in the full version.First, we extend our earlier notation: Let D be a diagram of a knot, S be a set of crossings and (m 1 , . . ., m k ) be a sequence of Reidemeister moves feasible for a pair (D, S).Then by (D, S)(m 1 , . . ., m k ) we denote the pair (D ′ , S ′ ) obtained by applying moves (m 1 , . . ., m k ) to (D, S).In our earlier notation, this means that D ′ = D(m 1 , . . ., m k ) and S ′ = S(m 1 , . . ., m k ).We also denote a II − move removing crossings x and y by {x, y} II − .
The first lemma allows to perform a greedy move m earlier in a sequence (m ′ , m).We will also need a variant of Corollary 6 which allows to postpone a greedy move.The following corollary allows us to do that.(this follows from a lemma analogous to Lemma 5 which we skip here).

▶ Corollary 7 (Corollary 13 in full version).
Let D be a diagram, S be a set of crossings in D, ℓ ≥ 2 and (m 1 , . . ., m ℓ ) be a feasible sequence of moves for (D, S).Assume that m 1 = {x 1 , y 1 } II − and m ℓ = {x ℓ , y ℓ } II − are II − moves where x 1 , y 1 , x ℓ , y ℓ ̸ ∈ S (in particular m 1 is greedy in D with respect to S).Finally, assume also that {x 1 , x ℓ } II − is a feasible Reidemeister move for (D, S) (again, it must be greedy).Then, there is a feasible sequence Last, but not the least, both the corollaries above essentially only allow swapping the moves.In the corollaries above, m i is essentially the same move as mi up to a combinatorial description (not discussed in this extended abstract) which is a reason why we use a different notation.Such corollaries cannot be sufficient for a proof of Theorem 4 in the case that m (from the statement of the theorem) is not in the sequence (m 1 , . . ., m ℓ ).We also need to be able to replace some greedy moves with different ones which is the content of the following lemma., m ℓ ) has no crossings, the crossings x and z have to be removed by some moves in the sequence (m 1 , . . ., m ℓ ).Say that a move m i removes x and m j removes z.Since m is greedy with respect to S, we get x, z / ∈ S.This also implies that x / ∈ S(m 1 , . . ., m i−1 ) (see the full version for details).Thus m i has to be greedy move in D(m 1 , . . ., m i−1 ) with respect to S(m 1 , . . ., m i−1 ).Similarly, m j is greedy in D(m 1 , . . ., m j−1 ) with respect to S(m 1 , . . ., m j−1 ).Because we assume that m is not in the sequence (m 1 , . . ., m ℓ ), we get i ̸ = j; without loss of generality i < j.Let y and w be such that m i = {x, y} II − and m j = {w, z} II − .As these moves are greedy, we get y, w ̸ ∈ S (we again refer to the full version for more detail).
Next, let D ′′ := D ′ ( m i+1 , . . ., m j−1 ) and S ′′ := S ′ ( m i+1 , . . ., m j−1 ).By a similar argument as above, we get that m is feasible in (D ′′ , S ′′ ).(Note that the moves m i , m j removing x and z have not been performed yet in order to get D ′′ .)By Lemma 8 used in D ′′ , we get that m is an untangling of D, feasible for (D, S).We also get that the defect of this untangling is equal to k by Lemma 2 and item (ii) of Corollary 7, when we used it.Note that all the moves m i , m j , m and m ′ are II − moves, thus they do not contribute to the weight.The sequence (1) is not the desired sequence yet, because it does not start with m.However, it contains m, thus we can further modify this sequence to the desired sequence starting with m as in the first paragraph of this proof.◀

W[P]-hardness
In this section we sketch a proof of W[P]-hardness part of Theorem 1.This is done by an FPT-reduction from Minimum axiom set defined below.

Minimum axiom set
It is well known that the Minimum axiom set problem is W[P]-hard; see [8,Exercise 3.20] or [7, Lemma 25.1.3](however, let us recall that our definition of FPT-reduction is consistent with [8]).
Input A finite set S, and a finite set R which consists of pairs of form (T, t) where T ⊆ S and t ∈ S.
Parameter k.Question Does there exist a subset S0 ⊆ S of size k such that if we define inductively Si to be the union of Si−1 and all t ∈ S such that there is The problem above deserves a brief explanation.The elements of S are called sentences and the elements of R are relations.A relation (T, t) with T = {t 1 , . . ., t m } should be understood as an implication Given a set S 0 ⊆ S, let us define the consequences of S 0 as c(S 0 ) := ∞ i=1 S i where S i is defined as in the statement of the problem.Intuitively, c(S 0 ) consists of all sentences that can be deduced from S 0 via the relations (implications) in R. As we work with finite sets, c(S 0 ) = S i for some high enough i.A set A is a set of axioms if c(A) = S. Therefore, the goal of the minimum axiom set problem is to determine whether there is a set of axioms of size k.Note that the axiom sets are upward-closed: If A is an axiom set and A ⊆ A ′ ⊆ S, then A ′ is an axiom set as well.
The following boosting lemma is very useful in our reduction.

Construction of the reduction
Our aim is to show that there is an FPT-reduction from the Minimum axiom set to Unknotting via defect.It is not hard to see (see the full version) that we can assume that the input (S, R, k) is preprocessed; i.e., (i) R does not contain relations of the form (∅, t); (ii) for every s ∈ S there is a relation of a form (T, s) in R; and (iii) t ̸ ∈ T for every (T, t) ∈ R. ▶ Observation 10.The pair (S, R) admits an axiom set of size k if and only if its double (S ∪ S, R ∪ R) admits an axiom set of size 2k.

Brunnians.
A Brunnian link is a nontrivial link that becomes trivial whenever one of the link components is removed.We will use the following well known construction of a Brunnian link with ℓ ≥ 2 components.We take an untangled unknot and we interlace it with two "neighboring" unknots as in Figure 3, left.We repeat this ℓ-times and we get a Brunnian link with ℓ components as in Figure 3, right.
Gadgets.From now on let (S, R, k) be a preprocessed instance of the Minimum axiom set and (S ∪ S, R ∪ R, 2k) be its double.Our aim is to build a diagram D(S, R) such that D(S, R) untangles with defect 2k if and only if (S, R) has an axiom set of size k.We will build D(S, R) using several gadgets.Formally speaking, gadgets will be maps of a form G : . We will work with them in the same way as with diagrams.In particular, we assume the same transversality assumptions on crossings as for diagrams and we mark the underpasses and overpasses.We also extend the notion of arc to this setting: It is a set G(A), where A is a closed subinterval of one of the intervals in Sentence gadget.For each sentence s ∈ S we define a sentence gadget G(s) as follows.
(We will also create an analogous gadget G( s) for s ∈ S which we specify after describing G(s).)We consider all relations R ∈ R of the form (T, s).Let ℓ = ℓ(s) be the number of such relations and we order these relations as R 1 (s), . . ., R ℓ (s), or simply as R 1 , . . ., R ℓ if s is clear from the context (which is the case now).Note that ℓ ≥ 1 due to preprocessing.Now we take our Brunnian link with ℓ+1 components, which we denote by C 0 (s), . . ., C ℓ (s), in the order along the Brunnians.We disconnect each component of this Brunnian link in an arc touching the outer face and we double each such disconnected component.See Figure 4, left.For the further description of the construction, we assume that our construction is rotated exactly as in the figure .(If ℓ ̸ = 2, then we just modify the length of C 0 (s) and insert more or fewer components C i (s) in the same way as C 1 (s) and C 2 (s) are inserted for ℓ = 2.) Now we essentially have a collection of interlacing arcs where each former component of Brunnians yields a pair of parallel arcs with four loose ends.
We merge each pair of arcs, coming from C i (s) into a single arc γ i (s) as follows; see Figure 4, right.For the pair coming from C i (s) for i ̸ = 0, we connect the bottom loose ends by a straight segment up to isotopy.In Figure 4, right, we have isotoped the figure a bit which will be useful in further steps of the construction, and we call this subarc the head of γ i (s).For the pair coming from C 0 (s), we first cross the arcs next to the top loose ends as well as next to the bottom loose ends as in the figure.Then we connect the bottom loose ends.Note that if we remove γ 1 (s), . . ., γ l (s) from the figure, then the crossings on γ 0 (s) can be removed by a II − move.This finishes the construction of G(s).The gadget G( s) is a mirror image of G(s) along the vertical line (y-axis).
Merging gadget.We will also need a merging gadget depicted on Figure 5.We order all sentences as s 1 , . . ., s m .The merging gadget consists of subgadgets M (s 1 ), M ( s 1 ), M (s 2 ), . . ., M (s m ), M ( s m ) separated by the dotted lines in the figure.Each subgadget has several loose ends.Two or four of them serve for connecting it to other subgadgets.The remaining ones come in pairs and the number of pairs equals to ℓ(s) + 1. (Recall that this is the number of components of the sentence gadget G(s).)These pairs of loose ends will be eventually connected to the loose ends of γ 0 (s), . . ., γ ℓ(s) (s) in the top-down order.
Interconnecting the gadgets.Now, we describe how to interconnect the gadgets.We place the sentence gadgets G(s 1 ), . . ., G(s m ) to the left of the merging gadget M in a top-down ordering.Similarly, we place G( s 1 ), . . ., G( s m ) to the right, again in a top-down ordering.First, for any s ∈ S ∪ S and i ∈ {0, 2, 3, . . ., ℓ(s)} (that is, i ̸ = 1), we connect γ i (s) with the (i + 1)th pair of loose ends of M (s) by a pair of parallel arcs as directly as possible without introducing new crossings; see Figure 7 (left).Now we want to connect γ 1 (s) to the second pair of loose ends of M (s).For simplicity, we describe this in the case s = s ∈ S. The case s ∈ S is mirror symmetric.We pull a pair of parallel arcs from γ 1 (s) with the aim to reach M (s) while obeying the following rules: Figure 5 The merging gadget.The gadget is rotated.See also Figure 7 for correct orientation of the gadget when connecting it to other gadgets.
(R1) We are not allowed to cross the merging gadget or the sentence gadgets (except the case described in the third rule below).We keep the newly introduced arcs on the left side from the merging gadget.(R2) We are allowed to cross other pairs of parallel arcs introduced previously (when connecting γ i (s ′ ) to M (s ′ ) for some i and s ′ ).However, if we cross such a pair, we require that all four newly introduced crossings are resolved simultaneously (for example the new pair of parallel arcs is always above the older one).We even allow a self crossing of the newly introduced parallel arcs (but we again require that four newly introduced crossings are resolved simultaneously).(R3) For every relation R = (T, s ′ ) where s ∈ T , let R = R i (s ′ ).We interlace the newly introduced parallel arcs with γ i (s ′ ) as in Figure 6.(R4) The total number of crossing is of polynomial size in the size of our instance (S, R).
As we have quite some freedom how to perform the construction obeying the rules above, the resulting construction is not unique.An example how to get this construction systematically is sketched on Figure 7(right): The newly introduced pair of arcs is pulled little bit to the right, then we continue down towards the level of G(s m ), then up towards the level of G(s 1 ), and then back down to the original position.On this way we make a detour towards γ j (s ′ ) whenever we need to apply the rule (R3).Finally, we connect the parallel arcs to M (s) without any further detour.This finishes the construction of D(S, R).
A small set of axioms implies small defect.Now we very briefly sketch the easier implication that if (S, R) admits an axiom set of size k, then D(S, R) can be untangled with defect 2k.For every sentence s in some fixed minimum axiom set, we unscrew the loop next to y(s) (compare with Figure 4, right) and we also unscrew the loops next to y( s).This is altogether 2k I − moves.If we show that the remaining crossings can be removed by II − moves only, then we are done via Lemma 2. It is not hard to see that for s in the minimum axiom set, the initial unscrewing allows to simplify the gadget G(s) essentially to M (s) via II − moves.This in particular releases at least one of the heads (see Figure 4, right) of the gadgets implied by the sentences in the minimum axiom set.Such a gadget can be then simplified again by II − moves.By repeating this procedure we simplify all gadgets G(s 1 ), . . ., G(s m ) and analogously G( s 1 ), . . ., G( s m ).Then we remove remaining crossings by m more II − moves.
Big minimum axiom sets implies big defect.It turns out that the core of the second implication in the reduction is to show the following: If the minimum axiom set for (S, R) has size at least k, then any untangling of D(S, R) has defect at least 2k.For a proof of this claim we use the approach from [23] that allows to show by a local analysis that for some diagrams the defect of any untangling is strictly positive.On the other hand, this local I C A L P 2 0 2 2 88:16 Parameterized Complexity of Untangling Knots analysis does not show much more than that the defect is at least 1 but we need 2k.In order to circumvent this problem we use the boosting lemma (Lemma 9) and we verify, roughly speaking, that the defect is at least 1 also for certain subdiagrams corresponding to sets of sentences U such that S \ U is not an axiom set (as in the assumptions of Lemma 9).Then Lemma 9 implies that the defect is as high as we need.

Figure 1
Figure 1 An example of a diagram.
a diagram D, by an untangling of D we mean a sequence D = (D 0 , . . ., D ℓ ) such that D = D 0 ; D i+1 is obtained from D i by a Reidemeister move; and D ℓ = U is the diagram with no crossings.Then we define the defect of an untangling D as above as def(D) := 2ℓ − n

▶▶ Theorem 1 .
Problem (Unknotting via defect).InputA diagram D of a knot.Parameter k.QuestionCan D be untangled with defect at most k?The problem Unknotting via defect is W[P]-complete.

▶ 2 (
Type of the move II − I − III I + II + w(m) Lemma Lemma 3 in full version).Let D be an untangling of a diagram D. Then def(D) equals to the sum of the weights of the Reidemeister moves in D.

2 .
If there is a feasible Reidemeister II − move m, run NaiveGreedy(D(m), k) otherwise continue to the next step.3. (Non-deterministic step.)If there is no feasible Reidemeister II − move, enumerate all possible Reidemeister moves m 1 , . . ., m t in D up to isotopy.Make a "guess" which m i is the first move to perform and run NaiveGreedy(D(m i ), k − w(m i )).

2 .
Given a move m in D, special or greedy with respect to S, by S(m) we denote the following set of crossings in D(m).If m is a greedy II − move or if m is a III move, then S(m) = S (under the convention that the three crossings affected by m persist in D(m)).If m is a special II − move or a I − move, then S(m) is obtained from S by removing the crossings removed by m.If m is a I + or a II + move, then S(m) is obtained from S by adding the crossings introduced by m.Now, we can describe the algorithm.SpecialGreedy(D, k): 0. (Non-deterministic step.)Guess a set S of at most 3k crossings in D. Then run Special Greedy(D, S, k).SpecialGreedy(D, S, k): 1.If k < 0, then output No.If D = U is a diagram without crossings and k ≥ 0, then output Yes.In all other cases continue to the next step.If there is a feasible greedy Reidemeister II − move m with respect to S, run Special Greedy(D(m), S(m), k) otherwise continue to the next step.3. (Non-deterministic step.)If there is no feasible greedy Reidemeister II − move with respect to S, enumerate all possible special Reidemeister moves m 1 , . . ., m t in D with respect to S up to isotopy.If there is no such move, that is, if t = 0, then output No. Otherwise, make a guess which m i is performed first and run SpecialGreedy(D(m i ), S(m i ), k − w(m i )).

▶ Theorem 4 (
provided that the move m k is special or greedy in D(m 1 , . . ., m k−1 ) with respect to S(m 1 , . . ., m k−1 ).Then (m 1 , . . ., m k ) is a feasible sequence of Reidemeister moves for the pair (D, S) if S(m 1 , . . ., m k ) is well defined this way; that is, each move m i in the sequence is special or greedy (with respect to the intermediate set S(m 1 , . . ., m i−1 ) of special crossings).▶Lemma 3 (Lemma 8 in full version).Let D be a diagram of a knot and let (m 1 , . . ., m ℓ ) be a feasible sequence of Reidemeister moves in D. Then there is a set of crossings S in D such that (m 1 , . . ., m ℓ ) is feasible for (D, S).In addition, if this sequence induces an untangling with defect at most k, then |S| ≤ 3k.Theorem 9 in full version).Let D be a diagram of a knot and S be a set of crossings in D. Let (m 1 , . . ., m ℓ ) be a feasible sequence of Reidemeister moves for (D, S), inducing an untangling of D with defect k.Assume that there is a greedy move m in D with respect to S. Then there is a feasible sequence of Reidemeister moves for (D, S) starting with m and inducing an untangling of D with defect k.

Lemma 5
is proved by a careful local analysis depending on the type of m ′ .By a suitable induction, Lemma 5 implies the following corollary for longer sequences of moves.▶ Corollary 6 (Corollary 11 in full version).Let D be a diagram, S be a set of crossings in D, ℓ ≥ 2, and (m 1 , . . ., m ℓ ) be a feasible sequence of Reidemeister moves for the pair (D, S).Assume that m ℓ is a II − move which is also feasible and greedy in D with respect to S. Then there is a sequence of Reidemester moves (m ℓ , m 1 , . . ., m ℓ−1 ) feasible for (D, S) such that (i) (D, S)(m 1 , . . ., m ℓ ) = (D, S)(m ℓ , m 1 , . . ., m ℓ−1 ); and (ii) w(m i ) = w( m i ) for i ∈ [ℓ − 1].

▶ Lemma 8 (
Lemma 14 in full version).Let D be a diagram of a knot and let m = {x, y} II − , m = {x, z} II − be two feasible Reidemeister moves in D where y ̸ = z.Assume also that m ′ = {w, z} II − is feasible in D(m) with x, y, z, w mutually distinct.Then (i) m ′ = {w, y} II − is feasible in D( m); and (ii) D(m, m ′ ) = D( m, m ′ ).Lemma 8 is again proved by local analysis in the full version.Proof of Theorem 4 (sketch).First, let us assume that m = m j for some j ∈ [ℓ].If j = 1, there is nothing to prove, thus we may assume j ≥ 2.Then, by using Corollary 6 on the sequence (m 1 , . . ., m j ), we get a sequence of moves (m j , m 1 , . . ., m j−1 ) feasible for (D, S).By item (i) of Corollary 6, the sequence (m j , m 1 , . . ., m j−1 , m j+1 , . . ., m ℓ ) is also feasible for (D, S) and induces an untangling of D. By item (ii) of Corollary 6 and Lemma 2, the defect of this sequence equals k, and that is what we need.Thus it remains to consider the case where m ̸ = m j for every j ∈ [ℓ].Because m is greedy, it is a II − move; say m = {x, z} II − .Because the final diagram D(m 1 , . . .

▶ Lemma 9 (
Boosting lemma; Lemma 15 in full version).Let (S, R) be an input of the minimum axiom set problem (ignoring the parameter for now).Let µ : S → Z be a nonnegative function.Given U ⊆ S, let µ(U ) = s∈U µ(s).Assume that µ(U ) ≥ 1 for all U such that S \ U is not an axiom set.(Equivalently, U meets every axiom set.)Then µ(S) ≥ k * where k * is the size of a minimum axiom set.Proof.Let Z := {s ∈ S : µ(s) = 0} be the zero set of µ.Then µ(Z) = 0, thus S \ Z is a set of axioms by the assumptions.This gives |S \ Z| ≥ k * and, in addition, µ(S) = µ(S \ Z) ≥ |S \ Z| ≥ k * because µ(s) ≥ 1 for every s ∈ S \ Z. ◀

Doubling the instance .Figure 3 A
Figure 3 A Brunnian link.

Figure 7
Figure 7Left: The first step of interconnecting the gadgets -connecting M (s) to the arcs γi(s) for i ̸ = 1.The mirror symmetric part for s is not displayed.Right: The second step of interconnecting the gadgets -connecting M (s) to the arc γ1(s).
Lemma 5 (Lemma 10 in full version).Let D be a diagram of a knot and S be a set of crossings in D. Let m = {x, y} II − be a II − move in D, greedy with respect to S. Let m ′ be a feasible move for the pair (D, S) which avoids {x, y}.Then there is a move m ′ feasible in D(m) of same type as m ′ and the following conditions hold: