An adaptive prefix-assignment technique for symmetry reduction

This paper presents a technique for symmetry reduction that adaptively assigns a prefix of variables in a system of constraints so that the generated prefix-assignments are pairwise nonisomorphic under the action of the symmetry group of the system. The technique is based on McKay's canonical extension framework [J. Algorithms 26 (1998), no. 2, 306-324]. Among key features of the technique are (i) adaptability - the prefix sequence can be user-prescribed and truncated for compatibility with the group of symmetries; (ii) parallelisability - prefix-assignments can be processed in parallel independently of each other; (iii) versatility - the method is applicable whenever the group of symmetries can be concisely represented as the automorphism group of a vertex-colored graph; and (iv) implementability - the method can be implemented relying on a canonical labeling map for vertex-colored graphs as the only nontrivial subroutine. To demonstrate the tentative practical applicability of our technique we have prepared a preliminary implementation and report on a limited set of experiments that demonstrate ability to reduce symmetry on hard instances.

The associative and commutative symmetries of disjunction and conjunction induce symmetries between the variables of (1), a fact that can be captured by stating that the group Γ generated by the two permutations (x 1 x 2 )(x 3 x 4 )(x 5 x 6 ) and (x 4 x 6 ) consists of all permutations of the variables that map (1) to itself. That is, Γ is the automorphism group of the system (1), cf. Sect. 2. Known symmetry in a constraint system is a great asset from the perspective of solving the system, in particular since symmetry enables one to disregard partial solutions that are isomorphic to each other under the action of Γ on the space of partial solutions. Techniques for such isomorph rejection 1 [42] (alternatively, symmetry reduction or symmetry breaking) are essentially mandatory if one desires an exhaustive traversal of the (pairwise nonisomorphic) solutions of a highly symmetric system of constraints, or if the system is otherwise difficult to solve, for example, with many "dead-end" partial solutions compared with the actual number of solutions.
A prerequisite to symmetry reduction is that the symmetries are known. In many cases it is possible to automatically discover and compute these symmetries to enable practical and automatic symmetry reduction. In this context the dominant computational approach for combinatorial systems of constraints is to represent Γ via the automorphism group of a vertex-colored graph that captures the symmetries in the system. Carefully engineered tools for working with symmetries of vertexcolored graphs [15,27,35,37] and permutation group algorithms [10,40] then enable one to perform symmetry reduction. For example, for purposes of symmetry computations we may represent (1) as the following vertex-colored graph: (2) x 1 x 2 x 3 x 4 x 5 x 6 x 1x2x3x4x5x6 x 1 ∨ x 2 x 1 ∨x 3 ∨x 5 x 2 ∨x 4 ∨x 6 In particular, the graph representation (2) enables us to discover and reduce symmetry to avoid redundant work when solving the underlying system (1).
1.2. Our contribution. The objective of this paper is to document a novel technique for symmetry reduction on systems of constraints. The technique is based on adaptively assigning values to a prefix of the variables so that the obtained prefixassignments are pairwise nonisomorphic under the action of Γ. The technique can be seen as an instantiation of McKay's [36] influential canonical extension framework for isomorph-free exhaustive generation.
To give a brief outline of the technique, suppose we are working with a system of constraints over a finite set U of variables that take values in a finite set R. Suppose furthermore that Γ ≤ Sym(U ) is the automorphism group of the system. Select k distinct variables u 1 , u 2 , . . . , u k in U . These k variables form the prefix sequence considered by the method. The technique works by assigning values in R to the variables of the prefix, in prefix-sequence order, with u 1 assigned first, then u 2 , then u 3 , and so forth, so that at each step the partial assignments so obtained are pairwise nonisomorphic under the action of Γ. For example, in (1) the partial assignments x 1 → 0, x 2 → 1 and x 1 → 1, x 2 → 0 are isomorphic since (x 1 x 2 )(x 3 x 4 )(x 5 x 6 ) ∈ Γ maps one assignment onto the other; in total there are three nonisomorphic assignments to the prefix x 1 , x 2 in (1), namely (i) x 1 → 0, x 2 → 0, (ii) x 1 → 0, x 2 → 1, and (iii) x 1 → 1, x 2 → 1. Each partial assignment that represents an isomorphism class can then be used to reduce redundant work when solving the underlying system by standard techniques-in the nonincremental case, the system is augmented with a symmetry-breaking predicate requiring that one of the nonisomorphic partial assignments holds, while in the incremental setting [22,43] the partial assignments can be solved independently or even in parallel.
Our contribution in this paper lies in how the isomorph rejection is implemented at the level of isomorphism classes of partial assignments by careful reduction to McKay's [36] isomorph-free exhaustive generation framework. The key technical contribution is that we observe how to generate the partial assignments in a normalized form that enables both adaptability (that is, the prefix u 1 , u 2 , . . . , u k can be arbitrarily selected to match the structure of Γ) and precomputation of the extending variable-value orbits along a prefix.
Among further key features of the technique are: (1) Implementability. The technique can be implemented by relying on a canonical labeling map for vertex-colored graphs (cf. [27,35,37]) as the only nontrivial subroutine that is invoked once for each partial assignment considered.
(2) Versatility. The method is applicable whenever the group of symmetries can be concisely represented as a vertex-colored graph; cf. (1) and (2). This is useful in particular when the underlying system has symmetries that are not easily discoverable from the final constraint encoding, for example, due to the fact that the constraints have been compiled or optimized 2 from a higher-level representation in a symmetry-obfuscating manner. A graphical representation can represent such symmetry directly and independently of the compiled/optimized form of the system. (3) Parallelisability. As a corollary of implementing McKay's [36] framework, the technique does not need to store representatives of isomorphism classes in memory to perform isomorph rejection, which enables easy parallelisation since the partial assignments can be processed independently of each other.
The main technical contribution of this paper is developed in Sect. 4 where we present the prefix-assignment technique. The required mathematical preliminaries on symmetry and McKay's framework are reviewed in Sects. 2 and 3, respectively. Our development in Sect. 4 relies on an abstract group Γ, with the understanding that a concrete implementation can be designed e.g. in terms of a vertex-colored graph representation, as will be explored in Sect. 5.

Preliminary implementation and experiments.
To demonstrate the tentative practical applicability of our technique we have prepared a preliminary experimental implementation. 3 The implementation is structured as a preprocessor that works with an explicitly given graph representation and utilizes the nauty [35,37] canonical labeling software for vertex-colored graphs as a subroutine to prepare an exhaustive collection of nonisomorphic prefix assignments relative to a user-supplied or heuristically selected prefix of variables. In Sect. 6 we report on a limited set of experiments with solving systems of Boolean polynomial equations that demonstrate the ability to reduce symmetry on hard instances and give an initial favorable comparison with earlier techniques.
1.4. Earlier work. A classical way to exploit symmetry in a system of constraints is to augment the system with so-called symmetry-breaking predicates (SBP) that eliminate either some or all symmetric solutions [5,14,19,39]. Such constraints are typically lexicographic leader (lex-leader) constraints that are derived from a generating set for the group of symmetries Γ. Among recent work in this area, Devriendt et al. [16] extend the approach by presenting a more compact way for expressing SBPs and a method for detecting "row interchangeabilities". Itzhakov and Codish [26] present a method for finding a set of symmetries whose corresponding lex-leader constraints are enough to completely break symmetries in search problems on small (10-vertex) graphs; this approach is extended by Codish et al. [12] by adding pruning predicates that simulate the first iterations of the equitable partition refinement algorithm of nauty [35,37]. Heule [23] shows that small complete symmetry-breaking predicates can be computed by considering arbitrary Boolean formulas instead of lex-leader formulas. Our present technique can be seen as a method for producing symmetry-breaking predicates by augmenting the system of constraints with the disjunction of the nonisomorphic partial assignments. The main difference to the related work above is that our technique does not produce the symmetry-breaking predicate from a set of generators for Γ but rather the predicate is produced recursively, and with the possibility for parallelization, by classifying orbit representatives up to isomorphism using McKay's [36] framework. As such our technique breaks all symmetry with respect to the prescribed prefix, but comes at the cost of additional invocations of graph-automorphism and canonical-labeling tools. This overhead and increased symmetry reduction in particular means that our technique is best suited for constraint systems with hard combinatorial symmetry that is not easily capturable from a set of generators, such as symmetry in combinatorial classification problems [28]. In addition to McKay's [36] canonical extension framework, other standard frameworks for isomorph-free exhaustive generation in this context include orderly algorithms due to Faradžev [18] and Read [38], as well as the homomorphism principle for group actions due to Kerber and Laue [30].
It is also possible to break symmetry within a constraint solver during the search by dynamically adding constraints that rule out symmetric parts of the search space (cf. [11,19] and the references therein). If we use the nonisomorphic partial assignments produced by our technique as assumption sequences (cubes) in the incremental cube-and-conquer approach [22,43], our technique can be seen as a restricted way of breaking the symmetries in the beginning of the search, with the benefitas with cube-and-conquer-that the portions of the search space induced by the partial assignments can be solved in parallel, either with complete independence or with appropriate sharing of information (such as conflict clauses) between the parallel nodes executing the search.

Preliminaries on group actions and symmetry
This section reviews relevant mathematical preliminaries and notational conventions for groups, group actions, symmetry, and isomorphism for our subsequent development. (Cf. [10,17,25,28,29,40] for further reference.) 2.1. Groups and group actions. Let Γ be a finite group and let Ω be a finite set (the domain) on which Γ acts. For two groups Λ and Γ, let us write Λ ≤ Γ to indicate that Λ is a subgroup of Γ. We use exponential notation for group actions, and accordingly our groups act from the right. That is, for an object X ∈ Ω and γ ∈ Γ, let us write X γ for the object in Ω obtained by acting on X with γ. Accordingly, we have X (βγ) = (X β ) γ for all β, γ ∈ Γ and X ∈ Ω. For a finite set V , let us write Sym(V ) for the group of all permutations of V with composition of mappings as the group operation.
2.2. Orbit and stabilizer, the automorphism group. For an object X ∈ Ω let us write X Γ = {X γ : γ ∈ Γ} for the orbit of X under the action of Γ and Γ X = {γ ∈ Γ : X γ = X} ≤ Γ for the stabilizer subgroup of X in Γ. Equivalently we say that Γ X is the automorphism group of X and write Aut(X) = Γ X whenever Γ is clear from the context; if we want to stress the acting group we write Aut Γ (X).
2.3. Isomorphism. We say that two objects are isomorphic if they are on the same orbit of Γ in Ω. In particular, X, Y ∈ Ω are isomorphic if and only if there exists an isomorphism γ ∈ Γ from X to Y that satisfies Y = X γ . An isomorphism from an object to itself is an automorphism. Let us write Iso(X, Y ) for the set of all isomorphisms from X to Y . We have that Iso(X, Y ) = Aut(X)γ = γAut(Y ) where γ ∈ Iso(X, Y ) is arbitrary. Let us write X ∼ = Y to indicate that X and Y are isomorphic. If we want to stress the group Γ under whose action isomorphism holds, we write X ∼ =Γ Y .

Elementwise action on tuples and sets.
Suppose that Γ acts on two sets, Ω and Σ. We extend the action to the Cartesian product Ω × Σ elementwise by defining (X, S) γ = (X γ , S γ ) for all (X, S) ∈ Ω×Σ and γ ∈ Γ. Isomorphism extends accordingly; for example, we say that (X, S) and (Y, T ) are isomorphic and write (X, S) ∼ = (Y, T ) if there exists a γ ∈ Γ with Y = X γ and T = S γ . Suppose that Γ acts on a set U . We extend the action of Γ on U to an elementwise action of Γ on subsets W ⊆ U by setting W γ = {w γ : w ∈ W } for all γ ∈ Γ and W ⊆ U . In what follows we will tacitly work with these elementwise actions on tuples and sets unless explicitly otherwise indicated.
2.5. Canonical labeling and canonical form. A function κ : Ω → Γ is a canonical labeling map for the action of Γ on Ω if For X ∈ Ω we say that X κ(X) is the canonical form of X in Ω. From (K) it follows that isomorphic objects have identical canonical forms, and the canonical labeling map gives an isomorphism that takes an object to its canonical form. We assume that the act of computing κ(X) for a given X produces as a side-effect a set of generators for the automorphism group Aut(X).

McKay's canonical extension method
This section reviews McKay's [36] canonical extension method for isomorph-free exhaustive generation. Mathematically it will be convenient to present the method so that the isomorphism classes are captured as orbits of a group action of a group Γ, and extension takes place in one step from "seeds" to "objects" being generated, with the understanding that the method can be applied inductively in multiple steps so that the "objects" of the current step become the "seeds" for the next step. For completeness and ease of exposition, we also give a correctness proof for the method. We stress that all material in this section is well known. (Cf. [28].)

Objects and seeds.
Let Ω be a finite set of objects and let Σ be a finite set of seeds. Let Γ be a finite group that acts on Ω and Σ. Let κ be a canonical labeling map for the action of Γ on Ω.
3.2. Extending seeds to objects. Let us connect the objects and the seeds by means of a relation e ⊆ Ω × Σ that indicates which objects can be built from which seeds by extension. For X ∈ Ω and S ∈ Σ we say that X extends S and write XeS if (X, S) ∈ e. We assume the relation e satisfies (E1) e is a union of orbits of Γ, that is, e Γ = e (invariance), and (E2) for every object X ∈ Ω there exists a seed S ∈ Σ such that XeS (completeness).
For a seed S ∈ Σ, let us write e(S) = {X ∈ Ω : XeS} for the set of all objects that extend S.

Canonical extension.
We associate with each object a particular isomorphisminvariant extension by which we want to extend the object from a seed. A function That is, (M1) requires that X is in fact an extension of M (X) and (M2) requires that isomorphic objects have isomorphic canonical extensions. In particular, X → (X, M (X)) is a well-defined map from Ω/Γ to e/Γ.

3.4.
Generating objects from seeds. Let us study the following procedure, which is invoked for exactly one representative S ∈ Σ from each orbit in Σ/Γ: (P) Let S ∈ Σ be given as input. Iterate over all X ∈ e(S). Perform zero or more isomorph rejection tests on X and S. If the tests indicate we should accept X, visit X. Let us first consider the case when there are no isomorph rejection tests. Lemma 1. The procedure (P) visits every isomorphism class of objects in Ω at least once.
Proof. To see that every isomorphism class is visited, let Y ∈ Ω be arbitrary. By (E2), there exists a T ∈ Σ with YeT . By our assumption on how procedure (P) is invoked, T is isomorphic to a unique S such that procedure (P) is invoked with input S. Let γ ∈ Γ be an associated isomorphism with S γ = T . By (E1) and YeT , we have XeS for X = Y γ −1 . By the structure of procedure (P) we observe that X is visited and X ∼ = Y . Since Y was arbitrary, all isomorphism classes are visited at least once.
Let us next modify procedure (P) so that any two visits to the same isomorphism class of objects originate from the same procedure invocation. Let M : Ω → Σ be a canonical extension map. Whenever we construct X by extending S in procedure (P), let us visit X if and only if (T1) (X, S) ∼ = (X, M (X)).
Lemma 2. The procedure (P) equipped with the test (T1) visits every isomorphism class of objects in Ω at least once. Furthermore, any two visits to the same isomorphism class must (i) originate by extension from the same procedure invocation on input S, and (ii) belong to the same Aut(S)-orbit of this seed S.
Proof. Suppose that X is visited by extending S and Y is visited by extending T , with X ∼ = Y . By (T1) we must thus have (X, S) ∼ = (X, M (X)) and Thus, (X, S) ∼ = (Y, T ) and hence S ∼ = T . Since S ∼ = T , we must in fact have S = T by our assumption on how procedure (P) is invoked. Since X and Y were arbitrary, any two visits to the same isomorphism class must originate by extension from the same seed. Furthermore, we have (X, S) ∼ = (Y, S) and thus X ∼ = Aut(S) Y . Let us next observe that every isomorphism class of objects is visited at least once. Indeed, let Y ∈ Ω be arbitrary.
, so (T1) holds and X is visited. Since X ∼ = Y and Y was arbitrary, every isomorphism class is visited at least once.
Let us next observe that the outcome of test (T1) is invariant on each Aut(S)orbit of extensions of S. Proof. From X ∼ = X α and (M2) we have (X, M (X)) ∼ = (X α , M (X α )). Thus, Lemma 3 in particular implies that we obtain complete isomorph rejection by combining the test (T1) with a further test that ensures complete isomorph rejection on Aut(S)-orbits. Towards this end, let us associate an arbitrary order relation on every Aut(S)-orbit on e(S). Let us perform the following further test: (T2) X = min X Aut(S) . The following lemma is immediate from Lemma 2 and Lemma 3.
Lemma 4. The procedure (P) equipped with the tests (T1) and (T2) visits every isomorphism class of objects in Ω exactly once.

3.5.
A template for canonical extension maps. We conclude this section by describing a template of how to use an arbitrary canonical labeling map κ : Ω → Γ to construct a canonical extension map M : Ω → Σ.
For X ∈ Ω construct the canonical form Z = X κ(X) . Using the canonical form Z only, identify a seed T with ZeT . In particular, such a seed must exist by (E2). (Typically this identification can be carried out by studying Z and finding an appropriate substructure in Z that qualifies as T . For example, T may be the minimum seed in Σ that satisfies ZeT . Cf. Lemma 9.) Once T has been identified, set M (X) = T κ(X) −1 .

Generation of partial assignments via a prefix sequence
This section describes an instantiation of McKay's method that generates partial assignments of values to a set of variables U one variable at a time following a prefix sequence at the level of isomorphism classes given by the action of a group Γ on U . Let R be a finite set where the variables in U take values. 4.1. Partial assignments, isomorphism, restriction. For a subset W ⊆ U of variables, let us say that a partial assignment of values to W is a mapping X : W → R. Isomorphism for partial assignments is induced by the following group action. 4 Let γ ∈ Γ act on X : W → R by setting X γ : .
Proof. We observe that for the identity ∈ Γ of Γ we have X = X. Furthermore, for all γ, β ∈ Γ and u ∈ W γβ = (W γ ) β we have For an assignment X : W → R, let us write X = W for the underlying set of variables assigned by X. Observe that the underline map is a homomorphism of group actions in the sense that X γ = X γ holds for all γ ∈ Γ and X : W → R. For Q ⊆ X, let us write X| Q for the restriction of X to Q.

4.2.
The prefix sequence and generation of normalized assignments. We are now ready to describe the generation procedure. Let us begin by prescribing the prefix sequence. Let u 1 , u 2 , . . . , u k be k distinct elements of U and let U j = {u 1 , u 2 , . . . , u j } for j = 0, 1, . . . , k. In particular we observe that For j = 0, 1, . . . , k let Ω j consist of all partial assignments X : W → R with W ∼ = U j . Or what is the same, using the underline notation, Ω j consists of all partial assignments X with X ∼ = U j .
We rely on canonical extension to construct exactly one object from each orbit of Γ on Ω j , using as seeds exactly one object from each orbit of Γ on Ω j−1 , for each j = 1, 2, . . . , k. We assume the availability of canonical labeling maps κ : Ω j → Γ for each j = 1, 2, . . . , k.
Our construction procedure will work with objects that are in a normal form to enable precomputation for efficient execution of the subsequent tests for isomorph rejection. Towards this end, let us say that X ∈ Ω j is normalized if X = U j . It is immediate from our definition of Ω j and (3) that each orbit in Ω j /Γ contains at least one normalized object.
Let us begin with a high-level description of the construction procedure, to be followed by the details of the isomorph rejection tests and a proof of correctness. 4 For conciseness and accessibility, the present conference version develops the method only for variable symmetries, and accordingly the group action (3) acts only on the variables in U and not on the values in R. However, the method does extend to capture symmetries on both variables in U and values in R (essentially by consideration of the Cartesian product U × R in place of U ), and such an extension will be developed in a full version of this paper.
Fix j = 1, 2, . . . , k and study the following procedure, which we assume is invoked for exactly one normalized representative S ∈ Ω j−1 from each orbit in Ω j−1 /Γ: (P') Let a normalized S ∈ Ω j−1 be given as input. For each p ∈ u Aut(Uj−1) j and each r ∈ R, construct the assignment defined by X(p) = r and X(u) = S(u) for all u ∈ U j−1 . Perform the isomorph rejection tests (T1') and (T2') on X and S. If both tests accept, visit X ν(p) where ν(p) ∈ Aut(U j−1 ) normalizes X.
From an implementation point of view, it is convenient to precompute the orbit u Aut(Uj−1) j together with group elements ν(p) ∈ Aut(U j−1 ) for each p ∈ u Aut(Uj−1) j that satisfy p ν(p) = u j . Indeed, a constructed X with X = U j−1 ∪ {p} can now be normalized by acting with ν(p) on X to obtain a normalized X ν(p) isomorphic to X.

The isomorph rejection tests.
Let us now complete the description of procedure (P') by describing the two isomorph rejection tests (T1') and (T2'). This subsection only describes the tests with an implementation in mind, the correctness analysis is postponed to the following subsection.
Let us assume that the elements of U have been arbitrarily ordered and that κ : Ω j → Γ is a canonical labeling map. Suppose that X has been constructed by extending a normalized S with X = S ∪ {p} = U j−1 ∪ {p}. The first test is: (T1') Subject to the ordering of U , select the minimum q ∈ U such that q κ(X) −1 ν(p) ∈ u Aut(Uj ) j . Accept if and only if p ∼ = Aut(X) q κ(X) −1 .
From an implementation perspective we observe that we can precompute the orbit u Aut(Uj ) j . Furthermore, the only computationally nontrivial part of the test is the computation of κ(X) since we assume that we obtain generators for Aut(X) as a side-effect of this computation. Indeed, with generators for Aut(X) available, it is easy to compute the orbits U/Aut(X) and hence to test whether p ∼ = Aut(X) q κ(X) −1 .
Let us now describe the second test: (T2') Accept if and only if p = min p Aut(S) subject to the ordering of U .
From an implementation perspective we observe that since S is normalized we have Aut(S) ≤ Aut(S) = Aut(U j−1 ) and thus the orbit u Aut(Uj−1) j considered by procedure (P') partitions into one or more Aut(S)-orbits. Furthermore, generators for Aut(S) are readily available (due to S itself getting accepted in the test (T1') at an earlier level of recursion), and thus the orbits u Aut(Uj−1) j /Aut(S) and their minimum elements are cheap to compute. Thus, a fast implementation of procedure (P') will in most cases execute the test (T2') before the more expensive test (T1').

Correctness.
We now establish the correctness of procedure (P') together with the tests (T1') and (T2') by reduction to McKay's framework and Lemma 4. Fix j = 1, 2, . . . , k. Let us start by defining the extension relation e ⊆ Ω j × Ω j−1 for all X ∈ Ω j and S ∈ Ω j−1 by setting XeS if and only if (4) there exists a γ ∈ Γ such that X γ = U j , S γ = U j−1 , and X γ | Uj−1 = S γ .
This relation is well-defined in the context of McKay's framework: The relation (4) satisfies (E1) and (E2).
Proof. From (4) it is immediate that (E1) holds. Furthermore, (E2) holds because for an arbitrary X ∈ Ω j there exists a γ ∈ Γ with X γ = U j , and thus XeS holds for S = T γ −1 , where T is obtained from Y = X γ by deleting the assignment to the variable u j .
The following lemma establishes that the iteration in procedure (P') constructs exactly the objects X ∈ e(S); cf. procedure (P). Proof. From (4) we have that XeS if and only if there exists a γ ∈ Γ with X γ = U j , S γ = U j−1 , and X γ | Uj−1 = S γ . Since S is normalized, we have S = U j−1 and hence U γ j−1 = S γ = U j−1 . Thus, γ ∈ Aut(U j−1 ) and Thus, to establish the "only if" direction of the lemma, take p = u γ −1 j , and for the "if" direction, take γ ∈ Aut(U j−1 ) with p γ = u j .
Next we show the correctness of the test (T1') by establishing that it is equivalent with the test (T1) for a specific canonical extension function M . Towards this end, let us use the assumed canonical labeling map κ : Ω j → Γ to build a canonical extension function M using the template of Lemma 5. In particular, given an X ∈ Ω j as input with X = U j−1 ∪ {p}, first construct the canonical form Z = X κ(X) . In accordance with (T1'), select the minimum q ∈ U such that q κ(X) −1 ν(p) ∈ u Aut(Uj ) j . Now construct M (X) from X by deleting the value of q κ(X) −1 . Proof. Since Aut(Z) ≤ Aut(Z) and Z κ(X) −1 ν(p) = U j , we have It follows that the choice of q depends on Z and u j but not on the choices of κ(X) or ν(p). Furthermore, we observe that q ∈ Z and q κ(X) −1 ∈ X. Thus, the construction of M (X) is well-defined and (M2) holds by Lemma 5.
It remains to establish the equivalence of (T2') and (T2). We start with a lemma that captures the Aut(S)-orbits considered by (T2).
Lemma 10. For a normalized S ∈ Ω j−1 the orbits in e(S)/Aut(S) are in a oneto-one correspondence with the elements of (u Aut(Uj−1) j /Aut(S)) × R.
Proof. From (3) we have Aut(S) ≤ Aut(S) = Aut(U j−1 ) since S is normalized. Furthermore, Lemma 8 implies that every extension X ∈ e(S) is uniquely determined by the variable p ∈ u Aut(Uj−1) j ∩ X and the value X(p) ∈ R. Since the action (3) fixes the values in R elementwise, for any X, X ∈ e(S) we have X ∼ = Aut(S) X if and only if both p ∼ = Aut(S) p and X(p) = X (p ). The lemma follows. Now order the elements X ∈ e(S) based on the lexicographic ordering of the pairs (p, X(p)) ∈ u Aut(Uj−1) j × R. Since the action (3) fixes the values in R elementwise, we have that (T2') holds if and only if (T2) holds for this ordering of e(S). The correctness of procedure (P') equipped with the tests (T1') and (T2') now follows from Lemma 4.

4.5.
Selecting a prefix. This section gives a brief discussion on how to select the prefix. Let U k = {u 1 , u 2 , . . . , u k } be the set of variables in the prefix sequence. It is immediate that there exist |R| k distinct partial assignments from U k to R. Let us write R U k for the set of these assignments. The group Γ now partitions R U k into orbits via the action (3), and it suffices to consider at most one representative from each orbit to obtain an exhaustive traversal of the search space, up to isomorphism. Our goal is thus to select the prefix U k so that the setwise stabilizer Γ U k has comparatively few orbits on R U k compared with the total number of such assignments. In particular, the ratio of the number of orbits |R U k /Γ U k | to the total number of mappings |R| k can be viewed as a proxy for the achieved symmetry reduction and as a rough 5 proxy for the speedup factor obtained compared with no symmetry reduction at all. 4.6. Subroutines. By our assumption, the canonical labeling map κ produces as a side-effect a set of generators for the automorphism group Aut(X) for a given input X. We also assume that generators for the groups Aut(U j ) for j = 0, 1, . . . , k can be precomputed by similar means. This makes the canonical labeling map essentially the only nontrivial subroutine needed to implement procedure (P'). Indeed, the orbit computations required by tests (T1') and (T2') are implementable by elementary permutation group algorithms [10,40]. The next section describes how to implement κ by reduction to vertex-colored graphs. 6

Representation using vertex-colored graphs
This section describes one possible approach to represent the group of symmetries Γ ≤ Sym(U ) of a system of constraints over a finite set of variables U taking values 5 Here it should be noted that executing the symmetry reduction carries in itself a nontrivial computational cost. That is, there is a tradeoff between the potential savings in solving the system gained by symmetry reduction versus the cost of performing symmetry reduction. For example, if the instance has no symmetry and Γ is a trivial group, then executing symmetry reduction merely makes it more costly to solve the system. 6 Reduction to vertex-colored graphs is by no means the only possibility to obtain the canonical labeling map to enable (P'), (T1'), and (T2'). Another possibility would be to represent Γ directly as a permutation group and use dedicated permutation-group algorithms [33,34]. Our present choice of vertex-colored graphs is motivated by easy availability of carefully engineered implementations for working with vertex-colored graphs.
in a finite set R. Our representation of choice will be vertex-colored graphs over a fixed finite set of vertices V . In particular, isomorphisms between such graphs are permutations γ ∈ Sym(V ) that map edges onto edges and respect the colors of the vertices; that is, every vertex in V maps to a vertex of the same color under γ. It will be convenient to develop the relevant graph representations in steps, starting with the representation of the constraint system and then proceeding to the representation of setwise stabilizers and partial assignments. These representations are folklore (see e.g. [28]) and are presented here for completeness of exposition only.
5.1. Representing the constraint system. To capture Γ ∼ = Aut(G) via a vertexcolored graph G with vertex set V , it is convenient to represent the variables U directly as a subset of vertices U ⊆ V such that no vertex in V \ U has a color that agrees with a color of a vertex in U . We then seek a graph G such that Aut(G) ≤ Sym(U ) × Sym(V \ U ) projected to U is exactly Γ. In most cases such a graph G is concisely obtainable by encoding the system of constraints with additional vertices and edges joined to the vertices representing the variables in U . We discuss two examples.
Example 1. Consider the system of clauses (1) and its graph representation (2). The latter can be obtained as follows. First, introduce a blue vertex for each of the six variables of (1). These blue vertices constitute the subset U . Then, to accommodate negative literals, introduce a red vertex joined by an edge to the corresponding blue vertex representing the positive literal. These edges between red and blue vertices ensure that positive and negative literals remain consistent under isomorphism. Finally, introduce a green vertex for each clause of (1) with edges joining the clause with each of its literals. It is immediate that we can reconstruct (1) from (2) up to labeling of the variables even after arbitrary color-preserving permutation of the vertices of (2). Thus, (2) represents the symmetries of (1).
Let us next discuss an example where it is convenient to represent the symmetry at the level of original constraints rather than at the level of clauses.
Example 2. Consider the following system of eight cubic equations over 24 variables taking values modulo 2: x 11 y 11 z 11 + x 12 y 12 z 12 + x 13 y 13 z 13 = 0 x 21 y 11 z 11 + x 22 y 12 z 12 + x 23 y 13 z 13 = 0 This system seeks to decompose a 2 × 2 × 2 tensor (whose elements appear on the right hand sides of the equations) into a sum of three rank-one tensors. The symmetries of addition and multiplication modulo 2 imply that the symmetries of the system can be represented by the following vertex-colored graph: x11  x12  x13  x21  x22  x23  y11  y12  y13  y21  y22  y23  z11  z12  z13  z21  z22 z23 Indeed, we encode each monomial in the system with a product-vertex, and group these product-vertices together by adjacency to a sum-vertex to represent each equation, taking care to introduce two uniquely colored constant-vertices to represent the right-hand side of each equation.
Remark. The representation built directly from the system of polynomial equations in Example 2 concisely captures the symmetries in the system independently of the final encoding of the system (e.g. as CNF) for solving purposes. In particular, building the graph representation from such a final CNF encoding (cf. Example 1) results in a less compact graph representation and obfuscates the symmetries of the original system, implying less efficient symmetry reduction.

Representing the values.
In what follows it will be convenient to assume that the graph G contains a uniquely colored vertex for each value in R. (Cf. the graph in Example 2.) That is, we assume that R ⊆ V \U and that Aut(G) projected to R is the trivial group.

5.3.
Representing setwise stabilizers in the prefix chain. To enable procedure (P') and the tests (T1') and (T2'), we require generators for Aut(U j ) ≤ Γ for each j = 0, 1, . . . , k. More generally, given a subset W ⊆ U , we seek to compute a set of generators for the setwise stabilizer Aut Γ (W ) = Γ W = {γ ∈ Γ : W γ = W }, with W γ = {w γ : w ∈ W }. Assuming we have available a vertex-colored graph G that represents Γ by projection of Aut Sym(V ) (G) to U , let us define the graph G ↑ W by selecting one vertex r ∈ R and joining each vertex w ∈ W with an edge to the vertex r. It is immediate that Aut Sym(V ) (G ↑ W ) projected to U is precisely Aut Γ (W ).

5.4.
Representing partial assignments. Let X : W → R be an assignment of values in R to variables in W ⊆ U . Again to enable procedure (P') together with the tests (T1') and (T2'), we require a canonical labeling κ(X) and generators for the automorphism group Aut(X). Again assuming we have a vertex-colored graph G that represents Γ, let us define the graph G ↑ X by joining each vertex w ∈ W with an edge to the vertex X(w) ∈ R. It is immediate that Aut Sym(V ) (G ↑ X) projected to U is precisely Aut Γ (X). Furthermore, a canonical labeling κ(X) can be recovered from κ(G ↑ X) and the canonical form (G ↑ X) κ(G↑X) .

5.5.
Using tools for vertex-colored graphs. Given a vertex-colored graph G as input, practical tools exist for computing a canonical labeling κ(G) ∈ Sym(V ) and a set of generators for Aut(G) ≤ Sym(V ). Such tools include bliss [27], nauty [35,37], and traces [37]. Once the canonical labeling and generators are available in Sym(V ) it is easy to map back to Γ by projection to U so that corresponding elements of Γ are obtained.

Preliminary experimental evaluation
This section documents a preliminary and limited experimental evaluation of an implementation of the adaptive prefix-assignment technique. The implementation is written in C and structured as a preprocessor that works with an explicitly given graph representation and utilizes the nauty [35,37] canonical labeling software for vertex-colored graphs as a subroutine.
6.1. Instances. We study systems of polynomial equations aimed at discovering the tensor rank of a small m × m × m tensor T = (t ijk ) modulo 2, with t ijk ∈ {0, 1} and i, j, k = 1, 2, . . . m. Computing the rank of a given tensor is NP-hard [21]. 7 In precise terms, we seek to find the minimum r such that there exist three m × r matrices A, B, C ∈ {0, 1} m×r such that for all i, j, k = 1, 2, . . . , m we have Such instances are easily compilable into CNF with A, B, C constituting three matrices of Boolean variables so that the task becomes to find the minimum r such that the compiled CNF instance is satisfiable. Independently of the target tensor T such instances have a symmetry group of order at least r! due to the fact that the columns of the matrices A, B, C can be arbitrarily permuted so that (5) maps to itself. In our experiments we select the entries of T uniformly at random so that the number of 1s in T is exactly n.

6.2.
Hardware and software configuration. The experiments were performed on a cluster of Dell PowerEdge C4130 compute nodes, each equipped with two Intel Xeon E5-2680v3 CPUs and 128 GiB of main memory, running Linux version 3.10.0514.10.2.el7.x86 64. All experiments were executed by allocating a single core on a single CPU of a compute node. Other unrelated compute load was in general present on the nodes during the experiments. A time-out of five hours of CPU time was applied. 6.3. Symmetry reduction tools and SAT solvers. We report on three methods for symmetry reduction on aforementioned tensor-rank instances: (1) no reduction ("raw"), (2) breakid version 2.2 [16], (3) our technique ("reduce") with a user-selected prefix consisting of 2r variables that constitute the first two rows of the matrix A, and a graph representation of (5) as in Example 2. Three different SAT solvers were used in the experiments: lingeling and ilingeling version bbc-9230380 [7], and glucose version 4.1 [6]. We use the incremental solver ilingeling together with the incremental CNF output of reduce.
6.4. Results. Table 1 shows the results of a tensor rank computation modulo 2 for two random tensors T with m = 5, n = 16 and m = 5, n = 18. In both cases we observe that the rank is 9. The running times displayed in the table are in seconds, with "t/o" indicating a time-out. For both tensors we observe decreased running time due to symmetry reduction, with reduce performing better than breakid, but also taking more time to perform the preprocessing (indicated in columns labelled Remark. We would like to highlight that the comparison between reduce and breakid in particular illustrates the relevance of a graph representation of the symmetries in (5), which are not easily discoverable from the compiled CNF. In our experiments reduce receives as input the graph representation of the system (5) constructed as in Example 2, whereas breakid works on the compiled CNF input alone.