Manuscript Offprint
arXiv:2610.08207A Fast Algorithm for Maltsev Constraints
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
The constraint satisfaction problem over a set of relations (CSP( )) is the computational problem of deciding if a set of constraints admits at least one solution. The classical complexity for finite-domain CSP( ) is settled by the CSP dichotomy theorem: it is tractable if satisfies a non-trivial algebraic invariant and is NP-complete otherwise. However, not all these algebraic invariants result in efficient algorithms despite being theoretically tractable. A notable case that generalizes linear equations is that of Maltsev CSPs: an n-variable instance with m constraints is solvable in roughly time by Bulatov & Dalmau (SIAM J. Comput. 2006) or time by Dyer & Richerby (SIAM J. Comput. 2013). At the same time, arguably, most “natural” and efficiently usable polynomial-time algorithms rarely exceed a quadratic or cubic time bound. In this paper we revisit Maltsev constraints with this question in mind and find a algorithm (for finite languages, for infinite languages we in addition need to take the total size of the instance into account). The main novel idea is to not attempt to improve the bottleneck in Bulatov & Dalmau (the FIX-VALUES procedure) but to avoid it altogether with a slightly more refined approach that allows us to search through a smaller space.
1 Introduction
The constraint satisfaction problem over a set of relations (CSP( )) is the well-known computational problem of deciding if a set of constraints over admits at least one satisfying assignment. For finite domains the classical complexity is by now well understood: CSP( ) is tractable if satisfies a non-trivial algebraic condition [28, 12], and is NP-hard otherwise, by a gadget reduction from 3-SAT [10, 3]. There are, roughly speaking, two broad and natural classes of tractable CSPs: those solvable by local consistency methods, and those solvable by (algebraic generalizations of) Gaussian elimination [22]. While the algorithms of Bulatov [12] and Zhuk [28] handle certain involved combinations of local consistency and Gaussian elimination, the algorithms are complicated and are mainly intended as a proof of concept. Whether there is a simpler, unified algorithm is a topic of intense research for both CSP and its promise version [1, 6, 15, 18].
The limits and applications of simple but powerful local consistency algorithms such as (singleton) arc consistency are well understood [2, 22, 26]. The same is true for the reach of the algebraic generalization of linear equations, in the sense that the CSPs it solves are exactly characterized [4, 7, 24]. What is lacking on the latter side is efficiency: the known algorithms are polynomial but far from practical, and, unlike local consistency, are rarely used in practice. Towards defining the algebraic generalization of linear equations, first note that a system of linear equations (mod ) in variables satisfies the following algebraic invariant: for any three solutions the tuple (again, mod ) satisfies this system, too. This can be generalized to (coset) equations over a group where the corresponding operation guaranteed to preserve the solution space is . If one abstracts this further then the relevant property is a ternary operation such that
for any . Such an operation is called a Maltsev operation and if we require that each relation in is “preserved” by (see Section 2 for details) then we get a reasonable algebraic generalization of linear equations (Maltsev CSPs).
The celebrated result by Bulatov & Dalmau [7], the simple algorithm for Maltsev constraints, then solves every Maltsev CSP in polynomial time. In the sequel, let us abbreviate this algorithm by BD. It is conceptually simple and is built upon the idea that every relation preserved by a Maltsev operation has a small generating set (a compact representation). We then go through the constraints in the instance and for each , , assess its impact upon the solution space by constructing a compact representation of the solution space of . We then either detect an inconsistency (no solution can be represented) or output a compact representation of the solution space of . The main complication is to compute these compact representations efficiently. To see exactly where the complexity bottleneck in BD lies we thus need to define a few technical notions. For , a pair of tuples witnesses a triple if and agree on the first coordinates and , . The pair is sometimes called a fork of at coordinate [11]. The signature is the set of witnessed triples, so however large is. A representation of is a subset with , and it is compact if . The key fact is that a representation of a relation preserved by generates it under [7, Lemma 3.1]. BD then uses a procedure SOLVE that maintains a compact representation of the solution space of the first constraints . To update the current compact representation BD uses the procedure NEXT, which adds the constraint scope one coordinate at a time by calling the procedure NEXT-BETA. NEXT-BETA must find, for every in the signature of the new relation, two witnesses with a common prefix, and accomplishes this with two subroutines: NONEMPTY finds a tuple of whose projection onto given coordinates lies in a given relation, by closing the representation under , and FIX-VALUES takes a representation of and values and returns a compact representation of the tuples of whose first coordinates are . The second witness is found by NONEMPTY inside that representation. Thus, FIX-VALUES is called once for each of the triples (once per if its result is saved), and each call fixes up to coordinates, calling NONEMPTY times per coordinate. Bulatov and Dalmau do not make the polynomial explicit but Dalmau's technical report [16] bounds one coordinate step (with respect to a relation ) by and the algorithm by for a finite language with largest (in the sense of cardinality) relation .
The BD algorithm and various questions concerning Maltsev CSPs (and the related subpower membership problem) have been revisited several times in the literature in different contexts [17, 24, 4, 5, 27, 11, 25, 23, 8, 9, 19, 20, 13, 14]. Notably, Dyer and Richerby [21], in the context of simplifying the dichotomy for finite-domain counting CSPs, report an improvement of BD. They replace compact representations by (small) frames that describe (at most entries) tuples with a common prefix. Similar to a compact representation a frame generates R through applications of the Maltsev operation [21, Lemma 15]. Their update step avoids the worst redundancies of NONEMPTY (a closure procedure that considers each triple once, [21, Lemma 13]) and fixes a prefix in time [21, Corollary 17]. However, it still computes, for every prefix class at every coordinate, a frame of the tuples with that prefix, and then intersects with the constraint in question. For a fixed language and constant this gives per constraint and in total [21, Lemmas 19–20]. To the best of our knowledge this is still the best explicit bound for Maltsev CSPs. Furthermore, it runs into the exact same wall as BD: for each of about pairs (coordinate, value or class), one build a representation of the tuples of R with the corresponding prefix, and search inside it. A representation of a prefix class has up to (for a frame) or (for a compact representation) tuples of length n, so merely writing it down can cost . The cheapest known way of computing it costs [21, 25], which over classes gives
per constraint.
Our paper. In this paper we break the barrier with an obvious (in hindsight) but novel approach. Rather than attempting to speed up FIX-VALUES we avoid calling it in the first place. We first investigate what NEXT-BETA actually extracts from the tuples of with a given prefix, i.e., which values occur at the one position under consideration, and which of these tuples are compatible with the new constraint. Both questions depend only on the coordinates in position and in the scope of the constraint. So all that is needed is the projection of the prefix class onto these coordinates. This is a set of at most tuples (thanks to the coordinate-at-a-time idea of BD).
The question is how to get at this projection without going through the entire class. This turn out to be straightforward. The first property is a localised form of the generating lemma (i.e., that a relation can be generated from its compact representation with the Maltsev operation). Fix a tuple of with respect to some prefix, pick from the current compact representation (witnessing a fork at some position ), and consider moves of the form . There are roughly such maps. Because and agree before their position, a move never changes the first coordinates of , and we do not leave the prefix class. Because of the two identities defining a Maltsev operation, the moves reach every tuple of the class from . Thus the class is the set of tuples reachable from along specific applications of the Maltsev operation (that, importantly, follows immediately from the compact representation). Second, we apply these “moves” to projections (with respect to the current constraint and a fixed index). Hence, the reachability search can be done with breadth-first search on at most vertices with moves each. Whenever the search discovers a new projected tuple, we, as output, also store a full tuple of the class projecting to it, since this later is necessary to build the new representation. The same search, started from any tuple of and using all the moves, then yields the projection of all of .
One coordinate step therefore costs positions times a search that spends per object, i.e. . Summing over the constraints gives where is the size of the input. For a fixed, finite constraint language we obtain which matches Gaussian elimination.
This work naturally opens up corresponding questions for k-edge terms (of which Maltsev is the special case ) where the induced CSP is known to be solvable in time [24]. Several steps in our algorithm carries over and the exponent can plausibly be lowered. However, whether the exponent can actually reach is an intriguing open question.
2.1 Tuples, relations, and projections
For and write or for the th coordinate of and for the prefix induced by the first elements. If then we get the empty tuple . We write for the tuple with the first entry removed.
An index sequence is a sequence , , where repetition is allowed. The projection of a tuple with respect to is , and for , . We write for , and for and , (so for ). For we put , and for index sequences we write for their concatenation. In this context we make no difference between and . Hence, .
2.2 The constraint satisfaction problem and invariants
For finite a constraint satisfaction problem over is given by a set of variables and a set of constraints where is a -ary relation (for some ) and a tuple of variable indices (the scope). The question is whether there exists at least one satisfying assignment, that is, a function such that for each constraint . We often represent assignments by tuples and then satisfies the instance if for each constraint .
In this paper we are interested in a subclass of CSPs obtained by fixing a certain algebraic property. Let be an n-ary relation over . Then is said to be closed, or invariant, under a k-ary if
for each sequence (applied component-wise). The function is also called a polymorphism of . For a fixed operation one can then consider the CSP problem induced by (CSP(Inv(f))) where we for each constraint require that is closed under . We use the standard assumption that relations are represented by explicitly listing the tuples of relations.
The operation of special interest in this paper is a ternary operation that for all satisfy . Such an operation is said to be a Maltsev operation. We call a relation invariant under a Maltsev operation a Maltsev closed relation. For a fixed Maltsev operation we then want to solve the problem (“Maltsev CSP”).
Let be a Maltsev closed, k-ary relation, in an n-variable Maltsev CSP instance. Then we remark that for a constraint , , its solution set
is also Maltsev closed.
2.3 Signatures and representations
We borrow the following standard notions from Bulatov & Dalmau [7].
Definition 2.1 (signature). For ,
A pair as in the definition witnesses and is sometimes called a fork.
Note that if and only if , and that .
Definition 2.2 (representation). A representation of is a finite list of triples with , and , such that for every there is with and . We call the position of the triple and write
A triple witnesses the signature .
A representation is compact if no two of its triples witness the same signature, so that . In Bulatov & Dalmau [7] a (compact) representation of is a subset with (and ). The two notions are interchangeable: if is a representation in our sense then is one in theirs, and from one obtains by choosing one witnessing pair in for each signature. We keep the pairs explicit because it slightly simplifies the presentation of the algorithm.
3 The Algorithm
Throughout this section we assume that is a Maltsev operation over a fixed D. We introduce basic notation used in the algorithm and prove some elementary properties in Section 3.1, and present the actual algorithm in Section 3.2. We wrap up with a correctness proof and a complexity analysis in Section 4.
3.1 Basic notions and properties
For a relation , and let
be the set of tuples of whose first coordinates are fixed to . For , . We observe that if is invariant under then any fixation is invariant under , too (this follows from the fact that for every , i.e., it is idempotent).
Definition 3.1. For the move is . If is an index sequence of length and , the move on is called the projected move of along .
For a set of maps on a set and we write for the smallest subset of that contains and is closed under every , i.e., if and then . For a set of triples we write and, for an index sequence , for the set of projected moves of along . This allows us to use a set of triples as a set of maps whenever convenient.
The aim of the remainder of this section is now to recover parts of the compact representation machinery in Bulatov & Dalmau [7], somewhat specialized to our setting since we later (Section 3.2) apply it differently.
Lemma 3.2. Let be Maltsev closed, , and with . Then for every :
•
• for all ,
• if then .
Proof. The first statement holds because is Maltsev closed. For the second statement, for so . Last, .
Next, we obtain a simple but useful characterization of forks of the kind for fixed l and b.
Lemma 3.3. Let be Maltsev closed.
• If and with , then there is with and .
• For all , and with ,
Proof. First, let witness and put . Lemma 3.2 then gives , and .
Second, fix , and . For the direction: if , then by the first claim there is with , so . For the direction: if , pick with and ; then witnesses .
To foreshadow the algorithm in Section 3.2, assume that we are given a Maltsev closed n-ary relation with a representation , an index , a prefix , and let be any tuple of with this prefix. We will prove that can be obtained from by repeated applications of the form , where is a tuple obtained so far, and where is a triple of with . That a closed relation is generated by a compact representation is the basic fact behind the algorithms of Bulatov and Dalmau [7, 16] and the generalisation to few subpowers [24]. It is also used for the subpower membership problem [27, 11, 25]. Two things are different in our setting. First, we do not explicitly close a set under the ternary operation , instead we apply to a single tuple only the unary maps , where is taken from . Second, we use only the triples of at positions . Every tuple produced thus keeps the prefix of , and the closure never leaves . This is what allows us to explore without first computing a representation of it, which is the task of FIX-VALUES in [7, 16] and its analogues [24, 25].
Lemma 3.4. Let be a Maltsev closed relation with a representation . Let , and . Then .
Proof. For “”: it suffices to show that is closed under every , since . Let and . By Lemma 3.2 and for all . Hence, .
For “⊆”: let . We construct tuples such that, for each ,
For we simply take : it trivially lies in the closure and agrees with on the first coordinates because both and have prefix . For the step from to (where ), the tuples and both lie in (the closure is contained in by “ ”) and agree on , so the pair witnesses . Hence contains a triple with and , and because . Put , which lies in the closure. By Lemma 3.2 it agrees with on and has , i.e. it agrees with on the first coordinates. Finally, agrees with everywhere, so .
In particular we obtain the following corollary (by letting and be the empty tuple).
Corollary 3.5. If W is a representation of a Maltsev closed and , then .
However, the forthcoming algorithm never applies moves to full n-tuples when searching. Instead we apply the projected moves to projections onto a short index sequence (decided by one position and the scope of a constraint). The next, trivial, lemma says that this can be done without loss of generality. Hence, the closures of Lemma 3.4 can be computed on instead of on .
Lemma 3.6. Let I be an index sequence of length s and let . For all ,
Consequently, for and ,
and for every list V of triples, .
Proof. For any we have . The second equation follows by induction on .
The last lemma that we need is a simple statement involving repeated variables: if we have a k-ary constraint over variables (i.e., some variables are repeated) then we can construct an equivalent, -ary relation, that is also preserved by Maltsev. We omit the proof since it is trivial.
Lemma 3.7. Let , let be Maltsev closed, let list the distinct entries of in order of first occurrence, and let . Then is Maltsev closed, , and . Explicitly, consists of the tuples with whenever , each with its repeated positions deleted, and it is computed from in time .
3.2 The algorithm
We describe the algorithm in a style similar to the simple algorithm for Maltsev constraints (referred to as BD) by Bulatov & Dalmau [7]. See also Dyer & Richerby [21] from which some of our notation is borrowed. Throughout this section, is a finite set with elements, is, as usual, a Maltsev operation on , and an integer. A Maltsev CSP instance then consists of variables and constraints with (repetitions allowed) where each is Maltsev closed and represented by a list of tuples. The solutions to this instance are the with for all .
The algorithm uses the same idea as BD and maintains a compact representation of the set of assignments satisfying the constraints treated so far. Initially, , represented by the triples , where has at position and a fixed value elsewhere. When we pick a constraint then we thus need to produce a compact representation of from , and alone. A compact representation of then needs, for every , two tuples of with a common prefix before and values at . We can accomplish this as follows.
-
Let and . We first attempt to compute a tuple such that (we describe how to do this in the last item of this list). We will use this tuple to describe all possible forks of the form for .
-
If we let then we now want to describe the set , which by Lemma 3.3 equals .
-
Since , it is enough to generate and keep the tuples whose projection onto lies in . By Lemma 3.4, is obtained from the single tuple by repeatedly picking a tuple generated so far (initially only ) and a triple with , and forming . Since and agree on the first positions, this tuple again has prefix . Only the triples of at positions are thus used here.
-
Every tuple describes a possibly new element of , which in turn, if its projection onto Q lies in S, can be used to describe a fork with respect to . However, in this closure step, we only need to remember the values at position l and Q, and thus apply to the projection of x, a, to l and Q. One full n-tuple per new projected tuple is carried along (said to be “lifted”), since the witness needs to be an n-tuple and not a projected tuple.
-
To compute the tuples of the form we pick an arbitrary tuple and then explore the tuples reachable from with respect to (and any new tuples obtained in this way). When computing these Maltsev applications we, again, only need to worry about the values at index and since we after this search need to remove the tuples inconsistent with . However, since , we lift each projected tuple (over and ) to a full -ary tuple.
Similar to BD we avoid computing the above for directly and instead do it gradually over one more additional position in the constraint scope in each iteration. In this way we can bound the number of projected tuples to rather than . However, in contrast, BD compute a full compact representation of Fix (for all pairs ) with the procedure FIX-VALUES. This requires tuples of length , hence per pair and per coordinate step, regardless of how it is implemented ( with FIX-VALUES from Kompatscher [25], but in the analysis of [7], where NONEMPTY closes sets of full tuples under the ternary operation). In contrast, we never compute all of Fix . Step 4 computes its projection onto the positions , i.e. at most projected tuples, and each one is obtained by one pass over the at most triples of , plus one to “lift” a projected tuple to an -ary tuple. This is per pair, per coordinate step, and for a constraint of arity . The two factors are thus the possible positions , and the size of the compact representation .
With this description in mind we now turn to describing the different procedures in detail.
REACH. Given an index sequence of length , a list of triples and , REACH performs a breadth-first search from in the directed graph on whose edges are the projected moves , , and lifts every vertex it discovers to a full tuple with : whenever the projected move of leads from to a new vertex , the move itself is applied to to obtain . It plays the role of NONEMPTY in [7], but runs on projections.
Procedure REACH(I, V, u)
Input: an index sequence of length , a list of triples with , a tuple .
Output: a set and, for each , a tuple with , obtained from by applying moves with (Lemma 4.1).
Step 1. ; Queue .
Step 2. while Queue do
Step 1. remove the first element g of Queue;
Step 2. for each do: ; if then , add to and to the end of Queue.
Step 3. return .
NEXT-ONE. Given a representation of a closed and a constraint , NEXT-ONE computes a compact representation of , or reports that . It corresponds to NEXT- in BD but the calls to FIX-VALUES are replaced by calls to REACH with the list (Lemma 3.4).
Procedure NEXT-ONE(W, Q, S)
Input: a representation of a Maltsev closed relation , , a Maltsev closed relation .
Output: a compact representation of , or “empty”.
Step 1. if then return “empty”; otherwise pick any .
Step 2. for each do
Step 1. ;
Step 2. for each do: if there is with and then for one such , else .
Step 3. if for all then return “empty”.
Step 4. ; for each with do
Step 1. ;
Step 2. for each do: if there is with and then choose one such and add to .
Step 3. return .
NEXT. A constraint is processed one scope coordinate at a time (as in BD). This is what keeps every set G computed by REACH small (Lemma 4.5).
Procedure NEXT(W, Q, S)
Input: a representation of a Maltsev closed relation , a constraint , , where is Maltsev closed.
Output: a compact representation of , or “empty”.
Step 1. Compute and from as in Lemma 3.7; if then return “empty”; if then return W.
Step 2. for do
Step 1. ;
Step 2. if the result is “empty” then return “empty”.
Step 3. return W.
SOLVE. Fix and let be the tuple with at position and elsewhere.
Procedure SOLVE(I)
Input: an instance I with variables and constraints .
Output: “unsatisfiable”, or a solution and a compact representation of the set of solutions.
Step 1. the list of all .
Step 2. for do: ; if the result is “empty” then return “unsatisfiable”.
Step 3. return any tuple of , and W.
4 Correctness and Complexity
The correctness of the algorithm in Section 3.2 follows by similar arguments to Bulatov & Dalmau [7] and the basic lemmas established in Section 3.1. However, for completeness sake we analyze each procedure in detail, starting with REACH.
Lemma 4.1. Let be the output of REACH. Then , and and for every .
Proof. The search starts with and then explores the graph whose edges from lead to the vertices of the form , for . Thus, is the set of vertices reachable from , i.e. . For the second claim we induct on the order in which vertices are added. Initially, and . When is added, we set . This is included in since is, and . By Lemma 3.6, .
We continue with NEXT-ONE.
Theorem 4.2. Let be Maltsev closed, let be a representation of , let , let be Maltsev closed, and let . Then:
-
NEXT-ONE(W, Q, S) returns “empty” if and only if , and
-
otherwise it returns a compact representation of T.
Proof. First, T is clearly Maltsev closed. We first deal with the simple case, then describe what the two kinds of calls of REACH compute, and, finally, verify the two claims of the theorem.
If then , so every representation of is non-empty. Hence if then , so and “empty” is the correct answer. Assume from now on , so that a tuple can be chosen in Step 1 of NEXT-ONE. Note that since .
We continue with describing the searches from . Fix . By Corollary 3.5, , and projecting with Lemma 3.6 gives
So by Lemma 4.1 the call REACH((l, Q), W, w) in Step 2.1 returns
Consequently, the test in Step 2.2 succeeds for if and only if some has and . I.e., if and only if , and when it succeeds, the chosen lies in , has , hence lies in , and has .
Next, we describe the searches from . Fix some with and let . By the argument in the preceding paragraph, , so , and Lemma 3.4 gives , so by projecting with Lemma 3.6 and applying Lemma 4.1, the call in Step 4.1 returns
Hence, for , the test in Step 4.2 succeeds if and only if some has and , i.e. if and only if (the constraint does not involve the prefix, so ). By Lemma 3.3, applied to the closed set and to with , this is the case if and only if . When the test succeeds, the triple added to satisfies the following. Since , we have and . Moreover, and , so . Together with , : every triple in consists of two tuples of with a common prefix, witnessing , and for each at most one triple is added per .
We now wrap up as follows. For the first claim, if and only if , which holds if and only if for all , which is exactly when Step 3 returns “empty”. For the second claim, suppose and let . Then , so and by the previous paragraph Step 4.2 adds a triple with and . So every element of is witnessed in , every triple of witnesses an element of , and no element is witnessed twice. Hence, is a compact representation of .
We work our way through the procedures and prove correctness of NEXT.
Theorem 4.3. Let be Maltsev closed, a representation of , and a constraint where is Maltsev closed. Then returns “empty” if and only if , and otherwise returns a compact representation of .
Proof. Let be as in Lemma 3.7. Then is Maltsev closed and . Consider first the early exits in Step 1. If then and “empty” is correct. If then is empty and , so , , and returning is correct.
Thus, assume and , and for let
Then is simply . Further, , each is Maltsev closed, and because . We claim that whenever iteration of Step 2 starts, is a representation of , and that iteration returns “empty” if and only if . For , represents by assumption. If represents when iteration starts, then Theorem 4.2, applied to and the constraint , says that iteration returns “empty” if and only if is empty, and otherwise replaces by a compact representation of , from which iteration starts. This proves the claim. Since for every , an answer “empty” in any iteration is correct, and if no iteration returns “empty” then the final is a compact representation of .
Finally, we conclude the correctness proof with SOLVE.
Theorem 4.4. SOLVE returns “unsatisfiable” if and only if the instance has no solution. Otherwise the returned tuple is a solution and the returned W is a compact representation of the set of all solutions.
Proof. For let be the set of assignments satisfying the first constraints. So, , , each is Maltsev closed, and is the set of solutions. The initial list is a compact representation of (the same one as in [7]): , and for each the triple is its unique witness, as and agree before position . By induction on , using Theorem 4.3 for the step, as long as SOLVE has not stopped, after iteration of Step 2, is a compact representation of , and iteration returns “empty” if and only if . If some iteration returns “empty” then and the answer is correct. Otherwise , and is a compact representation of .
For the complexity, throughout, we have since we in each iteration produce a compact representation. The total cost of SOLVE is dominated by the calls of REACH, so we first bound the sets they explore.
Lemma 4.5. Let be Maltsev closed, a representation of , , , closed, and let satisfy . Then in every call of REACH made by NEXT-ONE( ) the returned set satisfies
Proof. By (2) and (3) in the proof of Theorem 4.2, in Step 2.1 and in Step 4.1. Since ,
which concludes the proof.
Lemma 4.6. A call with costs , and SOLVE runs in time .
Proof. Step 1 of NEXT costs (Lemma 3.7). Fix iteration j of Step 2, i.e. the call NEXT-ONE( ), and write for . Every vertex g handled by REACH is a tuple in , namely for some . Write it as with . By Lemma 4.5, . Fix an enumeration of . Then g is determined by the three numbers , the index i with , and , and we store g as this triple of numbers rather than as a -tuple. Consequently the set G can be kept as an array of bits, so membership in G is tested in constant time. Likewise, whether lies in is read off a table with one bit per pair , which is filled once per call of NEXT-ONE by running through , in time. Now consider a projected move applied to a vertex . It changes to and to ; this is two applications of . It changes to . This new middle part again lies in , since , , and is closed. It depends only on i and on the triple . We therefore compute it once for every i and every triple of W, and store its index in in a table. Each entry costs , so the table costs per call of NEXT-ONE. With the table, every projected move is applied in .
One call of REACH therefore inserts at most vertices, spends per inserted vertex on the lifted tuple , and per dequeued vertex on the scan of the list, which is . NEXT-ONE makes such calls in Step 2 and at most in Step 4, so one coordinate step costs , which absorbs the table. Summing over the coordinate steps gives the bound for NEXT, and summing over the constraints gives for SOLVE, where the initial list being absorbed since .
We combine the results in this sections and conclude our main result.
Theorem 4.7. Let be a Maltsev operation. Then an instance of CSP(Inv( )) with variables is solvable in time, where is the size of .
References
[1] L. Barto, J. Bulín, A. Krokhin, and J. Opršal. Algebraic approach to promise constraint satisfaction. Journal of the ACM, 68(4):28:1–28:66, 2021.
[2] L. Barto and M. Kozik. Constraint satisfaction problems solvable by local consistency methods. Journal of the ACM, 61(1):3:1–3:19, 2014.
[3] L. Barto, J. Opršal, and M. Pinsker. The wonderland of reflections. Israel Journal of Mathematics, 223:363–398, 2018.
[4] J. Berman, P. Idziak, P. Marković, R. McKenzie, M. Valeriote, and R. Willard. Varieties with few subalgebras of powers. Transactions of the American Mathematical Society, 362(3):1445–1473, 2010.
[5] M. Bodirsky and A. Moorhead. Conservative Maltsev constraint satisfaction problems, 2025. arXiv:2505.11395.
[6] J. Brakensiek, V. Guruswami, M. Wrochna, and S. Živný. The power of the combined basic LP and affine relaxation for promise CSPs. SIAM Journal on Computing, 49(6):1232–1248, 2020.
[7] A. Bulatov and V. Dalmau. A simple algorithm for mal'tsev constraints. SIAM Journal on Computing, 36(1):16–27, 2006.
[8] A. Bulatov and V. Dalmau. Towards a dichotomy theorem for the counting constraint satisfaction problem. Information and Computation, 205(5):651–678, 2007.
[9] A. Bulatov, V. Dalmau, M. Grohe, and D. Marx. Enumerating homomorphisms. Journal of Computer and System Sciences, 78(2):638–650, 2012.
[10] A. Bulatov, P. Jeavons, and A. Krokhin. Classifying the complexity of constraints using finite algebras. SIAM Journal on Computing, 34(3):720–742, 2005.
[11] A. Bulatov, P. Mayr, and Á. Szendrei. The subpower membership problem for finite algebras with cube terms. Logical Methods in Computer Science, 15(1), 2019.
[12] A. A. Bulatov. A dichotomy theorem for nonuniform CSPs. In Proceedings of the 58th IEEE Annual Symposium on Foundations of Computer Science (FOCS-2017), pages 319–330, 2017.
[13] C. Carbonnel. The meta-problem for conservative Mal’tsev constraints. In Proc. AAAI 2016, 2016.
[14] H. Chen and B. Larose. Asking the metaquestions in constraint tractability. ACM Transactions on Computation Theory, 9(3):11:1–11:27, 2017.
[15] L. Ciardo and S. Živný. CLAP: A new algorithm for promise CSPs. SIAM Journal on Computing, 52(1):1–37, 2023.
[16] V. Dalmau. Mal’tsev constraints made simple. Technical Report TR04-097, Electronic Colloquium on Computational Complexity, 2004.
[17] V. Dalmau. Generalized majority-minority operations are tractable. Logical Methods in Computer Science, 2(4:1), 2006.
[18] V. Dalmau and J. Opršal. Local consistency as a reduction between constraint satisfaction problems. Proc. LICS 2024, 2024.
[19] D. Delić and A. Habte. A new algorithm for constraint satisfaction problems with Maltsev templates, 2017. arXiv:1709.08311.
[20] D. Delić and A. Syed. Maltsev constraint satisfaction problems and deterministic logspace with counting, 2026. arXiv:2609.30757.
[21] M. Dyer and D. Richerby. An effective dichotomy for the counting constraint satisfaction problem. SIAM Journal on Computing, 42(3):1245–1274, 2013. arXiv:1003.3879.
[22] T. Feder and M. Y. Vardi. The computational structure of monotone monadic SNP and constraint satisfaction: a study through Datalog and group theory. SIAM Journal on Computing, 28(1):57–104, 1998.
[23] A. Gaysin. Proof complexity of Mal'tsev CSP, 2025. arXiv:2508.00396.
[24] P. Idziak, P. Marković, R. McKenzie, M. Valeriote, and R. Willard. Tractability and learnability arising from algebras with few subpowers. SIAM Journal on Computing, 39(7):3023–3037, 2010.
[25] M. Kompatscher. The subpower membership problem of 2-nilpotent algebras. In 41st International Symposium on Theoretical Aspects of Computer Science (STACS 2024), volume 289 of LIPIcs, pages 46:1–46:17, 2024.
[26] M. Kozik. Solving CSPs using weak local consistency. SIAM Journal on Computing, 50(4):1263–1286, 2021.
[27] P. Mayr. The subpower membership problem for Mal'cev algebras. International Journal of Algebra and Computation, 22(7):1250075, 2012.
[28] D. Zhuk. A proof of the CSP dichotomy conjecture. Journal of the ACM, 67(5):30:1–30:78, 2020.