Abstract 1 Introduction 2 Preliminaries 3 FPT-Approximation Algorithm 4 Hardness of FPT-Approximation References

Parameterized Approximability for Modular Linear Equations

Konrad K. Dabrowski ORCID Newcastle University, UK Peter Jonsson ORCID Linköping University, Sweden Sebastian Ordyniak ORCID University of Leeds, UK George Osipov ORCID Linköping University, Sweden
University of Oxford, UK
Magnus Wahlström ORCID Royal Holloway, University of London, UK
Abstract

We consider the Min-r-Lin(m) problem: given a system S of length-r linear equations modulo m, find ZS of minimum cardinality such that SZ is satisfiable. The problem is NP-hard and UGC-hard to approximate in polynomial time within any constant factor even when r=m=2. We focus on parameterized approximation with solution size as the parameter. Dabrowski, Jonsson, Ordyniak, Osipov and Wahlström [SODA-2023] showed that Min-2-Lin(m) is in FPT if m is prime (i.e. m is a field), and it is W[1]-hard if m is not a prime power. We show that Min-2-Lin(pn) is FPT-approximable within a factor of 2 for every prime p and integer n2. This implies that Min-2-Lin(m), m+, is FPT-approximable within a factor of 2ω(m) where ω(m) counts the number of distinct prime divisors of m. The high-level idea behind the algorithm is to solve tighter and tighter relaxations of the problem, decreasing the set of possible values for the variables at each step. When working over pn and viewing the values in base-p, one can roughly think of a relaxation as fixing the number of trailing zeros and the least significant nonzero digits of the values assigned to the variables. To solve the relaxed problem, we construct a certain graph where solutions can be identified with a particular collection of cuts. The relaxation may hide obstructions that will only become visible in the next iteration of the algorithm, which makes it difficult to find optimal solutions. To deal with this, we use a strategy based on shadow removal [Marx & Razgon, STOC-2011] to compute solutions that (1) cost at most twice as much as the optimum and (2) allow us to reduce the set of values for all variables simultaneously. We complement the algorithmic result with two lower bounds, ruling out constant-factor FPT-approximation for Min-3-Lin(R) over any nontrivial ring R and for Min-2-Lin(R) over some finite commutative rings R.

Keywords and phrases:
parameterized complexity, approximation algorithms, linear equations
Funding:
Peter Jonsson: Supported by the Swedish Research Council (VR) under grant 2021-04371.
Sebastian Ordyniak: Supported by the Engineering and Physical Sciences Research Council (EPSRC, project EP/V00252X/1).
George Osipov: Supported by the Swedish Research Council (VR) under grant 2024-00274.
Copyright and License:
[Uncaptioned image] © Konrad K. Dabrowski, Peter Jonsson, Sebastian Ordyniak, George Osipov, and Magnus Wahlström; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithms
Related Version:
Full Version: https://arxiv.org/abs/2509.04976
Editors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman

1 Introduction

Systems of linear equations are ubiquitous in computer science and mathematics [16] and methods like Gaussian elimination can efficiently solve linear systems over various rings. Equations and congruences over the ring of integers modulo m (m) are of central importance in number theory, but also have many applications in computer science, including complexity theory, coding theory, cryptography, hash functions and pseudorandom generators, see e.g. [3, 9, 11, 33]. Linear equations over modular rings can be solved in polynomial time, but the methods are not suited to dealing with inconsistent systems of equations. We consider the Min-r-Lin(R) problem which asks to find an assignment to a system of linear equation over the ring R that violates the minimum number of equations, and where each equation contains at most r distinct variables. This problem is NP-hard even when r=2 and R is the simplest nontrivial ring 2 [23]. We note that Min-r-Lin(R) for r and finite ring R is a special case of MinCSP(Γ) for a finite constraint language Γ. This, and the more general Valued CSP, have been widely studied from many different perspectives, e.g. [4, 6, 22, 23, 31, 32].

Two common ways of coping with NP-hardness are approximation and parameterized algorithms, but neither of them seems sufficient in isolation to deal with Min-r-Lin(m). Even Min-2-Lin over finite fields such as 2 is conjectured to be NP-hard to approximate within any constant factor under the Unique Games Conjecture (UGC) [20]: see Definition 3 in [21] and the discussion that follows. The natural parameter for Min-r-Lin(m) is the cost of the optimal solution (i.e. the number of equations not satisfied by it), which we denote by k. Under this parameterization, Min-2-Lin(m) is fixed-parameter tractable when m is a prime, i.e. m is a field, but W[1]-hard when m is not a prime power. Moreover, the problem Min-3-Lin is W[1]-hard for every nontrivial ring [8]. This motivates us to study parameterized approximation algorithms [14, 27]. This approach has received rapidly increasing interest (see, for instance, [13, 17, 18, 25, 26, 30]). Let c1 be a constant. A factor-c FPT-approximation algorithm takes an instance (I,k), runs in O(f(k))111The notation O() hides polynomial factors in the input size. time for an arbitrary computable function f, either returns that there is no solution of size at most k or returns that there is a solution of size at most ck. Thus, there is more time to compute the solution (compared to polynomial-time approximation) and the algorithm may output an oversized solution (unlike an exact FPT algorithm). 222A decision c-approximation procedure for Min-2-Lin(m) can be turned into an algorithm that returns a c-approximate solution using self-reducibility: if (S,k) is a yes-instance, then there exists a subset SS, |S|c, such that (SS,k1) is a yes-instance; moreover, such S can be found by iterating over all subsets of size at most c, which incurs a polynomial overhead on the running time of the algorithm. Our main result is the following. Let ω(m) be the number of distinct prime factors of m.

Theorem 1.

For every m+, Min-2-Lin(m) is FPT-approximable within 2ω(m).

We complement the result with two lower bounds. First, we show that allowing three or more variables per equation leads to W[1]-hardness of constant-factor approximation.

Theorem 2.

Min-3-Lin(R) over every nontrivial ring R is W[1]-hard to approximate within any constant factor.

This result strengthens two previously known hardness results: (i) Min-3-Lin(R) is W[1]-hard [8] and (ii) Min-3-Lin(R) is NP-hard to approximate within any constant (which can easily be derived from [19]). While we focus on rings of the form m, the result of Theorem 1 begs the questions whether Min-2-Lin(R) is FPT-approximable within a constant factor for every finite commutative ring R. We answer this question in the negative.

Theorem 3 (See Theorem 17 for a more detailed statement.).

There exist finite commutative rings R such that Min-2-Lin(R) is W[1]-hard to approximate within any constant factor.

Theorems 5.2 and 6.2 in [8] leave open the question of whether Min-2-Lin(pn) is FPT or W[1]-hard for a prime p and n2. The answer is unknown even for the smallest such ring – 4. While our result implies that Min-2-Lin(pn) is FPT-approximable within a factor of 2, its exact parameterized complexity remains an intriguing open problem.

Full proofs for the results marked with a can be found in the full version of the paper. Another version of this paper is available on arXiv [7]; it considers a broader class of rings, but gives worse approximation factors.

2 Preliminaries

For the basics of graph theory and parameterized complexity, we refer to [10, 12, 15, 29].

An expression c1x1++crxr=c is a (linear) equation over R if c1,,cr,cR and x1,,xr are variables with domain R. This equation is homogeneous if c=0. Let S be a set (or equivalently a system) of equations over R. Let V(S) denote the variables in S, and we say that S is consistent if there is an assignment φ:V(S)R satisfying all equations in S. An instance of the computational problem r-Lin(R) is a system S of equations in at most r variables over R, and the question is whether S is consistent. Linear equation systems over m are solvable in polynomial time and the well-known procedure is outlined, for instance, in [1, p. 473]. We now define the computational problem when we allow some equations in an instance to be soft (i.e. deletable at unit cost) and crisp (i.e. undeletable).

Min-r-Lin(R) Instance: A (multi)set S of equations over R with at most r variables per equation, a subset SS of crisp equations and an integer k. Parameter: k. Question: Is there a set ZSS such that SZ is consistent and |Z|k?

We use crisp equations for convenience since they can be modelled by k+1 copies of the same soft equation. For an assignment α:V(S)R, let costS(α) be if α does not satisfy a crisp equation and the number of unsatisfied soft equations otherwise. We drop the subscript S when it is clear from context. We write mincost(S) to denote the minimum cost of an assignment to S.

3 FPT-Approximation Algorithm

3.1 Algorithm Summary

Let p1n1pn be the prime factorization of m+. It is well known that m is isomorphic to the direct sum i=1pini, and we can reduce the problem to the prime power case.

Proposition 4 ().

Suppose that the ring R is isomorphic to a direct sum i=1Ri. If Min-2-Lin(Ri) is FPT-approximable within a factor ci for all i[], then Min-2-Lin(R) is FPT-approximable within a factor i=1ci.

Now, consider the ring pn for a prime p and positive integer n. We start with a simplification step. An equation over a ring R is simple if it is either a binary equation of the form u=rv for some rR or a crisp unary equation u=r for some rR. An instance S of 2-Lin(R) is simple if every equation in S is simple.

Lemma 5 ().

Let m be positive integer and c be a constant. If Min-2-Lin(m) restricted to simple instances is FPT-approximable within a factor c, then Min-2-Lin(m) on general instances is FPT-approximable within a factor c.

Now, suppose n=1, i.e. we are working over a field p. Min-2-Lin(p) can be solved exactly in FPT time (see. [8]); we will show a 2-approximation because it is illustrative of our approach. For an instance S of 2-Lin(p), we construct a graph G=G(S) with vertices xi for every xV(G) and 1ip1 and special vertices s and t. For unary equations x=r in S, add crisp edges sxr if r0, and crisp edges xrt for every 1rp1 if r=0. For every binary equation e of the form x=ry, construct an edge bundle Be={xriyi:1ip1} and add these edges to G. This completes the construction. We establish a correspondence between conformal st-cuts in G(S) and assignments to S. Formally, for a set of vertices XV(G), let δ(X) be the set of edges with exactly one endpoint in X, i.e. δ(X) is the cut separating X and X¯. If UV(G) is such that sU, tU and there is at most one vertex xiU for any xV(S), we say that δ(U) is a conformal st-cut. To construct an assignment from a conformal cut U, map xi whenever xiU for some i{1,,p1}, and otherwise x0; the reverse direction of the correspondence is obvious.

Let b(U) be the number of edge bundles Be intersected by δ(U). Then R being a field implies that b(U) is exactly the cost of the assignment corresponding to U. More specifically, consider an equation e=(x=ry), suppose xi,yjU and Beδ(U)=. Then i=rj because the edge xrjyj is uncut and both its endpoints are reachable from s, so the assignment corresponding to U satisfies e. This guarantee is represented by Be being a matching: view an edge xiyj as encoding “x=i if and only if y=j”. To complete the algorithm for fields, we compute a conformal cut δ(U) with b(U)k. Observe that b(U)k implies δ(U)2k because U contains at most one vertex per variable so δ(U) may intersect at most two edges of any bundle. Thus, for 2-approximation it suffices to compute a conformal cut of size 2k, which is guaranteed to exist for yes-instances. However, when translating it back into a set of equations, we may delete 2k equations because all edges of our conformal cut may intersect distinct bundles. Finally, to compute a conformal cut in FPT time, we may use branching in the style of Digraph Pair Cut [24]: compute the closest st-cut (which is unique by submodularity of cuts), and if it is not conformal, then branch.

Figure 1: Graphs Be corresponding to equations x=1y, x=2y, x=3y and x=4y.

If we use the same approach naïvely over pn, n2, then the bundles Be stop being matchings. Consider the equation e=(x=2y) over 8 (second graph from the left in Figure 1). Note that both y2 and y6 are adjacent to x4 in Be. Moreover, if x=4 then either y=2 or y=6 so the dependencies cannot be captured by binary edges (even if one were to use directed graphs). Thus, we lose the connection between the number of bundles intersected by a conformal cut and the cost of the corresponding assignment. One idea for solving Min-2-Lin(pn) is to retain the “if and only if” semantics of an edge by matching sets of values rather than individual values. More specifically, let us partition {1,,pn1} into classes C1,,C and build G(S) with vertices s, t and xC1,,xC for all xV(S). To keep the matching structure for an equation e, we want an edge xCiyCj in Be to mean “xCi if and only if yCj”. For fields, we have used the most refined partition (every nonzero element is a class of its own). For other rings, a coarser partition is needed: e.g. if R=8, then 2 and 6 have to be in the same class (think of x=2y). However, simply taking a coarser partition is not sufficient: indeed, the coarsest partition (putting all non-zero elements in the same class) has the required structure, but it only distinguishes between zero and nonzero values, and is not very useful algorithmically. Intuitively, we want to a partition such that a class assignment over pn allows us to rewrite our input as a set of equations over pn1 without increasing the cost too much.

A useful partition is obtained by viewing the elements of pn represented in base-p. Formally, every element apn equals i=0p1aipi, where the coefficients a0,,ap1p uniquely define a. Let a=(a0,,ap1), and for every a0, define ord(a)=min{i:ai0} to be the index of the first nonzero coordinate in a, and lsu(a)=rord(a) to be the least significant unit in a. For completeness, let ord(0)=lsu(0)=0. Let

abord(a)=ord(b) and lsu(a)=lsu(b).

This equivalence relation has two important properties. First, it is matching, i.e. {0} is an equivalence class, and for every i,jpn and rpn,

  • if ij then rirj,

  • if ij, then either rirj or ri=rj=0.

Moreover, it is absorbing, meaning that

  • ijp divides ij for all i,jpn.

Let Γpn denote the set of equivalence classes of , and Γpn0=Γpn{{0}}. We will drop the subscript when it is clear from the context. The name “matching” comes from considering bipartite graphs Gr0 defined by binary equations u=rv for every rR as follows: let V(Gr)=Γ0Γ0 and let there be an edge between two classes C1 on the left and C2 on the right if and only if i=rj for some iC1 and jC2. Then being matching implies that Gr0 is a matching for every r, i.e. every vertex has degree at most 1.

Example 6.

Partition Γ32 (with elements written in base-3) has classes

{013,113,213},{023,123,223},{103},{203},{003}.

For another example, Γ23 has classes

{0012,0112,1012,1112},{0102,1102},{1002},{0002}.

For a non-example, a coarser partition of 23 into three classes

{0012,0112,1012,1112},{0102,1102,1002},{0002}.

lacks the matching property (as is evident from the equation x=2y in Figure 1).

The matching property of is crucial for the main algorithmic lemma, which we state below and prove in Section 3.2. A value assignment α:V(S)pn agrees with a class assignment τ:V(S)Γ if α(v)τ(v) for all vV(S). A class assignment τ respects an equation e if it admits a satisfying assignment that agrees with τ, otherwise we say that τ violates e. Define the cost of a class assignment τ to be the number of equations in S that it violates. Note that every value assignment α uniquely defines a class assignment τα:V(S)Γpn, so we say that α strongly violates an equation e if τα violates e. Clearly, an optimal assignment can violate at most k equations in S, and we can guess the number q{0,,k} of strongly violated equations.

Lemma 7.

Let p be a prime, n be a positive integer, and let k and q be integers with kq. There is a randomized algorithm that takes a simple instance S of 2-Lin(pn) and integers k and q as input, and in O(2O(k)) time returns a class assignment τ:V(S)Γpn such that the following holds. Let Y be the set of equations in S violated by τ. Then have |Y|2q. Moreover, if S admits an assignment of cost at most k that strongly violates at most q equations, then with probability at least 2O(k+q2), SY admits an assignment of cost at most k|Y|/2 that agrees with τ.

While technical details are deferred to Section 3.2, we remark that we can no longer use branching in the style of Digraph Pair Cut when working over non-fields since some conformal cuts of low cost correspond to class assignments of high cost. For an extreme example over 8, consider the system of equations ={x=4,2a=x,3a=b,3b=c,3c=a}. By the construction of G(), the vertex t is isolated and the connected component U of s contains vertices s, x{4}, a{2,6}, b{2,6} and c{2,6}. Hence, δ(U) is empty and conformal, but the cost of is at least 1 because the system is inconsistent (this follows from considering both possible values for a, which are 2 and 6). In fact, the cost is exactly 1 because it is sufficient to delete 2a=x. To mitigate this issue of “invisible” future costs, we use shadow removal in the class assignment graph followed by branching on the shadow components.

Now, to explain how the absorbing property of is used, we need some definitions. Choose an arbitrary representative element C from every equivalence class CΓ. Consider a simple equation e and a class assignment τ:V(e)Γ to its variables that respects e. For unary equations e=(u=r), define e=next(e,τ) to be

u=rτ(u)p.

For binary equations e=(u=rv), define e=next(e,τ) to be

u=rv+rτ(v)τ(u)p.

The absorbing property implies that next(e,τ) is defined in both cases. Indeed, if e=(u=r) and τ respects e, then rτ(u) and rτ(u), so p divides rτ(u). If e=(u=rv) and τ respects e, then there is an assignment α:{u,v}pn such that α(u)=rα(v), α(u)τ(u) and α(v)τ(v). Equivalently, α(u)rα(v)=0 and p divides both τ(u)α(u) and τ(v)α(v), hence p also divides any linear combination of these two values, particularly

r(τ(v)α(v))(τ(u)α(u))=rτ(v)τ(u)+(α(u)rα(v))=rτ(u)τ(v).
Lemma 8 ().

Let p be a prime and n+. Let e be a simple equation over pn, and τ:V(e)Γ be a class assignment. Then τ respects e if and only if next(e,τ) is satisfiable over pn1.

Now we combine all ingredients to prove the main theorem.

Theorem 1. [Restated, see original statement.]

For every m+, Min-2-Lin(m) is FPT-approximable within 2ω(m).

Proof.

Let m=p1n1pn be the prime factorization of m. Note that ω(m)=, so by Proposition 4, it suffices to show that Min-2-Lin(pn) is FPT-approximable within factor 2 for every prime p and positive integer n. We proceed by induction on n. If n=1, then we can use the algorithm of [8] for Min-2-Lin over fields to solve the problem exactly. Otherwise, let (S,k) be an instance of Min-2-Lin(pn). By Lemma 5, we may assume without loss of generality that S is simple.

Select a value q{0,,k} uniformly at random and run the algorithm from Lemma 7 on (S,k,q) to produce a class assignment τ:V(S)Γpn. Let Y be the set of equations in S violated by τ. If |Y|>2q, then reject (S,k). Otherwise, create an instance S of 2-Lin(pn1) with V(S)={v:vV(S)} and S={next(e,τ):eSY}. Set k=k|Y|/2 and pass (S,k) as input to the algorithm for Min-2-Lin(pn1), and return the same answer.

Towards correctness, first assume (S,k) is a yes-instance, and let q be the number of equations strongly violated by an optimal assignment to S. Our guess for q is correct with probability 1k+1. By Lemma 7, with probability 2O(q2), we have |Y|2q and SY admits an assignment of cost at most k|Y|/2 that agrees with τ. By Lemma 8, the instance S of 2-Lin(pn1) we create has cost at most k, so we accept.

For the other direction, suppose the algorithm accepts. Then (S,k) is a yes-instance of Min-2-Lin(pn1), and by Lemma 8, mincost(SY)k|Y|/2. Let Z be an optimal solution to SY. Then YZ is a solution to S, and |YZ||Y|+|Z|2(k|Y|/2)+|Y|2k.

We remark that all steps in the algorithm can be derandomized either by exhaustive branching or standard methods in [28].

3.2 Computing Class Assignments

This subsection is devoted to a proof of Lemma 7. To achieve this we introduce the class assignment graph (Section 3.2.1) and show that certain cuts in this graph correspond to class assignments (Section 3.2.2), which themselves correspond to solutions of Min-2-Lin(pn). We then use shadow removal and branching to compute these cuts (Section 3.2.3). Throughout this section, we consider the ring pn for prime number p and integer n.

3.2.1 The Class Assignment Graph

In what follows, let (S,k) be a simple instance of Min-2-Lin(pn) and let be the matching and absorbing equivalence relation on pn defined in Section 3.1. Without loss of generality, we assume that every equation of S is consistent (otherwise we can remove the equation and decrease k by 1) and non-trivial (otherwise we can remove the equation). We first use the matching property of to define the mapping πe:Γpn0Γpn between equivalence classes for any equation e=(ax=y) with apn{0}, as follows. For every CΓpn0, we set:

  • πe(C)=0 if ar=0 for every rC and

  • πe(C)=D otherwise, where D is the unique equivalence class such that e maps C to D. This is uniquely defined since has the matching property.

For an equation e=(x=a) with apn, we let πe be the unique equivalence class Γpn(a) consistent with e. We can now define the class assignment graph G=G(S); see Figure 2 for an illustration. The graph G has two distinguished vertices s and t together with vertices xC for every xV(S) and every non-zero class CΓpn0. Moreover, G contains the following edges for each equation.

  • For an equation e=(ax=y) do the following. For every CΓpn0, add the edge xCyπe(C) if πe(C)0. For every DΓpn0 such that πe1(D) is undefined, add the edge yDt. If the equation is crisp, then the edges are crisp as well.

  • For a crisp equation e=(x=0), add the crisp edge xCt for every class CΓpn0.

  • For a crisp equation e=(x=b), where b0 , add the crisp edge sxπe.

Figure 2: Let S be the instance of 2-Lin(4) with variables a, b, c, d, u, r and equations a=1, b=1, 2a=c, c=2u, u=r, 2b=d, and d=r. The figure illustrate the class assignment graph G=G(S). Note that has only two non-zero equivalence classes, namely, E={2} and O={1,3}. Every edge of G is annotated with the equation that implies it. A minimum conformal st-cut is given by the two edges that correspond to the equation u=r and corresponds to the class assignment a=O, b=O, c=E, d=E, u=O, and r=E. Note that G has only one minimal conformal st-cut closest to s, namely {aOcE,bOdE}. This st-cut corresponds to the class assignment a=O, b=O, and c=d=u=r=0. Therefore, the optimum solution for S only removes the equation u=r, however, any solution that corresponds to a minimum conformal st-cut closest to s has to remove the equations 2a=c and 2b=d.

Intuitively, every node of G corresponds to a Boolean variable and every edge e of G corresponds to an “if and only if” between the two Boolean variables connected by e. Moreover, every assignment φ of the variables of S naturally corresponds to a Boolean assignment, denoted by φG of the vertices in G by setting s=1, t=0, and:

  • if φ(x) belongs to the non-zero class C, then we set xC=1 and xC=0 for every non-zero class C not equal to C,

  • if φ(x)=0, we set xC=0 for every non-zero class C.

We say that an edge e of G is satisfied by φ if φG satisfies the “if and only if” Boolean constraint represented by that edge.

Observation 9.

Let S be a simple instance of 2-Lin(pn), let φ be an assignment of S and pick eS. If φ satisfies e, then φG satisfies all edges corresponding to e in G(S).

3.2.2 Cuts in the Class Assignment Graph

In this section, we introduce conformal cuts and show how they relate to class assignments and solutions to Min-2-Lin(pn) instances. Let S be a simple instance of 2-Lin(pn) and G=G(S). An st-cut Y in G is conformal if for every variable xV(S) at most one vertex xC for some CΓpn0 is connected to s in GY. Please refer to Figure 2 for an illustration of conformal cuts in the class assignment graph. If Y is a conformal st-cut in G, then we say that a variable x is decided with respect to Y if (exactly) one vertex xC is reachable from s in GY; and otherwise we say that x is undecided with respect to Y. Moreover, we denote by τY the assignment of variables of S to classes in Γpn implied by Y, i.e. τY(x)=0 if x is undecided and otherwise τY(x)=C, where C is the unique non-zero class in Γpn such that xC is reachable from s in GY. We say that an assignment φ of S agrees with Y if φ(x) is in the class τY(x) for every variable x of S. Note that if some assignment agrees with Y, then Y is conformal. The following auxiliary lemma characterizes which edges of G are satisfied by an assignment φ of S after removing a set Y of edges from G.

Lemma 10.

Let Y be a set of edges of G and let φ be an assignment of S. Then, φG satisfies all edges reachable from s in GY if and only if φG sets all Boolean variables reachable from s in GY to 1. Similarly, φG satisfies all edges reachable from t in GY if and only if φG sets all Boolean variables reachable from t in GY to 0.

Proof.

This follows because φG(s)=1 and φG(t)=0 for any φ and every edge of G corresponds to an “if and only if” between the variables corresponding to its two endpoints.

For a set Z of equations of S, we let ed(Z) denote the set of all edges of G corresponding to an equation of Z. Conversely, for a set Y of edges of G, we let eqn(Y) denote all equations of S having a corresponding edge in Y. Moreover, if Y is an st-cut in G, we let sep(Y) denote the unique minimal st-cut contained in Y that is closest to s in G. Finally, for an optimal solution Z of S, we let Z¯ be the set of equations Zeqn(sep(ed(Z))), i.e. all equations in Z that do not have an edge in sep(ed(Z)). We can now establish the connection between solutions of Min-2-Lin(pn) instances and conformal st-cuts in the class assignment graph.

Lemma 11 ().

Let Z be a set of equations such that SZ is satisfiable and let Y=ed(Z). Then, Y=sep(Y) satisfies:

  1. 1.

    Y is a conformal st-cut.

  2. 2.

    |Y|2|eqn(Y)|=2|ZZ¯|.

  3. 3.

    There is a satisfying assignment for SZ that agrees with Y.

Proof Sketch.

Let φ be a satisfying assignment of SZ. Observation 9 implies that φG satisfies all edges of GY. Therefore, it follows from Lemma 10 that φG sets all vertices reachable from s in GY to 1 and all vertices reachable from t in GY to 0. Thus, Y is an st-cut, because otherwise t would have to be set to 1 by φG since it would be reachable from s in GY. Therefore, Y=sep(Y) exists. Because Y is closest to s, it holds that a vertex is reachable from s in GY if and only if it is reachable from s in GY. Therefore, if at least two vertices xC and xC for some distinct non-zero classes C and C are reachable from s in GY for some variable x, then all of them must be set to 1 by φG, which is not possible due to the definition of φG. We conclude that Y is conformal.

Towards showing that |Y|2|eqn(Y)|, it suffices to show that |Yed(e)|2 for every equation eZ. Note that because Y is a minimal st-cut, it holds that one of the endpoints of every yY is reachable from s in GY. Therefore, because Y is conformal, Y can contain at most two edges in ed(e)={xCyπe(C)|CΓpn0πe(C)0}{yDt|DΓpn0πe1(D) is undefined} for every binary equation e of the form ax=y. Similarly, Y can contain at most one edge in ed(e)={xCt|CΓpn0} for every unary equation e of the form x=0. Finally, |ed(e)|=|{sxπe}|=1 for every unary equation e of the form x=b. Therefore, |Y|2|eqn(Y)|, and Y=ZZ¯ by definition.

Let D be the set of all variables of S such that no vertex xC is reachable from s in GY. Let φ be the assignment for S such that φ(x)=0 if xD and φ(x)=φ(x) otherwise. Clearly, φ agrees with Y, because φ agrees with all variables not in D and all other variables are correctly set to 0 by φ. It therefore only remains to show that φ still satisfies SZ, which we leave to the full version of the paper.

3.2.3 Shadow Removal

We show how shadow removal (introduced in [28] and improved in [5]) can be used for computing conformal cuts that correspond to solutions of a Min-2-Lin(pn) instance. We follow [5] and begin by importing some definitions, which we translate from directed graphs to undirected graphs to fit our setting; to get back to directed graphs one simply has to think of an undirected graph as the directed graph obtained after replacing each undirected edge with two directed arcs in both directions. Let G be an undirected graph. Let be a set of connected subgraphs of G. A set TV(G) is an -transversal if T intersects every subgraph in . Conversely, if T is an -transversal, we say that is T-connected.

Theorem 12 ([5]).

Let G be an undirected graph, TV(G) and k. There is a randomized algorithm that takes (G,T,k) as input and returns in O(4k) time a set WV(G)T such that the following holds with probability 2O(k2). For every T-connected family of connected subgraphs in G, if there is an -transversal of size at most k in V(G)T, then there is an -transversal YV(G)(WT) of size at most k such that every vertex vWY is connected to T in GY.

The following lemma is crucial for the application of shadow removal (Theorem 12). Informally, it shows that if Z is a solution, i.e. a set of equations such that SZ is satisfiable, then we can obtain a (not too large) new solution Z=(Z¯eqn(Y)) by replacing the corresponding conformal minimal sA-cut Y=sep(ed(Z)), where A is the set of vertices in G not reachable from s in GY, by any minimal sA-cut Y.

Lemma 13.

Let S be a simple instance of 2-Lin(pn) and G=G(S). Moreover, let Z be a set of equations such that SZ is satisfiable, Y=sep(ed(Z)), A be the set of all vertices in G that are not reachable from s in GY, and let Y be an sA-cut in G. Then, there is an assignment φ:V(S)pn of S that satisfies SZ and agrees with Y, where Z=(Z¯eqn(Y)).

Proof.

Lemma 11 implies that Y is conformal and there is a satisfying assignment φ for SZ that agrees with Y. Because Y is also an sA-cut in G, if no vertex xC is reachable from s in GY for some variable x of S, then the same applies in GY. Let D be the set of all variables x of S such that some vertex xC is reachable from s in GY but that is not the case in GY. Let φ be the assignment obtained from φ by setting all variables in D to 0. Then, φ agrees with Y. We claim that φ also satisfies SZ, where Z=(Z¯eqn(Y)).

Consider a unary equation e of SZ on variable x. If xD, then φ(x)=φ(x) and therefore φ satisfies e (because e is crisp and therefore eZ). So suppose that xD. If e is of the form x=0, then φ satisfies e. Otherwise, e is of the form x=b for some b0 and GY contains the edge sxπe. Therefore, xπe is reachable from s in GY contradicting our assumption that xD.

Now, consider a binary equation e=(ax=y) of SZ on variables x and y and first consider the case when eZ. Clearly, if neither a vertex xC nor a vertex yC is reachable from s in GY, then φ(x)=φ(y)=0, so e is satisfied by φ. We next show that either no vertex xc or no vertex yC is reachable from s in SY. Suppose for a contradiction that xCx and yCy are reachable from s in SY. Let h be an arbitrary edge in ed(e)Y; such an edge h exists because eZZ. Because Y is a minimal st-cut, it follows that exactly one endpoint of h is reachable from s in GY and either xC or yC (endpoint of h) for some CΓpn must be reachable from s in GY. We assume without loss of generality that xC is reachable from s in GY. Because Y is an sA-cut and Y does not contain h, xC is not reachable from s in GY. But then CCx and both xC and xCx are reachable from s in GY, which contradicts that Y is conformal. It remains to consider the case when there is a vertex xC that is reachable from s in GY but no vertex yC is reachable from s in GY; the case when there is a vertex yC reachable from s in GY but no vertex xC reachable from s in GY is analogous. Since Yed(e)=, we obtain that πe(C)=0 since otherwise either t or some yC would be reachable from s in GY. Because φ(y)=0, it follows that e is satisfied by φ. This completes the proof for the case when eZ.

Suppose instead that eZ. In this case φ satisfies e and therefore φ also satisfies e unless exactly one of x and y is not in D. We distinguish the following cases:

  • xD and yD. If there is no vertex xC that is reachable from s in GY, then the same holds in GY so φ(x)=φ(x)=φ(y)=0, which shows that φ satisfies e. Otherwise, let xC be reachable from s in GY. Then, πe(C)=0 since otherwise either t or yπe(C) is also reachable from s in GY (because Yed(e)=), which in the former case contradicts our assumption that Y is an st-cut and which in the latter case contradicts our assumption that yD. Therefore, φ satisfies e (because φ(y)=0).

  • xD and yD. We first show that there is no vertex yC that is reachable from s in GY. Suppose there is such a vertex yC. Then, πe1(C) is undefined since otherwise xπe1(C) is reachable from s in GY (because Yed(e)=), which contradicts our assumption that xD. But then yCtE(GY) and t is reachable from s in GY, which contradicts our assumption that Y is an st-cut. Hence, there is no vertex yC that is reachable from s in GY, which implies that the same holds in GY so φ(y)=φ(y)=φ(x)=0, which shows that φ satisfies e.

Let G=G(S) and for a set WV(G), let δ(W) be the set of edges incident to a vertex in W and a vertex in V(G)W. The forthcoming Lemma 14 provides a version of shadow removal adopted to our problem. Informally, it provides us with a set WV(G) such that we only have to look for conformal st-cuts that are subsets of δ(W) to obtain our class assignment; in fact it even shows that for every component C of G[W] either all edges in δ(C) are part of the cut or no edge of δ(C) is part of the cut. We will use this fact in Lemma 15 to find a conformal st-cut by branching on which components of G[W] are reachable from s.

More formally, if Z is a set of equations such that SZ is satisfiable and A is the set of vertices not reachable from s in G minus the conformal st-cut sep(ed(Z)) (see Lemma 11), then the lemma provides us with a set WV(G) such that there is a conformal sA-cut Y within δ(W) of size at most 2|ZZ¯| such that there is an assignment φ:V(S)pn for the variables in S that satisfies S(Z¯eqn(Y)) and agrees with Y. The main idea behind the proof is the application of Theorem 12 to the set of all walks from s to A in G to obtain the set W and to employ Lemma 13 to obtain the new solution that corresponds to the minimum sA-cut Yδ(W).

Lemma 14 ().

Let S be a simple instance of 2-Lin(pn) and let G=G(S). Moreover, let Z be a set of equations such that SZ is satisfiable, Y=sep(ed(Z)), let A be the set of all vertices in G that are not reachable from s in GY, and let q=|ZZ¯|. There is a randomized algorithm that in 𝒪(42q) time takes (G,q) as input and returns a set WV(G){s} such that the following holds with probability 2O(q2). There is a (minimal) sA-cut Y of size at most 2q satisfying:

  1. 1.

    every vertex vW is connected to s in GY,

  2. 2.

    Yδ(W),

  3. 3.

    there is satisfying assignment for S(Z¯eqn(Y)) that agrees with Y.

Moreover, for every component C of G[W] the following holds:

resume

either Yδ(C)= or δ(C)Y,

resume

if tC, then δ(C)Y,

resume

if xα,xαC for some variable x and αα, then δ(C)Y,

resume

if C contains some xα for some decided variable x w.r.t. Y, then δ(C)Y.

The following lemma now uses the set WV(G) computed in Lemma 14 to compute a set of at most 2𝒪(k) conformal cuts 𝒴 which contains a cut Y with the following property. If S has a solution Z of size at most k such that |ZZ¯|=q, then there is a subset Z2(ZZ¯) with for which Y serves as a 2-approximation: more precisely, |Y|2|Z2|, (ZZ2)Y is a solution to S, and S((ZZ2)Y) admits a satisfying assignment that agrees with Y. Observe that the cost of SY is at most |ZZ2|k|Y|/2. Now Lemma 7 is an immediate consequence of Lemma 15, i.e. instead of returning the set 𝒴 of conformal cuts, we choose one conformal cut Y𝒴 uniformly at random and output the class assignment corresponding to Y. The main idea behind computing 𝒴 is to use the fact that we only need to consider conformal cuts that are within δ(W) and this allows us to branch on which components of G[W] are reachable from s (see also Property 4. in Lemma 14).

Lemma 15 ().

Let S be a simple instance of 2-Lin(pn) and let k and q with kq be integers. There is a randomized algorithm that takes (S,k,q) as input and returns in 𝒪(2𝒪(k)) time a set 𝒴 of at most 2𝒪(k) conformal cuts (each of size at most 2q), such that if S has a solution Z of size at most k such that q=|ZZ¯| then with probability at least 2O(k+q2) there is a cut Y𝒴 with the following property: there is a partition Z=Z1Z2 where Z¯Z1 and |Y|2|Z2|, and an assignment that satisfies S(Z1eqn(Y)) and agrees with Y.

4 Hardness of FPT-Approximation

We complement the approximation algorithm with hardness results: we prove (1) that for finite, commutative, non-trivial rings R, Min-r-Lin(R) is W[1]-hard to FPT-approximate within any constant when r3 and (2) the existence of finite commutative rings R such that Min-2-Lin(R) is W[1]-hard to FPT-approximate within any constant.

Let G denote an arbitrary Abelian group. An expression x1++xr=c is an equation over G if cG and x1,,xr are either variables or inverted variables with domain G. We say that it is an r-variable equation if it contains at most r distinct variables. A cyclic group is generated by a single element and every finite cyclic group Cn of order n is isomorphic to the additive group of n. Cyclic groups are the building blocks of more complex Abelian groups: the fundamental theorem of finite Abelian groups asserts that every finite Abelian group is a direct sum of cyclic groups whose orders are prime powers.

We consider the natural group-based variant Min-r-Lin(G) of the Min-r-Lin(R) problems in what follows. We first prove that Min-3-Lin(Cp), with p a prime, is not FPT-approximable within any constant if FPT W[1]. Our result is based on a reduction from a fundamental problem in coding theory: the Maximum Likelihood Decoding problem over p with p prime. Here we are given a matrix Apn×m, a vector bpm, and the goal is to find xpn such that Ax=b with minimum Hamming weight, i.e. the one that minimizes k=|{i[n]:xi0}|. The parameter is k. Theorem 5.1 in [2] proves that for every prime p, the problem MLDp is W[1]-hard to approximate within any constant factor.

Intuitively, row i in Ax=b is a linear equation j=1naijxj=bj, where aij,bjp are coefficients and xj are variables. There is a straightforward way to subdivide long equations into ternary equations: for example, if we have an equation x1+x2+x3+x4=1, we can introduce auxiliary variables y1,y2,y3 and write

x1+x2y1=0,y1+x3y2=0,y2+x4y3=0andy3=1.

When summing up these equations, auxiliary variables cancel out and we obtain x1+x2+x3+x4=1. Using this trick, we encode the constraints implied by the row equations of Ax=b as crisp ternary and unary equations. To encode the objective function, i.e. the fact that we are minimizing the Hamming weight of x, we add soft equations xj=0 for all j[n]. This way, breaking a soft equation corresponds to increasing the Hamming weight by 1. This hardness result for Cp, with p prime, can be lifted into the general case via two simple steps: algebraic manipulations allow us to show hardness for Cpl, l1, and this implies hardness for Min-r-Lin(G) by recalling that G is a direct sum of cyclic groups of prime power order. We obtain the following due to the additive group of every ring being Abelian.

Theorem 16 ().

Let R be a non-trivial finite ring. Min-r-Lin(R) is W[1]-hard to FPT-approximate within any constant factor when r3.

We use Theorem 16 to demonstrate that there exist finite commutative rings such that Min-2-Lin(R) is W[1]-hard to FPT-approximate within any constant factor. Let R denote the 16-element polynomial ring 2[𝗑,𝗒]/(𝗑2,𝗒2), i.e. the ring with coefficients from 2 and indeterminates 𝗑,𝗒 with 𝗑2 and 𝗒2 factored out. An element rR is thus a sum r𝗎𝗇𝗂𝗍+rx𝗑+ry𝗒+rxy𝗑𝗒, where r𝗎𝗇𝗂𝗍,rx,ry,rxy2. The idea is to express equations of length 3 over 2 using equations of length 2 over R. We illustrate this by considering an equation a+b+c=0 over 2. To express it using binary equations over R, we introduce a fresh variable v and three equations (1) 𝗑v=𝗑𝗒b, (2) 𝗒v=𝗑𝗒a, and (3) (𝗑+𝗒)v=𝗑𝗒c. Summing up the first two equations, we obtain (𝗑+𝗒)v=𝗑𝗒(a+b). Together with the third one, this implies 𝗑𝗒(a+b+c)=0. On the other hand, any assignment that satisfies 𝗑𝗒(a+b+c)=0 can be extended as v=𝗑a+𝗒b to satisfy all three binary equations. With this in mind, it is not too difficult to prove the following with the aid of Theorem 16.

Theorem 17 ().

Min-2-Lin(R) is W[1]-hard to FPT-approximate within any constant factor when R=p[𝗑1,,𝗑k]/(𝗑12,,𝗑k2), p prime, and k2.

References

  • [1] Vikraman Arvind and T. C. Vijayaraghavan. The complexity of solving linear equations over a finite ring. In Proc. 22nd Annual Symposium on Theoretical Aspects of Computer Science (STACS-2005), pages 472–484, 2005. doi:10.1007/978-3-540-31856-9_39.
  • [2] Arnab Bhattacharyya, Édouard Bonnet, László Egri, Suprovat Ghoshal, Bingkai Lin, Pasin Manurangsi, and Dániel Marx. Parameterized intractability of even set and shortest vector problem. Journal of the ACM, 68(3):1–40, 2021. doi:10.1145/3444942.
  • [3] Ian F. Blake. Codes over certain rings. Information and Control, 20(4):396–404, 1972. doi:10.1016/S0019-9958(72)90223-9.
  • [4] Édouard Bonnet, László Egri, and Dániel Marx. Fixed-parameter approximability of Boolean MinCSPs. In Proc. 24th Annual European Symposium on Algorithms (ESA-2016), pages 18:1–18:18, 2016. doi:10.4230/LIPICS.ESA.2016.18.
  • [5] Rajesh Chitnis, Marek Cygan, MohammadTaghi Hajiaghayi, and Dániel Marx. Directed subset feedback vertex set is fixed-parameter tractable. ACM Transactions on Algorithms, 11(4):1–28, 2015. doi:10.1145/2700209.
  • [6] Konrad K. Dabrowski, Peter Jonsson, Sebastian Ordyniak, George Osipov, Marcin Pilipczuk, and Roohani Sharma. Parameterized complexity classification for interval constraints. In Proc. 18th International Symposium on Parameterized and Exact Computation (IPEC-2023), pages 11:1–11:19, 2023. doi:10.4230/LIPICS.IPEC.2023.11.
  • [7] Konrad K. Dabrowski, Peter Jonsson, Sebastian Ordyniak, George Osipov, and Magnus Wahlström. Towards a parameterized approximation dichotomy of mincsp for linear equations over finite commutative rings. CoRR, abs/2410.09932, 2024. doi:10.48550/arXiv.2410.09932.
  • [8] Konrad K. Dabrowski, Peter Jonsson, Sebastian Ordyniak, George Osipov, and Magnus Wahlström. Almost consistent systems of linear equations. In Proc. 34th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA-2023), pages 3179–3217, 2023. doi:10.1137/1.9781611977554.CH121.
  • [9] Anuj Dawar, Erich Grädel, Bjarki Holm, Eryk Kopczynski, and Wied Pakusa. Definability of linear equation systems over groups and rings. Logical Methods in Computer Science, 9(4), 2013. doi:10.2168/LMCS-9(4:12)2013.
  • [10] Reinhard Diestel. Graph Theory. Springer, Berlin, Heidelberg, 6th edition, 2025.
  • [11] Cunsheng Ding, Dingyi Pei, and Arto Salomaa. Chinese Remainder Theorem: Applications in Computing, Coding, Cryptography. World Scientific, 1996.
  • [12] Rodney G. Downey and Michael R. Fellows. Parameterized Complexity. Springer, 1999.
  • [13] Eduard Eiben, Clément Rambaud, and Magnus Wahlström. On the parameterized complexity of symmetric directed multicut. In Proc. 17th International Symposium on Parameterized and Exact Computation (IPEC-2022), pages 11:1–11:17, 2022. doi:10.4230/LIPICS.IPEC.2022.11.
  • [14] Andreas Emil Feldmann, Karthik C. S., Euiwoong Lee, and Pasin Manurangsi. A survey on approximation in parameterized complexity: Hardness and algorithms. Algorithms, 13(6):146, 2020. doi:10.3390/A13060146.
  • [15] Jörg Flum and Martin Grohe. Parameterized Complexity Theory. Springer, 2006. doi:10.1007/3-540-29953-X.
  • [16] Joseph F. Grcar. How ordinary elimination became Gaussian elimination. Historia Mathematica, 38(2):163–218, 2011.
  • [17] Venkatesan Guruswami, Bingkai Lin, Xuandi Ren, Yican Sun, and Kewen Wu. Parameterized inapproximability hypothesis under exponential time hypothesis. In Proc. 56th Annual ACM Symposium on Theory of Computing (STOC-2024), pages 24–35, 2024. doi:10.1145/3618260.3649771.
  • [18] Venkatesan Guruswami, Xuandi Ren, and Sai Sandeep. Baby PIH: parameterized inapproximability of MinCSP. In Proc. 39th Computational Complexity Conference (CCC-2024), pages 27:1–27:17, 2024. doi:10.4230/LIPICS.CCC.2024.27.
  • [19] Johan Håstad. Some optimal inapproximability results. Journal of the ACM, 48(4):798–859, 2001. doi:10.1145/502090.502098.
  • [20] Subhash Khot. On the power of unique 2-prover 1-round games. In Proc. 24th Annual ACM Symposium on Theory of Computing (STOC-2002), pages 767–775, 2002. doi:10.1145/509907.510017.
  • [21] Subhash Khot and Dana Moshkovitz. Candidate hard unique game. In Proc. 48th Annual ACM Symposium on Theory of Computing (STOC-2016), pages 63–76, 2016. doi:10.1145/2897518.2897531.
  • [22] Eun Jung Kim, Stefan Kratsch, Marcin Pilipczuk, and Magnus Wahlström. Flow-augmentation III: complexity dichotomy for boolean CSPs parameterized by the number of unsatisfied constraints. In Proc. 2023 ACM-SIAM Symposium on Discrete Algorithms (SODA-2023), pages 3218–3228, 2023. doi:10.1137/1.9781611977554.CH122.
  • [23] Vladimir Kolmogorov, Andrei A. Krokhin, and Michal Rolínek. The complexity of general-valued CSPs. SIAM Journal on Computing, 46(3):1087–1110, 2017. doi:10.1137/16M1091836.
  • [24] Stefan Kratsch and Magnus Wahlström. Representative sets and irrelevant vertices: New tools for kernelization. Journal of the ACM, 67(3):1–50, 2020. doi:10.1145/3390887.
  • [25] Daniel Lokshtanov, Pranabendu Misra, M. S. Ramanujan, Saket Saurabh, and Meirav Zehavi. FPT-approximation for FPT problems. In Proc. 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA-2021), pages 199–218, 2021. doi:10.1137/1.9781611976465.14.
  • [26] Daniel Lokshtanov, M. S. Ramanujan, Saket Saurab, and Meirav Zehavi. Parameterized complexity and approximability of directed odd cycle transversal. In Proc. 40th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA-2020), pages 2181–2200, 2020. doi:10.1137/1.9781611975994.134.
  • [27] Dániel Marx. Parameterized complexity and approximation algorithms. The Computer Journal, 51(1):60–78, 2008. doi:10.1093/COMJNL/BXM048.
  • [28] Dániel Marx and Igor Razgon. Fixed-parameter tractability of multicut parameterized by the size of the cutset. SIAM Journal on Computing, 43(2):355–388, 2014. doi:10.1137/110855247.
  • [29] Rolf Niedermeier. Invitation to Fixed-Parameter Algorithms. Oxford University Press, 2006. doi:10.1093/ACPROF:OSO/9780198566076.001.0001.
  • [30] George Osipov, Marcin Pilipczuk, and Magnus Wahlström. Parameterized complexity of MinCSP over the point algebra. In Proc. 32nd Annual European Symposium on Algorithms (ESA-2024), volume 308, pages 93:1–93:15, 2024. doi:10.4230/LIPICS.ESA.2024.93.
  • [31] George Osipov and Magnus Wahlström. Parameterized complexity of equality MinCSP. In Proc. 31st Annual European Symposium on Algorithms (ESA-2023), pages 86:1–86:17, 2023. doi:10.4230/LIPICS.ESA.2023.86.
  • [32] Prasad Raghavendra. Optimal algorithms and inapproximability results for every CSP? In Proc. 40th Annual ACM Symposium on Theory of Computing (STOC-2008), pages 245–254, 2008. doi:10.1145/1374376.1374414.
  • [33] Song Yan. Number Theory for Computing. Springer, 2002.