arXiv:2609.07891cs.LOSep 2026

Manuscript Offprint

arXiv:2609.07891

Automatic constraints with few subpowers and graphoid recognition

Antonios Kalampakas

ANTONIOS KALAMPAKAS

ABSTRACT. Finite automata can describe relations of unbounded arity that are exponentially larger than their descriptions. We prove that constraint satisfaction for such relations is solvable in polynomial time whenever their length slices are preserved by a common fixed edge operation on a finite domain. The algorithm computes compact representations of the complete solution relation and its projections. Its main ingredient is a polynomial-time compilation of nondeterministic finite automata into the fork witnesses and small projections required by the few-subpowers algorithm. In the Mal'tsev case, a direct proof is polynomial also when the domain and operation table are supplied as input, answering the Mal'tsev tractability question for automatic constraint satisfaction. We also characterize all invariant relations of a family of 3-edge algebras with neither Mal'tsev nor near-unanimity terms. Their normal forms combine Boolean activity constraints with affine value spaces and yield canonical quadratic-bit representations constructible from NFAs or arbitrary generators. For graphoid automata, these results give polynomial-time recognition without a graph-width restriction, effective boundary composition, and comparison of finite graph relations. The quadratic boundary bounds are optimal in the worst case. A fixed three-state example separates polynomial-time recognition from hard exact counting.

1. INTRODUCTION

A relation given by a finite automaton may contain exponentially many tuples of a specified length. This succinctness is useful for constraints on long sequences, but it prevents a direct application of algorithms whose running time is polynomial in the number of allowed tuples. The representation of a constraint must therefore be considered together with its algebraic structure.

Compact representations provide one way to make that connection. Bulatov and Dalmau proved tractability of finite-domain constraints preserved by a Mal'tsev operation by maintaining small sets of tuples with prescribed fork witnesses [BD06]. Dalmau extended this approach to generalized majority-minority operations [Dal06]. The few-subpowers algorithm of Idziak, Marković, McKenzie, Valeriote, and Willard applies whenever the constraint language has an edge polymorphism [IMM⁺10]. In these algorithms, the complete solution relation can be represented by polynomially many tuples even when it contains exponentially many solutions. Applying the algorithms to a new input representation requires an effective construction of the particular witnesses that their invariants demand.

We show that nondeterministic finite automata supply these witnesses directly. Two accepted words witness a fork at a coordinate when they agree before that coordinate and have prescribed letters there. A synchronous product of two copies of the automaton finds all possible common prefixes. Independent accepting suffixes then complete the witnesses.

Key words and phrases. constraint satisfaction, finite automata, few subpowers, Mal'tsev operations, graphoid automata.

A. KALAMPAKAS

Bounded coordinate projections are obtained by layered reachability with prescribed letters. These two elementary constructions compile an automaton into an exact compact representation whenever its relevant length slice is closed under the given edge operation.

The resulting algorithm solves instances with arbitrarily many automaton-described constraints, unbounded arities, and repeated variables in constraint scopes. It computes the full solution relation in compact form and permits ordered projections with repeated coordinates. For a fixed domain with an ℓ\ell-edge operation, a relation on kk output coordinates is represented by O(kℓ−1)O(k^{\ell-1}) tuples. For Mal'tsev operations, the representation uses O(k)O(k) tuples and O(k2)O(k^2) bits. The Mal'tsev algorithm is also polynomial when the finite domain and the full operation table are part of the input, under the promise that the operation preserves the supplied relations.

This result addresses a question raised in the recent work of Gong, Wang, Khoussainov, and Bulatov on automatic constraint satisfaction [GWKB26]. They establish tractability for several algebraic classes of automatic languages, including the Boolean affine and near-unanimity cases. Section 9 of their preprint asks whether a Mal'tsev polymorphism suffices. Their model uses explicit variable scopes and relations obtained by intersecting a regular language with a specified power of a finite domain. Our Mal'tsev theorem gives an affirmative answer in this model, and the edge-operation theorem extends the conclusion to all fixed finite algebras with few subpowers.

Earlier work of Chen and Grohe studies the effect of succinct relation descriptions on CSP complexity [CG06, CG10]. Their work motivates the need for algorithms measured in the size of the description. Here the essential interface with the algebraic algorithm consists of fork witnesses and witnesses for bounded projections. These are more informative than an arbitrary small generating set. The distinction is also central to the subpower membership problem [BMS19]. Our construction starts from an automaton for the relation itself and does not require a procedure that converts arbitrary algebraic generators into a compact representation.

For a particular family of 3-edge algebras, we obtain a sharper representation by describing all invariant relations explicitly. The domain consists of a prime field together with an inactive state. Each relation is determined by a Boolean majority-closed relation on its activity bits and a compatible affine space of values. The compatibility forces a decomposition into an affine factor on always-active coordinates and independent linear factors on classes with a common variable activity. This normal form has a canonical O(k2)O(k^2)-bit encoding, computable from either an NFA or arbitrary generators, and supports a direct calculus using 2-SAT and Gaussian elimination. The family has neither a Mal'tsev term nor a near-unanimity term, and the quadratic bound is optimal.

Short definitions provide a related measure of representation size. Bulín and Kompatscher prove quadratic-length pp-definitions for three-element 3-edge languages [BK26, Corollary 4.7] and ask whether short definitions can be computed efficiently from generators [BK26, Question 6.3]. Our normal form gives an explicit construction for the displayed family over every prime field. The structural characterization and the NFA and generator conversions refine the existence bound in this case. Mixed majority and affine examples with short definitions also occur in [BK26, Example 6.1], following [Bra25, Example 2.3.2].

Our motivating application is the recognition problem for graphoid automata [BK04, BK08]. In their canonical unitary relational interpretation, a graph imposes local constraints on its vertices, while its ordered input and output boundaries carry regular word constraints.

The theorem gives polynomial-time recognition when these relations share an edge polymorphism, without a restriction on graph width. It also gives an effective calculus of boundary summaries: serial composition, parallel composition, and identification of boundary vertices can be performed directly on compact representations. The Mal'tsev case and the prime-field family admit optimal quadratic-bit boundary encodings. For a fixed transition alphabet associated with the latter family, the normal form also constructs a graph with quadratically many vertices and edges defining the same boundary relation.

The general compilation theorem and the explicit normal form are the two main contributions. For general edge operations, the calculus of compact representations is established machinery, which we state with attribution. We include a direct proof of the Mal'tsev case to exhibit the equality updates needed for unbounded scopes and to obtain the semiuniform result. Finally, a three-element example shows that the recognition theorem does not imply tractable exact counting. Its hardness follows from the weighted Boolean counting dichotomy of Dyer, Goldberg, and Jerrum [DGJ09].