Abstract 1 Introduction 2 Preliminaries 3 Related Work 4 The one permutation problem 5 PLS-Hardness 6 Realizing the permutations in propositional formula 7 Conclusion and open questions References

PLS-Completeness of String Permutations

Dominik Scheder ORCID TU Chemnitz, Germany Johannes Tantow ORCID TU Chemnitz, Germany
Abstract

Bitstrings can be permuted via permutations and compared via the lexicographic order. In this paper we study the complexity of finding a minimum of a bitstring via given permutations. As finding a global optimum is known to be NP-complete [1], we study the local optima via the class PLS[8] and show hardness for PLS. Additionally, we show that even for one permutation the global optimization problem is NP-complete and give a formula that has these permutation as its symmetries. This answers an open question inspired from Kołodziejczyk and Thapen [9] and stated at the SAT and interactions seminar in Dagstuhl [14].

Keywords and phrases:
PLS, total search problems, local search, permutation groups, symmetry
Copyright and License:
[Uncaptioned image] © Dominik Scheder and Johannes Tantow; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Problems, reductions and completeness
Related Version:
Full Version: https://arxiv.org/abs/2505.02622
Acknowledgements:
We want to thank Neil Thapen for introducing the problem to us.
Editors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman

1 Introduction

Given a string 𝐱{0,1}n and a couple of permutations in Sn, we can apply a permutation to 𝐱 and obtain a new bit string. What is the lexicographically smallest string we can obtain this way? This problem is known [1] to be NP-hard. What about finding a local minimum, i.e., arriving at a bit string that cannot be further improved by a single application of a permutation? In this paper, we show that this problem is PLS-complete.
To be more formal, we are given a string 𝐱{0,1}n and permutations π1,,πm on the set [n]. When we view 𝐱 as a function [n]{0,1}, the notation 𝐱π makes sense and is the string obtained from 𝐱 by permuting the coordinates according to π. By π1,,πm we denote the subgroup of S[n] generated by the πi. The problem k-Permutation Global Orbit Minimum asks for the ππ1,,πk such that 𝐱π is lexicographically minimal. Babai and Luks [1] showed that this is NP-hard even for k=2. In fact, we will see that it is NP-hard even for k=1, i.e., a single permutation.

k-Permutation Local Orbit Minimum asks for a local minimum. That is, an element ππ1,,πk such that

𝐱πlex𝐱ππi for all 1ik,

i.e., a single application of a permutation πi cannot further improve the string 𝐱π.
A local optimum always exists and hence this is an instance of a total search problem. Total search problems where solutions are recognizable in polynomial time form the class TFNP. Total search problems that can be stated as finding a local optimum with respect to a certain cost function and a neighborhood relation constitute the subclass PLS (polynomial local search). Known hard problems for PLS include finding a pure Nash-equilibrium in a congestion game[4] or finding a locally optimal max cut (LocalMaxCut) [13]. Almost all known PLS-complete problems require quite involved cost functions. Our problem k-Permutation Local Orbit Minimum has the benefit of using the possibly simplest cost function - the lexicographic ordering. The only other PLS-complete problem using a lexicographic cost function that we know of is FLIP, which asks to minimize the m-bit output of a circuit C, where the solutions are all n-bit inputs and the neighborhood relation is defined by flipping a single bit.

Thus, our result unifies two desirable properties - our PLS-complete problem is very combinatorial in nature (in contrast to FLIP) and uses a very simple cost function (in contrast to LocalMaxCut)

1.1 SAT Solving and Symmetry Breaking

When encoding a combinatorial problem as a CNF formula F (think of “is there a k-Ramsey graph on n vertices?”), the formula will often contain many symmetries. To make the problem easier for SAT solvers, one can take the statement

The satisfying assignment α should be a local lexicographical minimum with respect to those symmetries,

encode it as a CNF formula G and feed FG to the SAT solver. Clearly, FG is satisfiable if and only if F is. In case that FG is unsatisfiable, SAT solvers are often expected to produce a proof of unsatisfiability. A popular proof system used in this context is DRAT [15]. However, it is not known to what extend DRAT can handle symmetry breaking [7], that is, whether a short DRAT-refutation of FG can be transformed into a short DRAT-refutation of F. In this context, Thapen [14] asked whether there exists a polynomial algorithm that, given a CNF formula F, a handful of symmetries thereof, and a satisfying assignment α, finds a satisfying assignment β that is a local lexicographical minimum with respect to those symmetries. In this paper, we show that this problem is PLS-complete, which is evidence that such a polynomial time algorithm might not exist.

2 Preliminaries

2.1 Total search problems and PLS

The class FNP is the functional correspondent of NP. TFNP FNP is the subset of total search problems, i.e., problems that always have a solution. As this is a semantic class, TFNP has no known complete problems, and thus it is usually studied via its subclasses. These subclasses are based on the combinatorial principle that proves the existence of a solution. These principles include the existence of sinks in directed acyclic graphs (PLS)[8], the parity argument for directed and undirected graphs (PPAD, PPA) or the pigeonhole principle (PPP) (all introduced in [11]). Nonetheless, not all problems in TFNP can be categorized in one of the known subclasses, Factoring being a prime example.

By the above characterization, PLS requires finding a sink of a directed acyclic graph G. This would be possible in polynomial time if G was given explicitly. Instead, G is always given implicitly via a circuit that computes the successor list of a given node. To make sure that G is acyclic, we have a second circuit computing a topological ordering, that is, a “cost” function that is strictly decreasing along the edges. A solution to the problem is a sink of G or an edge (u,v) with cost(u)cost(v), i.e., violating the decreasing cost condition. This guarantees the totality of the problem.

An alternative definition is the following. For a PLS problem P we have a set of instances I. Each instance iI has a set of feasible solutions S (e.g. for the Euclidean traveling salesman problem the solutions are exactly the Hamilton cycles of Kn). Additionally, we require the following polynomial-time computable algorithms (usually given as circuits):

  1. 1.

    an algorithm that decides whether a given s is a feasible solution.

  2. 2.

    an algorithm that computes a starting solution sS

  3. 3.

    an algorithm that computes for a feasible solution s the neighborhood N(s)

  4. 4.

    an algorithm that computes for a solution s the cost cost(s)

A feasible solution s is a local minimum if cost(s)cost(s) for all sN(s). The definition is given for a minimization problem, but can be also defined in terms of a maximization problem.

We can easily transform this into a directed acyclic graph by keeping only those neighbors in N(s) having strictly smaller cost–or even keeping only the one neighbor sN(s) of minimal cost (breaking ties arbitrarily).

Similar to NP, there is also a hardness structure in PLS. Let P and Q be two problems in PLS. P reduces to Q via a PLS-reduction (f,g) for functions f and g such that f maps an instance I from P to an instance f(I) of Q and g maps a solution s of f(I) to a solution g(I,s) of P so that if s is a local minimum in f(I) then also g(I,s) is a local minimum in I. This was defined in [8] and the first natural PLS-complete problem is FLIP. There solutions are n-bit strings, the cost is calculated by a given circuit C and the neighborhood are all n-bit strings with a Hamming distance of 1.

The obvious greedy algorithm to find a solution for a PLS-problem is as follows: Use the given algorithms to compute the start solution and always select the best neighbor until there is no better solution. This solution is called the standard solution and the algorithm the standard algorithm. For the problem FLIP, finding the standard solution for a given start solution is PSPACE-complete[12, Lemma 4].

Reductions that preserve the PSPACE-completeness are called tight[13]. For this, we consider the transition graph TG(I) of an instance I of the problem P, that has a directed edge from each feasible solution x to all of its neighbors N(x).

A PLS-reduction (f,g) from P to Q is called tight if for every instance I of P there exists a set of feasible solutions for f(I) such that

  1. 1.

    contains all local optima of f(I)

  2. 2.

    For every solution s of I it is possible to construct in polynomial time a feasible solution t such that g(I,t)=s

  3. 3.

    If the transition graph of TG(f(I)) contains a path from q to q such that both q and q are in and all other intermediate nodes are not in , let p=g(I,q) and p=g(I,q) be the corresponding solutions in P. Then either p=p or there is an arc from p to p in TG(I).

An interesting subclass of PLS is CLS that is supposed to capture continuous local search problems. Recently, it was shown that CLS = PLS PPAD[5].

2.2 Permutation groups

A permutation of a set V is a bijection π:VV. For permutations π1,,πk, we denote by π1,,πk the subgroup of SV generated by the πi. Checking membership ππ1,,πk is non-trivial but can be done in polynomial time [6, Section 1].

3 Related Work

Many problems are known to be PLS-complete, whose reductions mostly start from FLIP. An influential reduction technique was used by Krentel [10] to show that finding a local minimum of a weighted CNF-formula is PLS-complete. The idea is to have multiple copies of the circuit, so called test circuits that precompute the effects of a flip. This idea is pushed further in [13] in order to show that finding a local minimum for weighted positive NAE(not all equal) 3-SAT is PLS-complete, and this is used to show that other problems as finding a LocalMaxCut or finding a stable configurations of Hopfield networks are PLS-complete.

Other direct reductions from FLIP are used in [4] to show that finding a pure Nash equilibrium in an asymmetric network congestion game is PLS-complete and in [3] to show that maximum constraint assignment, a generalization of CNF-SAT, is PLS-complete. These reductions are especially of interest to us as FLIP is to the best of our knowledge the only problem in PLS with lexicographical weights and hence needed for our reduction.

Numerous optimization problems on permutation groups given via generators π1,,πk are studied in [2]. These include finding a ππ1,,πk that minimizes ΣiVc(i,π(i)) for some cost function c:V2. All these problems are shown to be NP-complete via a reduction from finding a fixed-point free permutation, which is shown to be NP-complete.

Our problem has previously been studied in [1], but there the interest was in global optima. This was proven to be NP-hard even for abelian groups.

4 The one permutation problem

We start our investigation by studying the special case that k=1, i.e., we have only one generator π1 and our subgroup is π1. In this case one can efficiently find a local optimum[9, Section 8.2]. We show this with a different algorithm again. In contrast, we will show that surprisingly finding a global optimum is NP-complete. To the best of our knowledge, this has only been known for two permutations [1].

4.1 Finding a local optimum

The problem is efficiently solvable when k=1, i.e., we are only given a single permutation π. We describe a different way of solving it in contrast to [9]. We can transform π into the cycle notation and annotate each element with the bit that it is mapped to by the string 𝐱{0,1}n. We call a cycle interesting if 𝐱 is non-constant on it. Additionally, we identify each cycle with its smallest member.

Consider the permutation (1 2 5)(3 4)(7 8) and the string 001001 depicted in Figure 1. We color an element green if it is mapped to zero and orange if it is mapped to one by the string. The left cycle is the cycle of 1 and not interesting whereas the other two are which are identified by 3 and 7.

Figure 1: An example of the scenario for one permutation π.

The permutation has no effect on elements on non-interesting cycles. Due to the cost function, lower indices are more costly than higher indices. We look for the interesting cycle that contains the position with the least index among all interesting cycles and let l be the smallest index on it. There are indices i and j:=π(i) on this cycle with xi=0 and xj=1. Let k be such that πk(l)=i. Then 𝐱πk has a 0 at position i but 𝐱πk+1 has a 1. In other words, 𝐱πk is a local optimum

In example in Figure 1 we have x=3, j=4 and d=1. The local optimal permutation is hence π.

4.2 Finding a global optima

Theorem 1 ([1]).

2-Permutation Global Orbit Minimum is NP-hard.

This follows via a reduction from Independent Set where we encode a graph as a bit string, one bit per potential edge, and the permutations basically allow us to move the vertices of the independent set I to the front, generating a large prefix of (|I|2) many 0’s.

Since 1-Permutation Local Orbit Minimum was so clearly solvable in polynomial time (even by the greedy algorithm), it comes as a surprise that global optimization, even for one permutation, is NP-hard:

Theorem 2.

1-Permutation Global Orbit Minimum is NP-hard.

We will define an intermediate NP-complete problem called Disjunctive Chinese Remainder, short DCR. For two numbers t,m and a set S, we write

tSmodm

to state that tsmodm for all sS. Now in the DCR decision problem, we are given moduli m1,,ml and sets of “forbidden remainders” S1,,Sl with Simi:={0,1,,mi1}. All numbers are given in unary and the moduli are not required to be pairwise co-prime. DCR asks for a solution t of the system

t Simodmii=1,,l.

This is clearly in NP: if there is a solution x, then there is one with 0tlcm(m1,m2,ml) and thus t has polynomially many bits in binary. Verifying that this t is a solution can now be done by division with remainder.

Lemma 3.

DCR is NP-complete.

Proof.

We reduce from 3-Colorability. Given a graph G=(V,E) with |V|=n, we let 3=p1,p2,,pn be the first n prime numbers greater than 2. By the prime number theorem, pn is polynomial in n, thus the pi can be found in polynomial time by a brute force search using naive prime number testing.

We let N=p1p2pn and define the following function from N to 3-colorings of the vertices V: given a number 0tN1, the corresponding coloring ct:V{r,g,b} is defined by

ct(vi) ={r if t0modpig if t1modpib else.

By the Chinese Remainder Theorem, this is a surjective function and thus every 3-coloring can be encoded by one single number 0xN1. For an edge e={u,v}, we write a constraint that makes sure that u and v receive different colors. For each pair (a,b)pu×pv with (a,b)=(0,0) or (a,b)=(1,1) or a2,b2, we compute the unique number cpuqv with camodpu and cbmodqv. Let Se be the set of all numbers c thus constructed, set me:=pupv and write the constraint

xSemodme. (1)

If e is the ith edge of the graph, we set mi=pupv and Si=Se. We see that x satisfies (1) if and only if x encodes a properly colors edge e.

Lemma 4.

DCR reduces to 1-Permutation Global Orbit Minimum.

Proof.

Given an instance of DCR  we set M=m1+m2++ml and define a permutation π on [M] that has l disjoint cycles, one of length mi for each i. We label the elements of the ith cycle consecutively with the numbers 0,,mi1. We define a bit string 𝐱{0,1}M that has exactly one 1 in each cycle, placed on the element that has label 0. The orbit element 𝐱πt still has exactly one 1 in cycle i, but now at the vertex labeled t mod mi.

For each cycle i, let Fi be the elements on it whose labels are in the set Si of forbidden remainders and let F:=F1Fl. We order the elements of [M] such that the elements of F come first. There exists a solution t to the DCR instance if and only if the string 𝐱πt has no 1 in any position in F.

5 PLS-Hardness

We now state and prove our main result:

Theorem 5.

k-Permutation Local Orbit Minimum is PLS-complete.

In order to view it as a PLS-problem we have an instance I consisting of the permutations π1,..,πk and the string s{0,1}N. Solutions are permutations from π1,πk as we can efficiently recognize whether permutations are in the group generated by π1,..,πk. The start solution is the identity. Neighbors of π are permutations ππi for i{1,k}. The cost of a permutation π is i=1Ns(π(i))2Ni, where s(π(i)) is the digit of the position that i is mapped to by π. All these can be computed in polynomial time, hence the problem is in PLS.

A solution π is cheaper than a solution σ for a string s if there is an integer i such that for all j<i we have that s(σ(j))=s(π(j)) and s(π(i))<s(σ(i)) as the cost is a geometric sum.

We can turn the minimization problem into a maximization problem by inverting the string.

5.1 High-level idea

We reduce from the PLS-complete problem FLIP. This problem is especially suitable since it uses a lexicographic cost function, too. Formally FLIP is defined as follows:

Definition 6.

An instance of FLIP consists of a circuit C with n inputs and m outputs. Feasible solutions are all input assignments, i.e., the set {0,1}n. The cost of a solution 𝐱 is the output of C(𝐱){0,1}m. Two solutions are neighbors if they differ in a single bit. The cost function is defined by reading the output as a number in binary; in other words, by the lexicographic order on {0,1}m. We are asked to find a solution whose cost is minimal among all its neighbors.

We use an idea by Krentel[10] and have n+1 copies C0,C1,,Cn of the circuit C, where C0 is fed as an input 𝐱 and Ci is fed as an input 𝐱𝐞i, i.e., 𝐱 with the i-th bit flipped. The setup is depicted in Figure 2.

The permutation group consists of two types of permutations. The first kind πij simulates flipping the output of gate i in circuit j; we allow for gates and hence circuits to be temporarily evaluated incorrectly. The input and output of a gate are not saved anywhere but syntactically built into the permutations and string. An exception is the input and output of the circuit, which we save for later usage. We use some positions as very important control bits to ensure that the correct evaluation is always possible.

The second type of permutation σj swaps the circuit 0 with the circuit j and flips the j-th input bit for all other circuits. This simulates a step in the FLIP-problem.

Figure 2: A high level overview of the reduction.

5.2 Definition of the reduction

We assume without loss of generality that the circuit C consists only of NAND-gates. Additionally, we assume that no input is directly passed to an output, i.e. on every path from an input to an output, there is at least one gate.

We will now describe the set V of positions, the permutations in SV, and how strings in {0,1}V, called assignments, correspond to the circuits C0,,Cn computing their values on an input 𝐱 and its neighbors 𝐱𝐞i. We face two main challenges:

  1. 1.

    We need an operation of the form “flip bit i”, but permutations can only permute positions, not flip bits. We solve this by replacing position i by two positions i0,i1 and encoding [yi=0] by [yi0=0,yi1=1] and [yi=1] by [yi0=1,yi1=0]. Flipping bit i then corresponds to the permutation that swaps i0 and i1, i.e., the transposition (i0,i1). We call the one-position-per-bit view the condensed view and the two-positions-per-bit view the expanded view. We will give details in the full version due to space restrictions. For now, we phrase things in the condensed view.

  2. 2.

    Usually, when we flip an input xi to a circuit C, we imagine the change propagating instantaneously through the circuit C, potentially changing its output. Here, we need to allow for a way for this change to proceed gradually; therefore, we allow gates to be temporarily in an incorrect state.

When we have a position iV and an assignment 𝐲{0,1}V and yi=b, we sometimes say i is assigned value b and sometimes the label of i is b.

State of a gate.

The state of a gate is a triple (x,y,b) where x,y are the two input bits and b is the output bit. If b=¬(xy) we call (x,y,b) correct, because b is what it is supposed to be: the NAND of x and y; otherwise, we call it incorrect. A gate g is represented by a gadget of four positions g00,g01,g10,g11, ordered as a 2×2 square, as shown in Figure 3. A state (x,y,b) is encoded as follows: position gxy is labeled b, the three remaining ones are labeled with ¬b. Note that not all labelings of the gadget correspond to a gate state, only those where the number of positions labeled 1s is one or three.

Observation 7.

The triple (x,y,b) is correct if and only if the position g11 in its representation is labeled 0.

This is the core reason why we use this representation: we can determine correctness of a gate by reading just one bit. This will be important later when defining a cost function: having a 1 at those control positions is bad.

Input and output variables.

Let xi(j) be the i-th input variable to the j-th circuit (so 1in and 0jn). We introduce one position for each xi(j). Similarly, let ck(j) be the k-th output value of the j-th circuit; we introduce one position for each ck(j).

A central definition is that of a well-behaved assignment. Basically, it formalizes when an assignment encodes the partial evaluation of the inputs by the n+1 circuits.

Definition 8.

An assignment 𝐲{0,1}V is called well-behaved if the following hold:

  • For each gate g, the four positions g00,g01,g10,g11 are the encoding of a gate state (a1,a2,b){0,1}3.

  • If the output of a gate g is the l-th input of some gate h, then the corresponding input and output values agree, i.e., if the state of h is (a1,a2,b) then b=al.

  • If the l-th input of g is an input variable xi(j), then xi(j) is assigned the value al.

  • If g is the k-th output gate of circuit j, then its output value b is the same as the label of ck(j).

  • The labels of the input values xi(j) equal xi(0) if ij, and are unequal if i=j; in words, if the labels of the input positions of C0 form a vector 𝐱{0,1}n, then those of Cj form the vector 𝐱ej.

Next, we describe the permutations on the positions. They come in two types: (1) flipping a gate and (2) swapping two circuits.

Flipping a gate.

If g is in state (a1,a2,b), then flipping g means replacing b by ¬b, and for each gate h (in state (a1,a2,b)) into which g feeds as l-th input, flipping al. Since our permutations do not work on the state of a gate but on its representation in the four-position gadget (Figure 3), we work as follows: we flip the labels in all positions of g, i.e., g00,g01,g10,g11; if g is the first input of h, we swap positions of h horizontally: swap h00 with h10 and h01 with h11; if g is the second input of h, we perform a vertical swap: h00 with h01 and h10 with h11. This operation changes the state of g from incorrect to correct (or vice versa) and may also change correctness of h. If g happens to be the k-th output bit of circuit j, then this operation also flips position ck(j). See Figure 4 for an example of two consecutive gates being flipped. We call this permutation πg. If g is the i-th gate in circuit j, we may also call it πij. Note that if 𝐲 is a well-behaved then 𝐲πg is well-behaved, too.

Swapping two circuits.

We want a permutation that simulates flipping the i-th input bit to C, the circuit in the instance of FLIP. We achieve this by swapping C0 with Ci – that is, swapping every position (input values, values in gate gadgets, output values) in C0 with its corresponding position in Ci, and simultaneously flipping the i-th input bit xi(j) for every circuit Cj with j{1,,n}{i}; naturally, if this xi(j) is the first input to a gate g in Cj, we have to perform the “horizontal swap” at g outlined above, and if it is the second input to g, a “vertical swap” at g. We call this permutation σi. Again, if 𝐲 is well-behaved then 𝐲σi is well-behaved, too.

The starting string 𝐲𝐬𝐭𝐚𝐫𝐭{𝟎,𝟏}𝑽.

This is the assignment where C0 has input 𝟎{0,1}n and Ci has input 𝐞i{0,1}n and all gates have output 0 (whether correctly or incorrectly). This is certainly well-behaved (or rather, can be made well-behaved by making sure that input to gate h matches output of gate g should they be connected).

We now have a set V of positions, an assignment 𝐲start{0,1}V, and a set of permutations-gate-flippers πg for each gate g and circuit-swappers σi for each i[n]. They generate a subgroup G of SV. It is clear that the orbit of 𝐲start under G is the set of well-behaved assignments.

5.3 The cost function

We have promised to use a lexicographic ordering as a cost function. That is, if 𝐲,𝐲{0,1}V are two assignments, then 𝐲 is better than 𝐲 (meaning lower cost) if 𝐲lex𝐲. Thus, to define the cost function it suffices to specify an ordering on the positions in V.

  • Positions in C0 come before positions in C1 and so on.

  • Within a circuit, most important are the control positions g11 of the gates, followed by the output gates, followed by all remaining positions.

  • Within control positions in the same circuit, the order follows the topological ordering of the circuit, i.e., if g feeds into h, then g’s control position comes before h’s.

Figure 3: An example gate configuration with the input x=0 and y=0 and the output 0. This is incorrect for a NAND-gate as indicated by the control bit. In light grey we denote the expanded encoding of the positions.
(a) Step 1: Initial state. Gate g1 is evaluated incorrectly, g2 correctly. Still, we call this a well-behaved state.
(b) Step 2: Application of the permutation πg2 which leads to g2 being now incorrect as well. This is not a local improvement step. While it minimizes the output, the more expensive control bit of g2 is now active. Still the relationship between the gate state and the string under the current permutation holds, so this is well-behaved as well.
(c) Step 3: Application of the permutation πg1. Due to the inversion, g1 is now correct and the change of its output is reflected in g2 which is now also correct since the one was swapped out of the control position. This is now a local optima.
Figure 4: Step-by-step evaluation of the circuit and reduction process. Each step shows the circuit state (left) and the reduction state (right). Currently incorrect gates are marked red and the output of a gate is identifiable via italics.

5.4 Proof of Correctness

In this section we now prove the correctness and tightness of our reduction. In order to show the correctness we have to show that if πG is a local optimum of the k-Permutation Local Orbit Minimum instance, i.e., if the assignment 𝐲:=𝐲startπ cannot be further improved by applying a πg or a σj, then the input to C0 encoded in 𝐲 corresponds to a local optimum of FLIP.

Well-behaved permutations for a string s and a circuit C are interesting, because they realize the evaluation of the circuit somehow. The only problem is that the gate does not have the correct output in the current permutation with the string s compared to C.

Lemma 9.

Let 𝐲 be a well-behaved assignment and suppose that y(g11)=0 for every gate – every control position is labeled 0. Then all output positions are mapped to correct results according to C. That is, if 𝐱{0,1}n is the vector to which the positions of circuit C0 are mapped under 𝐲, then

  1. 1.

    the input positions of Ci are mapped to 𝐱𝐞i (this actually holds for every well-behaved 𝐲, control positions being 0 or 1),

  2. 2.

    the output positions of C0 are mapped to C(𝐱);

  3. 3.

    the output positions of Cj are mapped to C(𝐱𝐞j)

Proof.

This follows from Observation 7 and induction over the sequence of gates.

The previous lemma tells us that all control positions should be mapped to zero in any local optimum so that all output positions are mapped to the correct output of C given the input. We show that we can always apply a permutation to achieve this.

Lemma 10.

Let π be a permutation from G. We consider a gate gi in the circuit j. The control position of gi is mapped to position of the form gi,kj by π

Proof.

This can be proven by induction on the structure of π in the permutation group. Any generator preserves this property as it either does not affect this position at all πij for ii or jj. If both i and j are equal to i and j, then the position is simply inverted which preserves this property. Additionally, any permutation σj either maps a gate to itself or swaps the gate, so that the claim holds here as well.

Lemma 11.

If 𝐲 is well-behaved and some control position g11 is 1 under 𝐲, then 𝐲 is not a local optimum.

Proof.

Among all control positions assigned 1, let g11 be the highest-ranking (i.e., of smallest index). Now apply πg, i.e., flip gate g, which inverts the bit by the previous lemma. Under 𝐲πg, the control position g11 is now correct; successor gates h in the same circuit might now become incorrect, but their control positions have lower rank by our ordering; gates in other circuits are not affected. Thus, 𝐲πglex𝐲, and 𝐲 is not a local optimum.

Corollary 12.

In any local optimum all sub circuits are correctly evaluated.

The previous lemmas suffice to show the main result.

Lemma 13.

Let 𝐲=𝐲startπ{0,1}V be a local optimum an instance of
k-Permutation Local Orbit Minimum. Suppose the input variables of C0 are mapped to some 𝐱{0,1}n. Then 𝐱 is a local optimum of the FLIP instance.

Proof.

Since 𝐲 is well-behaved, the input variables of Ci are mapped to 𝐱𝐞i. Since 𝐲 is a local minimum, by the corollary, the output values of Cj are in fact mapped to the correct output C(𝐱𝐞j).

Suppose now that the mapped input is not a local optimum for the FLIP instance. Then there must be neighbor with a better output, i.e., C(𝐱ej)lexC(𝐱). Now consider 𝐲=𝐲σj. Under 𝐲, the control positions of C0 are all mapped to 0 (because those of Cj were under 𝐲); the output of C0 under 𝐲 is better than under 𝐲 because C(𝐱ej)lexC(𝐱). Control positions in Ci with i1 might now be 1, but their priority is less than that of C0’s output. Thus, 𝐲 is better than 𝐲, and 𝐲 is not a local optimum.

This concludes the proof of Theorem 5. Every permutation used in the reduction has an order of two, so it is an involution. Still, these permutations do not form a commutative group due to the σi permutations. This is to be expected as even finding a global optimum for the lexicographical leader of a string under an abelian permutation group where every element has an order of two is polynomial time solvable[1, Section 3.1].

We additionally note that the reduction is tight and hence finding a local optimal bitstring under permutations via the standard algorithm is PSPACE-complete.

Theorem 14.

The given reduction is tight.

Proof.

Let I be an instance of FLIP and (f,g) the previously defined reduction. We use as simply the set of all permutations in the group of the generators which necessarily contains all local optima. We can find for any solution s of I in polynomial time a solution π with g(I,π)=s in by applying the σj permutations to construct the needed input string. This requires applying at most n permutations which can be done in polynomial time. Finally, we see that any path where only the endpoints are in must be an edge. If the edge is due to an πij permutation the input does not change and hence both endpoints are mapped to the same solution. If the edge is alternatively due to a σj permutation this changes the input in one variable and is hence an edge in TG(I) as it corresponds directly to a flip there.

6 Realizing the permutations in propositional formula

In the problem Locally Minimal Solution we are given a CNF formula F over some variables V, a satisfying assignment α:V{0,1}, and a list of permutations π1,,πk on V such that F is invariant under πi (that is, when applying πi to each variable occurrence in F, the resulting formula F is equal to F up to a re-ordering of the clauses and the literals therein). The task now is to find a satisfying assignment β of F that such that βπilexβ. This is clearly in PLS: whether F is invariant under the πi and whether β satisfies F are both easy to check. Note that it is not required that β be in the orbit of α under π1,,πk.

Theorem 15.

Locally Minimal Solution is PLS-complete.

Proof.

We will define a formula F whose satisfying assignments correspond exactly the well-behaved assignments to the positions, as defined in Definition 8. We first describe how to encode one circuit of the total n+1 circuits. We have input variables x1,,xn to the circuit; we introduce one gate output variable gout for each gate; and four gate control variables g00,g01,g10,g11 for the four positions in the square-representation of that gate, as in Figure 3. For each such variable u we introduce its twin u~ and add (u¬u~). In other words, the (positive) literal u~ simulates the negative literal u¯. Take a gate g, let u,v be its inputs and w its output. The following formula Fg ensures that the gate control variables gab are set correctly as required for a well-behaved assignment:

(uvw)(g~00g~01g~10g11)
(uvw~)(g00g01g10g~11)
(uv~w)(g~00g~01g10g~11)
(uv~w~)(g00g01g~10g11)
(u~vw)(g~00g01g~10g~11)
(u~vw~)(g00g~01g10g11)
(u~v~w)(g00g~01g~10g~11)
(u~v~w~)(g~00g01g10g11)

Fg can easily be written as a CNF formula. The permutation πg amounts to flipping the output of gate g and flipping the corresponding inputs at those gates h that g’s output feeds into. Thus, πg is

(ww~)(g00g~00)(g01g~01)(g10g~10)(g11g~11)(stuff at successor gates) (2)

Fg is invariant under πg (even when we write it as a CNF). Next, there is a permutation σ that flips the input u of g. This swaps the two rows of the square representation of g:

(stuff at predecessor gates)(uu~)(g00g10)(g~00g~10)(g01g10)(g~01g~11) (3)

If u is the output of some gate h, then σ is πh and “stuff at predecessor gate” is what we describe in (2); otherwise u is an input variable xi and “stuff at predecessor gate” does nothing – for now.

This formula describes well-behaved assignments in one of the n+1 circuits C0,,Cn. We now create n+1 copies of this formula, introducing a fresh version of each variable, so the jth input variable xj becomes xj(i) in Ci, and g00 becomes g00(i) and so on. We create a formula H to ensure that xj(i) and xj(0) differ if and only if i=j:

H:={i1,i2}({0,,n}2)j=1n{(xj(i1)xj(i2))(x~j(i1)x~j(i2)) if j{i1,i2}(xj(i1)x~j(i2))(x~j(i1)xj(i2)) if j{i1,i2}.} (7)

The permutation σi flipping circuit Ci and C0 and inverting xi(i) for all other i can be written as

(uj(i)uj(0))(u~j(i)u~j(0)) (for each input and gate output and control variable u)
(xi(i)x~i(i))(do (3) at gates having xi(i) as input) (for all i{1,,n}{i})

This forms the final formula F=Hi=0n gate gFg(i). Its satisfying assignments correspond exactly to the well-behaved assignments described above and that each πg and each σi is indeed a symmetry of F. The order of the variables is as in the previous proof: of highest priority are the control variables g11(0) (following the topological order of the gates in the circuit); then the output variables of C0; then to the control variables of the other circuits; then all the rest. It is easy to provide an “initial” satisfying assignment αSAT(F). Finally, if β is some satisfying assignment of F that is locally minimal, i.e., cannot be improved by applying any πg or σi, then β represents a configuration in which all circuits C0,,Cn are correctly evaluated and no Ci outputs something better than C0; in other words, a local optimum of FLIP. This shows that Locally Minimal Solution is PLS-complete.

7 Conclusion and open questions

We have shown that the problem is PLS-hard in general and hence a polynomial time algorithm is unlikely unless P=PLS. In the theory of PLS-complete problems we thereby demonstrated another example of a hard problem with lexicographic weights. The used permutations are realistic in the sense that they can occur in an actual CNF formula.

Our above reduction requires polynomially many permutations. There is an efficient algorithm for the case of one permutation. What about when we are given a constant number of permutations?

What about if the given permutations form an Abelian group? Is it still PLS-hard to find a local minimum?

The neighborhood of a solution π is in our work defined as ππi for some generator πi. An alternative neighborhood would be πiπ, which would place the generator between the string and the current permutation. While the results of the one permutation case trivially hold again, the hardness proof does not transform to this formulation.

References

  • [1] László Babai and Eugene M. Luks. Canonical labeling of graphs. In David S. Johnson, Ronald Fagin, Michael L. Fredman, David Harel, Richard M. Karp, Nancy A. Lynch, Christos H. Papadimitriou, Ronald L. Rivest, Walter L. Ruzzo, and Joel I. Seiferas, editors, Proceedings of the 15th Annual ACM Symposium on Theory of Computing, 25-27 April, 1983, Boston, Massachusetts, USA, pages 171–183. ACM, 1983. doi:10.1145/800061.808746.
  • [2] Christoph Buchheim and Michael Jünger. Linear optimization over permutation groups. Discret. Optim., 2(4):308–319, 2005. doi:10.1016/J.DISOPT.2005.08.005.
  • [3] Dominic Dumrauf and Burkhard Monien. On the PLS-complexity of maximum constraint assignment. Theor. Comput. Sci., 469:24–52, 2013. doi:10.1016/J.TCS.2012.10.044.
  • [4] Alex Fabrikant, Christos H. Papadimitriou, and Kunal Talwar. The complexity of pure nash equilibria. In László Babai, editor, Proceedings of the 36th Annual ACM Symposium on Theory of Computing, Chicago, IL, USA, June 13-16, 2004, pages 604–612. ACM, 2004. doi:10.1145/1007352.1007445.
  • [5] John Fearnley, Paul W. Goldberg, Alexandros Hollender, and Rahul Savani. The complexity of gradient descent: CLS = PPAD PLS. In Samir Khuller and Virginia Vassilevska Williams, editors, STOC ’21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, Virtual Event, Italy, June 21-25, 2021, pages 46–59. ACM, 2021. doi:10.1145/3406325.3451052.
  • [6] Merrick L. Furst, John E. Hopcroft, and Eugene M. Luks. Polynomial-time algorithms for permutation groups. In 21st Annual Symposium on Foundations of Computer Science, Syracuse, New York, USA, 13-15 October 1980, pages 36–41. IEEE Computer Society, 1980. doi:10.1109/SFCS.1980.34.
  • [7] Marijn Heule, Warren A. Hunt Jr., and Nathan Wetzler. Expressing symmetry breaking in DRAT proofs. In Amy P. Felty and Aart Middeldorp, editors, Automated Deduction – CADE-25 – 25th International Conference on Automated Deduction, Berlin, Germany, August 1-7, 2015, Proceedings, volume 9195 of Lecture Notes in Computer Science, pages 591–606. Springer, 2015. doi:10.1007/978-3-319-21401-6_40.
  • [8] David S. Johnson, Christos H. Papadimitriou, and Mihalis Yannakakis. How easy is local search? J. Comput. Syst. Sci., 37(1):79–100, 1988. doi:10.1016/0022-0000(88)90046-3.
  • [9] Leszek Aleksander Kolodziejczyk and Neil Thapen. The strength of the dominance rule. In Supratik Chakraborty and Jie-Hong Roland Jiang, editors, 27th International Conference on Theory and Applications of Satisfiability Testing, SAT 2024, August 21-24, 2024, Pune, India, volume 305 of LIPIcs, pages 20:1–20:22. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.SAT.2024.20.
  • [10] Mark W. Krentel. On finding locally optimal solutions. In Proceedings: Fourth Annual Structure in Complexity Theory Conference, University of Oregon, Eugene, Oregon, USA, June 19-22, 1989, pages 132–137. IEEE Computer Society, 1989. doi:10.1109/SCT.1989.41819.
  • [11] Christos H. Papadimitriou. On graph-theoretic lemmata and complexity classes (extended abstract). In 31st Annual Symposium on Foundations of Computer Science, St. Louis, Missouri, USA, October 22-24, 1990, Volume II, pages 794–801. IEEE Computer Society, 1990. doi:10.1109/FSCS.1990.89602.
  • [12] Christos H. Papadimitriou, Alejandro A. Schäffer, and Mihalis Yannakakis. On the complexity of local search (extended abstract). In Harriet Ortiz, editor, Proceedings of the 22nd Annual ACM Symposium on Theory of Computing, May 13-17, 1990, Baltimore, Maryland, USA, pages 438–445. ACM, 1990. doi:10.1145/100216.100274.
  • [13] Alejandro A. Schäffer and Mihalis Yannakakis. Simple local search problems that are hard to solve. SIAM J. Comput., 20(1):56–87, 1991. doi:10.1137/0220004.
  • [14] Neil Thapen. personal communication.
  • [15] Nathan Wetzler, Marijn Heule, and Warren A. Hunt Jr. Drat-trim: Efficient checking and trimming using expressive clausal proofs. In Carsten Sinz and Uwe Egly, editors, Theory and Applications of Satisfiability Testing – SAT 2014 – 17th International Conference, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 14-17, 2014. Proceedings, volume 8561 of Lecture Notes in Computer Science, pages 422–429. Springer, 2014. doi:10.1007/978-3-319-09284-3_31.