On Solving MAX-SAT Using Sum of Squares

Published Online:https://doi.org/10.1287/ijoc.2023.0036

Abstract

We consider semidefinite programming (SDP) approaches for solving the maximum satisfiability (MAX-SAT) problem and weighted partial MAX-SAT. It is widely known that SDP is well-suited to approximate (MAX-)2-SAT. Our work shows the potential of SDP also for other satisfiability problems by being competitive with some of the best solvers in the yearly MAX-SAT competition. Our solver combines sum of squares (SOS)–based SDP bounds and an efficient parser within a branch-and-bound scheme. On the theoretical side, we propose a family of semidefinite feasibility problems and show that a member of this family provides the rank-two guarantee. We also provide a parametric family of semidefinite relaxations for MAX-SAT and derive several properties of monomial bases used in the SOS approach. We connect two well-known SDP approaches for (MAX)-SAT in an elegant way. Moreover, we relate our SOS-SDP relaxations for partial MAX-SAT to the known SAT relaxations.

History: Accepted by Andrea Lodi, Area Editor for Design & Analysis of Algorithms – Discrete.

Supplemental Material: The online appendix is available at https://doi.org/10.1287/ijoc.2023.0036.

1. Introduction

In this paper, we investigate semidefinite programming (SDP) approaches for the satisfiability (SAT) problem, maximum satisfiability (MAX-SAT) problem, and their variants. Given a logical proposition built from a conjunction of clauses, SAT asks whether there exists a truth assignment to the variables such that all clauses are satisfied. The optimization variant of SAT, known as MAX-SAT, is to determine a truth assignment that satisfies the largest number of clauses.

SAT is a central problem in mathematical logic and computer science and finds various applications, including software or hardware verification (Marques-Silva and Sakallah 2000) and planning in artificial intelligence (Kautz and Selman 1999). Cook (1971) proves that SAT is NP-complete. SAT is the first problem proven to be NP-complete, which implies that any problem contained in the complexity class NP can be efficiently recast as a SAT instance. Thus, algorithms for SAT can also solve a wide variety of other problems, such as timetabling (Asín Achá and Nieuwenhuis 2014, Gattermann et al. 2016) and product line engineering (Mendonca et al. 2009).

SDP approaches to SAT are proposed first by de Klerk et al. (2000) and later extended by Anjos (2004a, b; 2005; 2006; 2007). Goemans and Williamson (1995) are first to apply SDP to MAX-SAT. They show that, for a specific class of MAX-SAT instances known as MAX-2-SAT (in MAX-k-SAT, each clause is a disjunction of at most k variables), MAX-SAT is equivalent to optimizing a multivariate quadratic polynomial, which is naturally well-suited for semidefinite relaxations. In the same paper, Goemans and Williamson (1995) propose a 0.878-approximation algorithm for MAX-2-SAT based on SDP. This result is later improved to 0.940 in Lewin et al. (2002). Further, Karloff and Zwick (1997) obtain an optimal 7/8 approximation algorithm for MAX-3-SAT, and Halperin and Zwick (2001) obtain a nearly optimal approximation algorithm for MAX-4-SAT. In van Maaren et al. (2008), the authors exploit sum of squares (SOS) optimization to compute bounds for MAX-SAT.

Despite the great success in designing approximation algorithms using SDP, most modern MAX-SAT solvers do not exploit SDP. A possible reason for this is the fact that medium- to large-size SDP problems are computationally challenging to solve. Interior point methods, the conventional approach for solving SDPs, struggle from large memory requirements and prohibitive computation time per iteration already for medium-size SDPs. Recently, first order methods, such as the alternating direction method of multipliers (Gabay and Mercier 1976, Boyd et al. 2011) and the Peaceman–Rachford splitting method (PRSM) (Peaceman and Rachford 1955) show a great success in solving SDPs (see, e.g., Oliveira et al. 2018, de Meijer and Sotirov 2021, Graham et al. 2022). Motivated by these results, we design a MAX-SAT solver that incorporates SDP bounds and the PRSM within a branch-and-bound (B&B) scheme.

In particular, we further exploit the SOS approach from van Maaren et al. (2008) to derive SOS-based SDP relaxations that provide strong upper bounds to the optimal MAX-SAT solution. The derived SDP relaxations are strengthened SDP duals of the Goemans and Williamson (1995) MAX-SAT relaxation. The strength of the upper bounds and the required time to compute the relaxations depend on the chosen monomial basis. We experiment with different monomial bases and propose a class of bases that provide good trade-offs between these effects. Moreover, we derive several properties of monomial bases that are exploited in the design of our solver. We extend the SOS approach to weighted partial MAX-SAT, a variant of MAX-SAT in which clauses are divided into soft and hard clauses. Here, the goal is to maximize the weighted sum of soft clauses, satisfying all the hard clauses. We strengthen SDP bounds for weighted partial MAX-SAT using the SAT resolution rule. To the best of our knowledge, we are the first to exploit SDP for solving weighted partial MAX-SAT.

We show that the Peaceman–Rachford splitting method is well-suited for exploiting the structure of the SOS-based SDP relaxations. Therefore, we implement the PRSM to (approximately) solve large-scale SDP relaxations and obtain upper bounds for the (weighted partial) MAX-SAT. The resulting algorithm is very efficient; for example, it can compute upper bounds with matrix variables of order 1,800 in less than two minutes and for matrices of order 2,400 in less than four minutes. Our numerical results show that the upper bounds are strong, in particular, when larger monomial bases are used. We also exploit the output of the PRSM to efficiently compute lower bounds for the MAX-SAT problem.

We design an SOS-SDP–based MAX-SAT solver (named SOS-MS) that exploits SOS-based SDP relaxations and the PRSM. SOS-MS is one of the first SDP-based MAX-SAT solvers. The only alternative SDP-based solver is the MIXSAT algorithm (Wang and Zico Kolter 2019) that is designed to solve MAX-2-SAT instances. SOS-MS is able to solve (weighted partial) MAX-k-SAT instances for k3. To solve a MAX-SAT instance, SOS-MS has to approximately solve multiple SDP subproblems. A crucial component of SOS-MS is, therefore, its ability to quickly construct the program parameters of the required SDPs, that is, the process of parsing. We design an efficient parsing method, which is also applicable to other problems and publicly available. Another efficient feature of our solver is warm starts. Namely, our solver uses the approximate PRSM solution at a node as warm starts for the corresponding children’s node. We are able to solve a variety of MAX-SAT instances in a reasonable time, solving some instances faster than the best solvers in the 11th Evaluation of Max-SAT Solvers (MSE-2016). Moreover, we solve three previously unsolved MAX-3-SAT instances from the MSE-2016. To our knowledge, we are first to use SDP for solving weighted partial MAX-SAT. Our results provide new perspectives on solving MAX-SAT and all its variants by using SDPs.

Our paper provides various theoretical results. We propose a family of semidefinite feasibility problems and show that one member of this family provides the rank-two guarantee. That is, whenever the semidefinite relaxation admits a feasible matrix of rank two or less, the underlying SAT instance is satisfiable. This result relates to a similar rank-two guarantee result by Anjos (2004a). The rank value can be seen as a measure of the strength of the relaxation. We also provide a parametric family of semidefinite relaxations for the (weighted partial) MAX-SAT. This parameter can be finely tuned to determine the strength of the relaxation, and any such relaxation can easily be incorporated within SOS-MS. This allows the solver to be adapted per (class of) problem instances.

Further, we show how the SOS approach to MAX-SAT of van Maaren et al. (2008) and the, here generalized, moment relaxations of SAT from Anjos (2004a, b; 2005; 2006; 2007) are related. This is done by exploiting the duality theory of the moment and SOS approaches. Our result generalizes a result by van Maaren et al. (2008), who show the connection between the two approaches only for restricted cases. By exploiting duality theory, we also relate the SOS relaxations for the partial MAX-SAT problem to SAT relaxations from Anjos (2004a).

Finally, we investigate MAX-SAT resolution, a powerful technique used by many MAX-SAT solvers (Abramé and Habet 2014) in relation to the SDP approach to MAX-SAT. Standard MAX-SAT solvers use resolution to determine upper bounds on the MAX-SAT solution, whereas SOS-MS determines upper bounds through SDP. We show how resolution is related to the monomial basis. We also show how SAT resolution can be exploited for weighted partial MAX-SAT.

This paper is organized as follows. We provide notation and preliminaries in Section 1.1 and assumptions in Section 1.2. Section 2 provides an overview of the Goemans and Williamson (1995) approach to MAX-SAT. Section 3 first outlines previous SDP approaches to SAT and then generalizes them. Section 4 provides the details of the SOS theory applied to MAX-SAT. We also derive various properties of monomial bases in that section. Section 5 concerns the combination of MAX-SAT resolution and SOS. In Section 6, we show how two SDP approaches to (MAX-)SAT (i.e., Anjos 2004a, van Maaren et al. 2008) are connected. Section 7 introduces the PRSM for SOS.1 We extend the SOS approach to weighted partial MAX-SAT and connect the resulting program to the relaxations in Anjos (2004a) in Section 8. Online Appendix E provides an overview and pseudocode of our solver SOS-MS. Online Appendix F presents numerical results that include SOS-SDP bounds and performance of SOS-MS. Concluding remarks are given in Section 9.

1.1. Preliminaries and Notation

For any nN, we write [n]={1,,n}. We denote by ϕ a propositional formula, in variables x1 up to xn and assume that ϕ is in conjunctive normal form (CNF). That is, ϕ is given by a conjunction of m clauses,

ϕ=j=1mCj.(1)

We mostly use n to refer to the number of variables and m to refer to the number of clauses. Each clause Cj is a disjunction of (possibly negated) variables. We define each clause Cj as a subset of [n], indicating the variables appearing in Cj. Moreover, we define Ij+Cj as the set of unnegated variables appearing in Cj. Similarly, IjCj is defined as the set of negated variables appearing in Cj. Thus, the clause associated with Cj reads

iIj+xiiIj¬xi.(2)

We refer to both xi and ¬xi as literals. For example, the literal ¬xi is true if xi is false. We denote the length of a clause by j; thus, j|Cj|. We say that ϕ constitutes a (MAX-)k-SAT instance if maxj[m]j=k.

The SAT problem is to decide, given ϕ, whether a satisfying truth assignment to the variables xi, i[n] exists. The MAX-SAT problem is to find an assignment that satisfies the largest number of clauses. We associate to each clause a vector aj{0,±1}n, having entries aj,i according to

aj,i={1,ifiIj,0,ifiIj+Ij,1,ifiIj+.(3)

We write Sn for the set of symmetric n × n matrices and S+n for the cone of symmetric positive semidefinite matrices of size n × n. If the context is clear, the superscript n is omitted. We denote by 1nRn and 0nRn vectors of all ones and zeroes, respectively (subscripts are omitted when the context is clear). The identity matrix of order n is written as In. Matrix 0m×n denotes the zero matrix of m rows and n columns. For X,YS, we define the trace inner product as X,YTr(XY). We write XY if and only if XYS+. The Frobenius norm of a symmetric matrix X is given by XF=X,X. For XS and MS, we set

PM(X)arg minZMZXF,(4)
as the projection of X onto M. For XRn×n, diag(X)Rn denotes the vector equal to the diagonal of X. For xRn, we write xxx and
xαiαxi,(5)
for some α[n]. We evaluate the empty product as one. Note that (5) differs from the more common notation in SOS literature, in which the α are considered as vectors in Nn; see, for example, Lasserre (2007).

1.2. Assumptions

In the rest of this work, we assume that all logical propositions ϕ on n variables and m clauses satisfy the following three properties:

  1. For all j[m],|Cj|2.

  2. For all j[m],Ij+Ij=.

  3. Each variable is contained in at least two clauses along with ϕ being in CNF.

Property 1 can be assumed for SAT instances. If a SAT instance contains a clause Cj with |Cj|=1 (such a clause is known as a unit clause), the literal in Cj must be satisfied. The variable corresponding to this literal can, thus, be given an appropriate truth value, and ϕ can be reduced (such a reduction of ϕ is referred to as unit resolution). For MAX-SAT instances, it is possible that an optimal truth assignment might leave unit clauses unsatisfied. We note, however, that the MAX-SAT benchmark instances we consider satisfy all these assumptions.

In Online Appendix B, we show that properties 2 and 3 can be assumed without loss of generality (w.l.o.g.).

2. MAX-SAT Formulation and Relaxation

We outline the approach of Goemans and Williamson (1995) for formulating MAX-SAT as a polynomial optimization problem. We also present their SDP relaxation for MAX-2-SAT.

Let x1,x2,,xn be the variables of the MAX-SAT instance given by a logical proposition ϕ. We, thus, assume that ϕ is given in conjunctive normal form, see (1), and contains m clauses. As customary in the SDP SAT literature, we associate +1 with true and –1 with false. An assignment of the xi values in {±1} is referred to as a truth assignment. As proposed by Goemans and Williamson (1995), we define a truth function v:{±1}n{0,1} such that, given a logical proposition ϕ evaluated for some truth assignment, v(ϕ)=1 if and only if ϕ is satisfied and zero otherwise. This property uniquely determines v; that is, v(xi)=1+xi2andv(¬xi)=1xi2. And, in general, for a clause Cj[n] of length j, we have

v(Cj)1iIj+v(¬xi)iIjv(xj)=12j(γCj(1)|γ|ajγxγ),(6)
for aj as in (3) and both ajγ and xγ as in (5). The last equality in (6) follows from the product expansion of v(Cj) as shown in proposition 1 in Anjos (2006). In Goemans and Williamson (1995), an extra variable x0{±1} is defined with the purpose of deciding the truth value; that is, ϕ is true if and only if v(ϕ)=x0. We set x0=1 without loss of generality for sake of clarity. The MAX-SAT problem given by ϕ is to maximize the following polynomial:
vϕj[m]v(Cj)=α[n]vϕαxα,(7)
subject to xi{±1} for all i and for appropriate vϕαR and xα as in (5). Observe that vϕ is a kth degree polynomial if ϕ represents a MAX-k-SAT instance. A MAX-2-SAT instance, thus, corresponds to a quadratic polynomial and is, therefore, well-suited for approximation by SDP. We return to vϕ in Section 6.

Assuming now that ϕ represents a MAX-2-SAT instance on n variables, the corresponding MAX-2-SAT can be formulated as

maxW,Xs.t.diag(X)=1,X0,X{±1}(n+1)×(n+1),(8)
where W,X describes the quadratic polynomial vϕ. Observe that the constraints of (8) enforce X to satisfy X=xx for some x{±1}n+1. The size of this vector x is one more than the number of variables n to account for the additional truth value variable x0.

A semidefinite relaxation of (8) is obtained by omitting the integrality constraint or, equivalently, nonconvex rank-one constraint. This constitutes the well-known Goemans and Williamson (1995) SDP relaxation of MAX-2-SAT. That is,

maxW,Xs.t.diag(X)=1,XS+n+1.(9)

Goemans and Williamson (1995) show that the optimal matrix for (9) can be used to obtain a 0.878-approximation algorithm to MAX-2-SAT. Assuming PNP, for any ε>0 there exists no (2122+ε) approximation algorithm to MAX-2-SAT (Håstad 2001). Karloff and Zwick (1997) introduce a canonical way of obtaining SDP relaxations for any MAX-SAT that is exploited to obtain approximation algorithms to MAX-3-SAT and MAX-4-SAT in Karloff and Zwick (1997) and Halperin and Zwick (2001), respectively. To solve MAX-2-SAT instances, rather than approximate, Wang and Zico Kolter (2019) propose the MIXSAT algorithm, which combines (9) with a B&B scheme.

3. SAT as a Semidefinite Feasibility Problem

In this section, we first present a brief overview of the work done by de Klerk et al. (2000) and Anjos (2004a, b; 2005; 2006; 2007). Their relaxations of SAT involve semidefinite feasibility problems: infeasibility of the semidefinite program implies unsatisfiability of the corresponding SAT instance. The difference between relaxations is the size of the SDP variable and the method of encoding the structure of the SAT instance in the SDP relaxation. Then, we propose a family of semidefinite feasibility problems that contains relaxations from Anjos (2004a, b; 2005; 2006; 2007) and de Klerk et al. (2000) as special cases and show that a particular member of the family provides a rank-two guarantee; see Theorem 1.

We reconsider first Program (9), which attempts to satisfy the maximum number of clauses through its objective function. For SAT specifically, one might move the clause satisfaction part from the objective to the feasible set of a semidefinite program. This idea is first proposed by de Klerk et al. (2000) and later extended by Anjos (2004a). To be precise: de Klerk et al. (2000) propose the so-called GAP relaxation, or GAP for short, which is a semidefinite feasibility problem, given by

findYS+n,yRns.t.ajYaj2ajyj(j2),j[m],diag(Y)=1,Yyy,(GAP)
for aj as in (3). It is noted in de Klerk et al. (2000) that, for j2, the corresponding inequalities in GAP relaxation may be changed to equalities. The GAP relaxation is suited for instances that contain a clause of length two. If j3,j[m], then (Y,y)=(I,0) is always feasible for GAP whether the underlying SAT instance is satisfiable or not.

We now state the SDP relaxations of SAT by Anjos (2004a, b; 2005; 2006; 2007) that are not restricted to the lengths of the clauses in instances. Let ϕ be a proposition on n variables and m clauses and x{±1} the truth assignment to the variables. Consider a family of subsets F={α1,,αs}, let x=(xα1,,xαs), and define Yxx. It is clear that rank(Y)=1, diag(Y)=1, and Y0. Later, to obtain a semidefinite relaxation of SAT, we omit the rank-one constraint.

We index the matrix Y with the elements of F and define for all subsets γ contained in some clause of ϕ the expression

Y(γ)Yα,β,for someα,βFjointlycontainedinasingleclauses.t.αβ=γ,(10)
where is the symmetric difference operator, which is induced by the fact that, for x{±1}n, we have Yα,β=xαxβ=xαβ=xγ; see (5). In general, Y() refers to a diagonal entry of Y; hence, Y()=1. We may have Y(γ)=Y,γ, and we assume that, for all γ contained in a clause of ϕ, we can always find α and β as in (10).

The expression Y(γ) can refer to multiple entries of Y. By construction of Y, these entries are equal. Stated formally, we have Yj[m]Δj, where

Δj{YS|Yα1,β1=Yα2,β2(α1,α2,β1,β2)Fs.t.α1β1=α2β2Cj}.(11)

Observe that the sets Δj do not capture all equalities present in Y because of the restriction α1β1=α2β2Cj. In this section, we choose to include only the equalities captured by Δj. This keeps our work in line with previous relaxations by Anjos (2004a), and these equalities suffice to prove the main theorem in this section; see Theorem 1. In Section 6, we consider an SDP relaxation of SAT that considers all equalities present in Y.

If x is a satisfying assignment to ϕ, then v(Cj)=1 (see (6)) for all j[m]. We can rewrite this constraint in terms of Y(γ); see (10). We now omit the rank-one constraint on Y to obtain the following semidefinite feasibility program, denoted by RF(ϕ):

findYS+|F|s.t.γCj(1)|γ|ajγY(γ)=0,j[m],diag(Y)=1,Yj[m]Δj.RF(ϕ)

The program RF(ϕ) contains both the GAP relaxation and the relaxations proposed by Anjos (2004b) as special cases. Specifically, one obtains the GAP relaxation from RF(ϕ) by taking F={α[n]||α|1}. de Klerk et al. (2000) prove that, whenever GAP is feasible for a 2-SAT instance, the 2-SAT instance is satisfiable. Note that 2-SAT is decidable in linear time (Aspvall et al. 1979) unlike the NP-complete k-SAT with k3.

The GAP relaxation can be considered as a semidefinite program in the first level of the well-known Lasserre (2001) hierarchy. Anjos (2004b) proposes semidefinite relaxations of SAT in approximately levels two and three of the Lasserre (2001) hierarchy by only adding a subset of products of variables to the moment relaxation. For example, Anjos (2004a) proposes the R2 relaxation, which can be obtained from RF(ϕ) by taking

F={α|αCjfor somej,|α|odd,orα=}.(12)

Anjos (2004a) proves that the R2 relaxation attains a rank-two guarantee on 3-SAT instances: whenever the SDP admits a feasible matrix of rank two or lower, the corresponding SAT instance is satisfiable. We now prove that, for a different F than (12), the resulting relaxation RF(ϕ) provides the same rank-two guarantee.

Theorem 1.

Let ϕ be a 3-SAT instance and F={α[n]|αCjfor some j,|α|1}. Let Y be the matrix variable of RF(ϕ) indexed by elements of F. If RF(ϕ) admits a feasible rank-two matrix, then ϕ is satisfiable.

Proof.

See Online Appendix A. □

4. Sum of Squares and MAX-SAT

In Section 4.1, we first provide an overview of the approach of van Maaren et al. (2008) for deriving relaxations for MAX-SAT. Their approach exploits SOS optimization, which has received much attention in the literature (see, e.g., Lasserre 2007, Laurent 2009, Scheiderer 2009, Parrilo and Thomas 2020). Relaxations depend on a basis that is used to compute them. We introduce a parametric family of monomial bases with increasing complexity. In Section 4.2, we derive several properties of monomial bases that are later used in our computations.

4.1. General Overview

For a given logical proposition ϕ on n variables and m clauses, the value

Fϕ(x)j=1m12j iCj(1aj,ixi),(13)
for aj,i as in (3) equals the number of unsatisfied clauses by truth assignment x{±1}n. Hence, we are interested in minimizing Fϕ over {±1}n, on which Fϕ is nonnegative. Let R[x] be the set of real polynomials in x. We define
V{f|fj=1kfj2modI,fjR[x]j[k],kN}(14)
as the set of SOS polynomials modulo I, where I is the vanishing ideal of {±1}n. That is,
I=1x12,1x22,,1xn2.(15)

By Putinars Positivstellensatz (Putinar 1993), V is the set of nonnegative polynomials on {±1}n. Generally, optimization over V is intractable because of its size, which is why we consider

Vx{f|fxMxmodI,M0},(16)
where x is some monomial basis. Because M0, it follows that all polynomials of Vx are nonnegative on {±1}n. Therefore, VxV, and we may approximate the minimum of Fϕ by
minx{±1}n Fϕ=sup{λ|FϕλV}sup{λ|FϕλVx}.(17)

The description of Vx shows that computing this lower bound can be done via SDP.

It is important to note that, in the quotient ring of R[x] modulo I, all terms xi21, and thus, it suffices to consider only monomials in x for which the highest power is at most one. Thus, we can write

Fϕ(x)=α[n]pϕαxα,(18)
where pϕαR for all α[n] and xα as in (5). For the constant term of Fϕ(x), we have
pϕ=j=1m12j.(19)

We say that monomial basis x represents a logical proposition ϕ if matrix XxxmodI contains all monomials xα for which pϕα0. We index this matrix X and the matrix M from (16) with subsets α[n] for which xαx. Note that for such α,β[n], we have

Xα,βxαβmodI.(20)

For α[n], we write xαX if X has an entry equal to xα (modulo I). van Maaren et al. (2008) propose multiple monomial bases x, among them basis SOSp, given by

x=1{xi|i[n]}{xixj|iandjappeartogetherinaclause}.(21)

It is stated in van Maaren et al. (2008) that SOSp represents 2-SAT and 3-SAT instances. Whereas this is true, this basis also represents 4-SAT instances (see Lemma 2). We additionally define for QN, as an extension to SOSp, the basis

SOSpQSOSp{xixj|iandjarebothinthetopQappearingvariables}.(22)

Basis SOSpQ takes basis SOSp and adds all the (Q2) quadratic terms of the Q variables appearing in the highest number of clauses of ϕ. Any basis x is considered to have duplicate monomials removed, and so, for small values of Q, bases SOSpQ and SOSp might coincide.

We also define the basis SOSsθ for θ[0,1], which is suited for (MAX-)2-SAT instances. This basis consists of all the monomials of degrees one and zero plus a percentage θ of all quadratic monomials appearing in SOSp. The included quadratic monomials are those that appear in SOSp and attain the highest monomial weight w, which is defined as w(xα)iαw(i), where w(i)|{Cϕ|iC}| for i[n]. This results in the following chain of inclusions:

{xα||α|1}=SOSs0SOSsθSOSs1=SOSp=SOSp0SOSpQSOSpn={xα||α|2}.(23)

We now define, for all γ[n] such that xγX, a set of ordered pairs as follows:

xγ{(α,β)[n]2|αβ=γ,xαx,xβx}.(24)

Set xγ contains the index pairs (α,β) such that Xα,βxγ. Therefore, FϕxMx if and only if

(α,β)xγMα,β=pϕγ,γsuchthatxγX.(25)

Constraints of this form are sometimes referred to as coefficient matching conditions in SOS literature (Zheng et al. 2017). We define

Mϕ{MS|x||(α,β)xγMα,β=pϕγ,γsuch thatxγX},(26)
as the set of matrices satisfying the coefficient matching conditions for all monomials except x.

Note that M is constrained to be symmetric, which is reflected in the definition of xγ, because (α,β)xγ if and only if (β,α)xγ. Moreover, x contains the index pairs of the diagonal entries of M, which correspond to zero-degree monomials in X. Hence, if FϕλxMx, then pϕλ=I,M; see (17) and (19). To maximize the lower bound on Fϕ (see (17)), we maximize λ, which is, thus, equivalent to minimizing I,M. We can, therefore, compute this lower bound by solving the following SDP:

minI,Ms.t.MMϕS+.(Pϕ)

We note that, for the purpose of solving Pϕ through interior point methods, program Pϕ is strictly feasible: for any feasible matrix M, matrix M + I is strictly feasible. The existence of any such feasible matrix M follows from the nonnegativity of Fϕ on {±1}n. We postpone the derivation of the dual of Pϕ to Section 6, in which we also show its strict feasibility in Theorem 2.

4.2. Properties of SOSpQ

We provide several properties of monomial bases that are exploited within the PRSM; see Section 7.

Denote by |xγ| the cardinality of the set xγ; see (24). Because of the symmetry of X (see (20)), |xγ| is an even number and greater than or equal to two. In particular, when |xγ|=2, say xγ={(α,β),(β,α)}, we have

Mα,β+Mβ,α=pϕγandMα,β=Mβ,αMα,β=Mβ,α=pϕγ/2.(27)

Thus, whenever |xγ|=2, the constraint involving xγ in Mϕ (see (26)), simply fixes two entries of M. van Maaren et al. (2008) refer to these constraints arising from |xγ|=2 as unit constraints. In section 7 of van Maaren et al. (2008), the authors empirically show that a high percentage of the constraints of Mϕ are unit constraints. van Maaren et al. (2008) propose as future work the development of an SDP solver that is able to exploit the large number of unit constraints. We propose an algorithm for approximately solving Pϕ in Section 7 that is able to do so.

The following lemma describes the subsets γ that induce unit constraints.

Lemma 1.

Let ϕ be a (MAX-)SAT instance on n variables and m clauses and x a monomial basis that contains at least all of the monomials induced by the SOSp basis; see (21). Then, for all γ[n], we have |xγ|=2pϕγ=0, where pϕγ is a coefficient of Fϕ(x); see (18).

Proof.

See Online Appendix A. □

Lemma 1 implies that, in an implementation that uses the SOSp basis, it is not required to store the coefficients corresponding to unit constraints (because these all equal zero), but only the indices restricted by the unit constraints. The converse of Lemma 1 is generally not true. That is, there can exist many subsets γ[n] for which pϕγ=0, but |xγ|>2.

Lemma 2.

Let ϕ be an SAT instance on n variables and x its monomial basis according to SOSpQ for some QN. Let γ[n]. Then,

  1. |γ|{1,2}|xγ|2n.

  2. |γ|{3,4}|xγ|6.

  3. |γ|>4|xγ|=0.

Proof.

See Online Appendix A. □

Part 3 of Lemma 2 shows that the SOSpQ bases are only suited for (MAX-)k-SAT when k4.

5. Resolution and Monomial Bases

In this section, we consider resolution in combination with the SOS approach to MAX-SAT. Resolution is a technique from mathematical logic and widely employed by MAX-SAT solvers (Prasad et al. 2005). Resolution takes as inputs two clauses of a proposition ϕ and returns a set of new clauses named the resolvent clauses. The resolvent clauses transform ϕ into ϕ by either replacing the original clauses or adding the resolvent clauses to ϕ (depending on which resolution rule is used). We show in this section that the MAX-SAT resolution rule might not be beneficial for the SOS approach applied to MAX-SAT and can even decrease its effectiveness. However, in Section 8.2, we show how to benefit from the SAT resolution rule in partial MAX-SAT.

We show this using an example. For k3, we define the following proposition on k variables:

ϕk{¬x1(x1¬x2)(x2x3)¬x3 if k=3,¬x1(x1¬x2)(x2x3)[j=3k1(¬xjxj+1)]¬xkelse.(28)

It is clear that ϕk is unsatisfiable. If one satisfies the initial two unit clauses and performs unit resolution, more unit clauses appear. Repeating this process leads to an all-false truth assignment, leaving clause x2x3 unsatisfied. Therefore, any truth assignment leaves at least one clause unsatisfied, and hence, minx{±1}kFϕk=Fϕk(1k)=1 for Fϕk as in (13). In the following lemma, we show that the SOSp basis (see (21)), suffices for proving optimality of this assignment.

Lemma 3.

For all k3, we have max{λ|FϕkλVx}=1, where x=SOSp(ϕk), and Vx as in (16).

Proof.

See Online Appendix A. □

Let us now present the MAX-SAT resolution rule (see, e.g., Abramé and Habet 2014). For clauses C1 and C2 of some proposition ϕ, on literals x, zi, i[s] and yi, i[t] construct the clauses below the horizontal line:

C1=[xz1zs],C2=[¬xy1yt]z1zsy1yt,[C1¬y1y2yt],[C1¬y2y3yt],,[C1¬yt],[C2¬z1z2zs],[C2¬z2z3zs],,[C2¬zs].(29)

The MAX-SAT resolution rule states that one may replace clauses C1 and C2 in ϕ with a subset of the 1+s+t resolvent clauses below the horizontal line. Namely, clauses that are trivially satisfied, such as x¬x, are not part of this subset. We refer to the resulting new proposition, obtained after resolution, as ϕ. In Bonet et al. (2007), theorem 4, it is proven that Fϕ=Fϕ; see (13). Note that, in Bonet et al. (2007), definition 6, function Fϕ is stated in terms of {0,1} variables.

For standard MAX-SAT solvers, one of the goals of resolution is to create new unit clauses, which are used to compute upper bounds on the MAX-SAT solution (Abramé and Habet 2014). For our SDP approach, assuming a fixed monomial basis, the sets Mϕ and Mϕ (see (26)), depend only on the coefficients of Fϕ and Fϕ. Because Fϕ=Fϕ, these coefficients are equal, and thus, Mϕ=Mϕ. Note that the feasible set of Pϕ is defined in terms of Mϕ. Hence, it follows that, if given the same basis, program Pϕ equals program Pϕ. This equivalence of programs suggests that MAX-SAT resolution does not change our approach; however, we find that, in general, SOSp(ϕ)SOSp(ϕ); see (21). We investigate the effect of this difference.

Returning to the example of ϕk in (28), let us define Cq=¬xqxq+1. Observe that, for 3qk1,Cqϕk (assuming k > 3). Let us fix some q, 3qk3, and consider the clauses Cq,Cq+1,Cq+2ϕk. We perform resolution as

Cq=[¬xqxq+1],Cq+1=[¬xq+1xq+2][¬xqxq+2],[¬xqxq+1¬xq+2],[xq¬xq+1xq+2].(30)

We perform resolution again on the third new clause obtained in (30) and Cq+2 to obtain

[xq¬xq+1xq+2],Cq+2=[¬xq+2xq+3][xq¬xq+1xq+3],[xq¬xq+1xq+2¬xq+3],[¬xq¬xq+1¬xq+2xq+3],[xq+1¬xq+2xq+3],(31)
and, here, the resolution rule states that one may replace the original clauses C1, C2, and C3 with the six new resolvent clauses obtained from (30) and (31) (the third resolvent from (30) is not counted because it is replaced in the resolution in (31)).

Observe that the SOSp basis generates six quadratic monomials for the new resolvent clauses, whereas originally, only three quadratic monomials are generated for Cq, Cq+1, and Cq+2. We now define ϕk for k6 as the logical proposition, obtained by taking ϕk and performing resolution as in (30) and (31) for each triple of clauses {Cq,Cq+1,Cq+2} for each q{3,6,9,,k3} (let us assume here that k is a multiple of three). Note that proposition ϕk constitutes a MAX-4-SAT instance, and therefore, basis SOSp is applicable. Let us compare the sizes of the resulting SOSp bases, denoted as |SOSp|. We have |SOSp(ϕk)|=2k<3k3=|SOSp(ϕk)|.

Thus, compared with SOSp(ϕk), basis SOSp(ϕk) adds approximately k monomials. None of these monomials strengthens the bound because SOSp(ϕk) is already sufficient for proving optimality by Lemma 3. It is clear that having a larger basis without offering a stronger bound is inefficient because solving Pϕ requires more time for larger matrices.

The example of ϕk and ϕk shows that not all monomials are (equally) useful in determining bounds. It also shows that resolution can decrease the effectiveness of the SOS approach to MAX-SAT by providing “bad” monomial bases or it can occur that the SOSp basis misses “good” monomials. Our proposed basis SOSpQ (see (22)) attempts to solve this issue.

6. Relating Sum of Squares and Method of Moments

In this section, we show how the SOS-SDP relaxation of van Maaren and van Norden (2005) and van Maaren et al. (2008) and moment relaxations of Anjos (2004a, b; 2005; 2006; 2007) are related. The relaxations of Anjos as described in Section 3 are first introduced in Anjos (2004a) and can be considered as extensions of the GAP relaxation via the well-known Lasserre (2001) hierarchy. van Maaren and van Norden (2005) propose the SOS approach to (MAX-)SAT. Subsequently, van Maaren and van Norden (2005) show that the SOS relaxation, using monomial basis SOSpt that is larger than SOSp (see (21)) outperforms the R3 relaxation of Anjos (2005) in deciding on the satisfiability of 3-SAT instances. The R3 relaxation is known to dominate the R2 relaxation; see (12). Anjos (2007) strengthened his R3 relaxation further and left it as future work to determine which SDP relaxation was the strongest.

We complete that work here by showing a simple relation between the two approaches. In particular, Anjos’ relaxations can be considered as method of moments in the Lasserre (2001) hierarchy. It is well-known that method of moments is dual to SOS optimization (see Lasserre 2001), and we work out the details here. Let us first derive the dual of the SOS program Pϕ (see Theorem 2) and then relate it to the here proposed strengthened version of Anjos’ relaxations.

To this end, we require the following intermediate result on vϕ; see (7).

Lemma 4.

Let ϕ=j=1mCj be a logical proposition, vϕ=α[n]vϕαxα (see (7)), and Fϕ=α[n]pϕαxα; see (18). Then, vϕ=mFϕ. and vϕα=pϕα for all nonempty α[n].

Proof.

See Online Appendix A. □

Let x be a given monomial basis, SS|x|. Matrix S is indexed by all α[n] for which xαx. To simplify the comparison between the SOS approach and the relaxations of Anjos (2004a), we define the set

Xϕ{SS|diag(S)=1,Sα,β=Sα,β(α,β,α,β)[n] s.t. αβ=αβ},(32)
for a proposition ϕ on n variables and m clauses. Note that Xϕj[m]Δj (see (11)) because Δj only restricts entries Sα,β whenever α and β are jointly contained in a single clause. We use Xϕ in the following theorem.

Theorem 2.

Let ϕ be a logical proposition and x a monomial basis. The SOS program Pϕ defined by ϕ and x is equivalent to

maxC,Ss.t.SXϕS+,(33)
where Xϕ is given by (32) and CS|x|, indexed by the subsets α[n] for which xαx, is any matrix that satisfies (α,β)xγCα,β=vϕγ,γ,xγ for vϕγ as in (7). Moreover, (33) is strictly feasible.

Proof.

We rewrite program Pϕ by splitting the matrix variable M as follows:

vminI,Ms.t.M=Z,MMϕ,ZS+,(34)
where Mϕ as in (26). We dualize the constraint M = Z, and set
g(S)minMMϕ,Z0I,M+S,MZ,
for some SS. Clearly, g(S)v for all S, and we, thus, look to maximize g(S); that is,
maxSg(S)=maxS[minMMϕI+S,M+minZ0S,Z]=maxS0minMMϕI+S,M=maxS0minMMϕIS,M.(35)

We now determine the set Xϕ such that, whenever SXϕ, the minimization over MMϕ in (35) is bounded. Observe that Mϕ places no restrictions on the diagonal. To guarantee a bounded minimum, set Xϕ should restrict diag(IS)=0. Each off-diagonal element of a matrix in Mϕ is restricted by a single constraint of the form (25). Therefore, solving (35) for M can be done by considering separately the elements of M restricted by a single constraint. That is,

minMSγX(α,β)xγSα,βMα,βs.t.(α,β)xγMα,β=pϕγ,(36)
where xγ and X are defined in (24) and (20), respectively. This minimization problem is bounded if and only if
Sα,β=Sα,β,(α,β),(α,β)xγxγX,(37)
or equivalently, Sα,β=Sα,β for all possible index pairs (α,β) and (α,β) that satisfy αβ=αβ. It follows that Xϕ is given by (32). Now, for fixed SXϕS+, any matrix MMϕ obtains the same value in (35). Note also that, w.l.o.g., we may fix M=PMϕ(0), that is, the projection of the zero matrix onto Mϕ (see Lemma 5), which has zero diagonal. This yields the equivalent program of the form (33) for C=M=PMϕ(0). Written explicitly, Cα,β=pϕγ/|xγ| for all α,β[n] such that αβ=γ (i.e., (α,β)xγ). This, combined with Lemma 4, proves the claim on matrix C. Finally, observe that the identity matrix of appropriate size is strictly feasible for (33). □

We define, for SXϕ and each clause Cj, the function vSDP(S,Cj), which is obtained by taking (6) and replacing each xγ by Sα,β for some (α,β)xγ. By (37), we are allowed to pick any such (α,β). By Lemma 4, for any nonempty γ[n],SXϕ and C as in Theorem 2, we have

(α,β)xγCα,βSα,β=(α,β)xγpϕγ|xγ|Sα,β=pϕγSα,β=vϕγSα,β.(38)

Hence, maximizing C,S is equivalent to maximizing the semidefinite relaxation of vϕ (see (7)), which equals j[m]vSDP(S,Cj).

Moreover, in the relaxations of Anjos (2004a) outlined in Section 3, the matrix variable is restricted to satisfy vSDP(S,Cj)=1. Now, we can easily observe the difference between the SOS-SDP relaxations and those proposed by Anjos. We present the equivalent dual formulation of the SOS approach on the left-hand side and the latter (in slightly adapted form) on the right.

v*=maxj[m]vSDP(S,Cj)s.t.SXϕS+.(39)
findSXϕS+s.t.vSDP(S,Cj)=1,Cj.(40)

Note again the difference between (40) and the relaxations described in Section 3, resulting from using set Xϕ instead of the intersection of the Δj; see (11). Thus, we compare the SOS approach with a strengthened variant of the relaxation proposed by Anjos. In Section 8.3, we determine the dual of (40).

Program (39) proves the unsatisfiability of ϕ if v*<m (with some margin of error because of numerical precision), whereas (40) does so whenever the program is infeasible. These programs are not equivalent in this sense: we empirically find instances ϕ for which v*m, whereas (40) is infeasible. Neither program can directly prove satisfiability. However, solutions to both programs can be used to guide the search toward satisfying assignments (should they exist); see Online Appendix C.

If (40) admits a feasible matrix S*, then matrix S* is clearly also feasible for (39) and attains an objective value of m. Consequently, in this case, we have v*m. Thus, if (40) does not prove unsatisfiability of ϕ, then neither does (39). In Online Appendix F, we show that (39) can be computed efficiently by applying the PRSM to its dual.2 It is currently unclear whether a good algorithm for solving (40) exists, and if so, how efficient it would be. Previous numerical experiments on (40) use general purpose SDP solvers. An immediate improvement might be to use an SDP feasibility problem solver (see Henrion and Malick 2011, Drusvyatskiy et al. 2017).

Finally, the objective value of (39) is more useful for MAX-SAT: if the underlying instance is infeasible, v* provides an upper bound to the number of satisfiable clauses, which is useful in a B&B scheme. Program (40) might also show unsatisfiability of the same instance, but its infeasibility offers no additional value as to how unsatisfiable the instance is.

7. The Peaceman–Rachford Splitting Method for MAX-SAT

In this section, we introduce the Peaceman–Rachford splitting method (Peaceman and Rachford 1955) for solving SOS-SDP problems and apply it to the MAX-SAT SOS program Pϕ. Conventionally, interior point methods are used to solve SDP problems. However, for medium- and large-size instances, interior point methods suffer from a large computation time and memory demand, which has recently motivated researchers to consider first order methods, such as the PRSM. For recent applications of PRSM to SDP, see, for example, de Meijer and Sotirov (2021) and Graham et al. (2022).

Section 7.2 and Online Appendix C provide details on obtaining valid upper and lower bounds from the output of the PRSM algorithm.

7.1. The PRSM for SOS Relaxations of MAX-SAT

We start from the reformulation of Pϕ given in (34). The augmented Lagrangian function of (34) with respect to (w.r.t.) the constraint M = Z for a penalty parameter β>0 is

Lβ(Z,M,S)=I,M+S,MZ+β2MZF2.(41)

Here, SSn is the Lagrange multiplier and ·F denotes the Frobenius matrix norm; see Section 1.1.

The PRSM now entails iteratively optimizing over the variables Z and M separately and updating S twice per cycle. We write superscript k to denote the the value of the variable at iteration k:

{Zk+1=arg minZ0 Lβ(Z,Mk,Sk)=PS+(Mk+1βSk),Sk+1/2=Sk+γ1β(MkZk+1),Mk+1=arg minMMϕ Lβ(Zk+1,M,Sk+1/2)=PMϕ(Zk+11β[I+Sk+1/2]),Sk+1=Sk+1/2+γ2β(Mk+1Zk+1).(42)

Here, Mϕ is as in (26), and P is the projection operator as in (4). We use that

arg minZ0 Lβ(Z,M,S)=arg minZ0I,M12βSF2+β2Z(M+1βS)F2=arg minZ0β2Z(M+1βS)F2,(43)
see, for example, Oliveira et al. (2018). In an implementation of (42), one should not store matrix Sk directly but, rather, the matrix 1βSk; see Online Appendix G. When XS has eigenvalues λi and corresponding eigenvectors vi, it is well-known that the projection onto the positive semidefinite cone is given by
PS+(X)={i|λi>0}λivivi=X{i|λi<0}λivivi.(44)

Depending on the number of positive eigenvalues of X, one of these expressions is cheaper to compute. The next lemma shows how to compute a projection onto Mϕ.

Lemma 5.

Let matrices M,M^S, indexed by subsets of [n] such that M^=PMϕ(M), where the projection operator PMϕ(·) is given by (4). Then, diag(M^)=diag(M) and

M^δ,μ=Mδ,μ1|xγ|((α,β)xγMα,βpϕγ),(45)
for (δ,μ)xγ,γ. In particular, when |xγ|=2, (45) reduces to M^δ,μ=M^μ,δ=pϕγ/2.

Proof.

See Online Appendix A. □

Because of the presence of many unit constraints (see (27)), these projections are computationally cheap to compute, and hence, the PRSM is well-suited to exploit this. Finally, it is proven (He et al. 2016) that (42) converges for (γ1,γ2)D, where

D={(γ1,γ2)|γ1+γ2>0,|γ1|<1,0<γ2<1+52,|γ1|<1+γ2γ22}.(46)

The values that we choose for (γ1,γ2) and other parameters are given in Online Appendix F.

7.2. Upper Bounds, Lower Bounds, and Early Stopping

After each PRSM iterate k, we obtain a triple (Zk,Mk,Sk) and the resulting I,Mk. Although this value converges to the optimal solution of the SDP, the convergence is (typically) not monotonic, and therefore, this value does not necessarily provide a valid upper bound for the problem. In this section, we describe how to obtain a valid upper bound from the output of the PRSM.

Observe that the feasible set of Pϕ depends on the chosen monomial x through Vx; see (16). Hence, by (17), we have

pϕminMMϕS+I,M=supλR{λ|FϕλVx}minx{±1}nFϕ,(47)
for pϕ as in (19). From this, it follows that the maximum number of satisfiable clauses of ϕ is bounded from above by
mpϕ+minMMϕS+I,M,(48)
for m equal to the number of clauses in ϕ. Because the number of satisfied clauses is an integer, the bound (48) can be improved by rounding down the result.

Ideally, the PRSM algorithm (42) computes the upper bound (48) by finding the optimal M in the set MϕS+ (up to some given numerical precision). However, in practice, one terminates the PRSM algorithm before this optimal M is found. Let matrix Mk then be defined as in (42) and let λmin(Mk) be its smallest eigenvalue. Note that

M˜k=Mkλmin(Mk)IMϕS+,(49)
and so M˜k is feasible for Pϕ. Thus, a valid upper bound at iteration k is obtained as follows:
mpϕ+I,M˜k.(50)

In Online Appendix C, we outline a method for determining lower bounds when using the PRSM.

8. Weighted Partial MAX-SAT

In this section, we extend the SOS approach from MAX-SAT to weighted partial MAX-SAT. We also show that the dual formulation of the SOS program for certain partial MAX-SATs equals the relaxations by Anjos (2005).

In weighted MAX-SAT, each clause is given a weight, and the objective is to maximize the sum of the weights of the satisfied clauses. In partial MAX-SAT, clauses are divided into soft and hard clauses. The aim is to maximize the number of satisfied soft clauses, satisfying all the hard clauses. The combination of weighted and partial MAX-SAT is clear and referred to as weighted partial MAX-SAT (Li and Manya 2021).

Consider again a logical proposition ϕ. Let wjR be the weight associated to clause Cj. The generalization of (13) for (unweighted) MAX-SAT to weighted MAX-SAT follows by setting

FϕW(x)=j=1mwj2j iCj(1aj,ixi),(51)
and then minimizing FϕW for x{±1}n. This minimization can be approximated by SOS optimization, using directly the semidefinite program Pϕ.

For weighted partial MAX-SAT, consider a logical proposition ϕ on n variables, m soft clauses Cj, and q hard clauses CpH. To each hard clause CpH,p[q], we associate the polynomial fp=i[n](1ap,ixi), similar to (51). Note that fp vanishes for all truth assignments that satisfy clause CpH. Similar to (14) and (16), we define the sets

Hx{p[q]cpfpmodI|cpRp[q]}H{p[q]gpfpmodI|gpR[x]p[q]}.(52)

Let SAT{±1}n be the set of all truth assignments satisfying the hard clauses (which we assume to be nonempty). From Putinar (1993), it follows that

minxSAT FϕW(x)=sup{λ|FϕWλV+H}sup{λ|FϕWλVx+Hx},(53)
where “+” denotes the Minkowski sum of sets. We proceed by writing the lower bound in (53) as an explicit SDP for which we introduce the following sets: Hγ{p[q]|γCpH} for γ[n]. Set Hγ contains all p for which fp, when expanded, contains the term ±xγ. The sign here is determined by the parity of |γIp+|; see (2). Additionally, we define as analogue to Mϕ (see (26)), the set MϕH. This set contains all matrices M and vectors c such that FϕWλxMx+p[q]cpfpmodI. It is, therefore, defined as
MϕH{(M,c)S×Rq|(α,β)xγMα,β+pHγ(1)|γIp+|cp=pϕγ,γs.t.xγX}.(54)

This allows us to adapt Pϕ to weighted partial MAX-SAT as follows:

minI,M+p[q]cps.t.(M,c)MϕH,MS+.(55)

We approximately solve (55) by the PRSM; see Section 8.1. Let us elaborate on how to adapt the monomial bases to (weighted) partial MAX-SAT. We make no distinction between soft and hard clauses for the SOSp basis; see (21). For basis SOSsθ (see (23)), we determine the variable weights as w(i){j|iCj}wj+{p|iCpH}w¯ for w¯ the mean of all soft clause weights wj. For basis SOSpQ, we add all (Q2) quadratic terms of the Q variables that attain the highest value of w(i). For unweighted partial MAX-SAT instances, we consider all wj to equal one.

8.1. The PRSM for SOS Relaxations of Weighted Partial MAX-SAT

We show here how to solve (55) by the PRSM. We first rewrite (55) by introducing the matrix variable Z (see also (34)):

minI,M+p[q]cps.t.M=Z,(M,c)MϕH,ZS+.(56)

Then, the augmented Lagrangian function of (56) w.r.t. Z = M and for a penalty parameter β>0 is Lβ(Z,M,S,c)Lβ(Z,M,S)+1c; see (41). The PRSM is iteratively and separately optimizing over (M,c)MϕH and ZS+ and updating S twice per cycle, similarly to (42). However, in this case, the M-subproblem from (42) is replaced by the (M, c)-subproblem.

We now show that minimization over (M,c)MϕH can be performed efficiently. By derivations similar to (43), we have

arg min(M,c)MϕH Lβ(Z,M,S,c)=arg min(M,c)MϕHMXF2+2β1c,(57)
where XZ(S+I)/β. This is a convex quadratic program (QP) that we solve in two steps. First, consider the matrix entries Mα,β with (α,β)xγ (see (24)) and Hγ=. Because Hγ=, these entries are unaffected by the cp variables. This implies that these Mα,β variables are not coupled with the other entries of M, and one can minimize separately over such Mα,β. This separate minimization problem can be solved by applying Lemma 5. Second, the remaining QP
min{γ|Hγ}(α,β)xγ(Mα,βXα,β)2+2β1c,(58)
can be simplified by the following observation. If M* is an optimal solution to (57), then (α,β),(α,β)xγMα,β*Xα,β=Mα,β*Xα,β. Hence, (58) can be simplified by substituting each term (α,β)xγ(Mα,βXα,β)2 with a single squared variable. We solve the resulting QP either by solving the Karush–Kuhn–Tucker conditions using the lower-upper decomposition or via MOSEK ApS (2023). The solving method depends on the underlying QP.

8.2. Strengthening the Bounds

We demonstrate a simple technique for improving the upper bounds given by Program (55). This technique is based on the SAT resolution rule, which is given as follows. For two hard clauses of some proposition ϕ, on literals x, zi, i[s] and yi, i[t], construct the clause below the horizontal line:

[xz1zs],[¬xy1yt]z1zsy1yt.(59)

In contrast to the MAX-SAT resolution rule (29), the SAT resolution rule states that one may add the clause below the horizontal line to ϕ without changing its (un)satisfiability (we say that the new clause is implied by the original two clauses). We may apply this SAT resolution rule to the hard clauses of a partial MAX-SAT instance to generate more hard clauses. As each new clause induces a new variable cp, the bound of Program (55) can only improve. One may also regard SAT resolution as extending the set Hx (see (52)), by including terms of the form cpxαfp for some α[n], where cpR.

Additionally, SAT resolution can generate hard unit clauses. This is advantageous because hard unit clauses reduce the number of variables in MAX-SAT; see Section 1.2.

8.3. Duality in Partial MAX-SAT

Now, we consider a partial MAX-SAT with only hard clauses. Solving such instances is, thus, equivalent to determining the satisfiability of the given hard clauses. We show that, by taking the dual of the resulting SOS program, one obtains (a stronger version of) the relaxations of Anjos (2004a) given by (40).

We define, for ASn,vec(A)Rn2 the vector whose entries are the columns of A stacked together. We start from Program (55) and perform variable splitting on M, similar to (34). We take the dual g(S) of this formulation, similar to (35), and consider the problem

maxS g(S)=maxSXϕS+min(M,c)MϕHS,M+1c,(60)
for Xϕ as in (32). The steps that show SXϕS+ is necessary for the expression to be finite are provided in the proof of Theorem 2. We rewrite the inner minimization problem in (60) as
min(M,c)MϕH[vec(S)1][vec(M)c],(61)
and proceed to show under which conditions this value is bounded. Observe that the coefficients pϕγ=0 (see (54)) because there are no soft clauses. Moreover, the set MϕH places only linear constraints on the entries of M and c. Therefore, there exists a matrix D that satisfies
(M,c)MϕHD[vec(M)c]=0.(62)

Hence, (61) is bounded if and only if [vec(S)1] is contained in the row space of D. This is precisely the requirement that vSDP(S,CpH)=1,p[q] as in (40). We provide one example of this claim in Online Appendix D.

Thus, (61) is bounded if [vec(S)1]row(D), in which case, the value equals zero. Hence, Program (60) is equivalent to (40).

9. Conclusions and Future Work

In this paper, we consider SOS optimization for solving MAX-SAT and weighted partial MAX-SAT. We design an SOS-SDP–based exact MAX-SAT solver called SOS-MS. Our solver is competitive with the best known solvers on solving various (weighted partial) MAX-SAT instances. We are also first to compute SDP bounds for weighted partial MAX-SAT.

In Section 3, we propose a family of semidefinite feasibility problems RF(ϕ) and show that one member of this family provides the rank-two guarantee; see Theorem 1. That is, the existence of a feasible rank-two matrix implies satisfiability of the corresponding SAT instance. In Section 4, we outline the SOS approach to MAX-SAT from van Maaren et al. (2008) and propose new bases. We introduce the SOSsθ and SOSpQ bases (see (23)) and provide several theoretical results related to these bases; see Lemmas 1 and 2. Clearly, the strength of the SOS-SDP–based relaxations and the required time to compute them depend on the chosen monomial basis. The SOS-SDP relaxation for MAX-SAT is denoted by Pϕ. We consider MAX-SAT resolution in Section 5 and show that resolution might not be beneficial for the SOS approach applied to MAX-SAT.

In Section 6, we elegantly show a connection between the SOS approach to MAX-SAT and the family of semidefinite feasibility problems RF(ϕ). This is done by deriving the dual problem to Pϕ; see Theorem 2. In Section 7, we propose the PRSM for solving Pϕ. We show that PRSM is well-suited for exploiting the structure of Pϕ, in particular, the unit constraints; see (27). We, thus, provide an affirmative answer to the key question posed by van Maaren et al. (2008) regarding whether SDP software can be developed dealing with unit constraints efficiently.

We extend the SOS approach for MAX-SAT to weighted partial MAX-SAT in Section 8. Here, the variables are restricted to satisfy a set of hard clauses. We show that such hard clauses can be incorporated in the SOS program Pϕ by adding scalar variables. We show in Section 8.1 that the resulting Program (55) is also well-suited for the PRSM.

In Online Appendix E, we provide implementation details of our SOS-SDP–based MAX-SAT solver, whose pseudocode is given in Online Algorithm 1. SOS-MS is a B&B algorithm and has two crucial components. The first one is the use of warm starts to program Pϕ, in order to quickly obtain strong bounds. The second one is its ability to quickly parse Pϕ as outlined in Online Appendix E.1. Our algorithm parses a basis that contains 4,439,449 monomials in (approximately) one second (!).

In Online Appendix F, we provide extensive numerical results that verify efficiency of our exact solver SOS-MS and quality of SOS upper bounds. We show that SOS-MS can solve a variety of MAX-SAT instances in reasonable time, solving some instances faster than the best solvers in the MSE-2016. We show that the SOSpQ bases (22) are able to prove optimality of some MAX-SAT instances and the parameter Q provides the option to adjust the trade-off between quality of the bounds and computation time. We also test our B&B algorithm for (weighted) partial MAX-SAT instances in Online Appendices F.2 and F.4. Our solver is able to solve many (weighted) partial MAX-SAT instances in a reasonable time.

This paper demonstrates the strong performance of SOS-MS on (weighted partial) MAX-SAT instances from the MSE random track. In the future, we hope to also solve instances with SOS-MS from the so-called industrial and crafted tracks. These tracks currently impose two challenges on SOS-MS. First, these instances induce prohibitively large SOSp bases, which hinders the computation of strong bounds. To solve this, we require a more sophisticated method for choosing a smaller, manageable, basis, such as SOSsθ. Second, these instances can possess clauses of length k, where k4. This is problematic in the current settings because Fϕ (see (13)) is a kth degree polynomial, which requires a large basis to be represented. One possible way to overcome these challenges is through exploiting the structure present in these instances. For example, function Fϕ might have few nonzero coefficients, which allows for finding SOS decompositions with small monomial bases, using methods proposed in Wang et al. (2021); see also Ahmadi et al. (2017).

Endnotes

1 Our PRSM implementation is available at https://github.com/LMSinjorgo/SOS-SDP_MAXSAT.

2 Program (39) can also be directly solved with the PRSM as projecting onto Xϕ is computationally cheap.

References

  • Abramé A, Habet D (2014) Ahmaxsat: Description and evaluation of a branch and bound Max-SAT solver. J. Satisfiability Boolean Model. Comput. 9(1):89–128.CrossrefGoogle Scholar
  • Ahmadi AA, Hall G, Papachristodoulou A, Saunderson J, Zheng Y (2017) Improving efficiency and scalability of sum of squares optimization: Recent advances and limitations. Astolfi A, chairman. 2017 IEEE 56th Annual Conf. Decision Control (IEEE, Piscataway, NJ), 453–462.Google Scholar
  • Anjos MF (2004a) On semidefinite programming relaxations for the satisfiability problem. Math. Methods Oper. Res. 60(3):349–367.CrossrefGoogle Scholar
  • Anjos MF (2004b) Proofs of unsatisfiability via semidefinite programming. Ahr D, Fahrion R, Oswald M, Reinelt G, eds. Operations Research Proceedings 2003 (Springer-Verlag, Berlin).Google Scholar
  • Anjos MF (2005) An improved semidefinite programming relaxation for the satisfiability problem. Math. Programming 102(3):589–608.CrossrefGoogle Scholar
  • Anjos MF (2006) Semidefinite optimization approaches for satisfiability and maximum-satisfiability problems. J. Satisfiability Boolean Model. Comput. 1(1):1–47.Google Scholar
  • Anjos MF (2007) An extended semidefinite relaxation for satisfiability. J. Satisfiability Boolean Model. Comput. 4(1):15–31.CrossrefGoogle Scholar
  • Asín Achá R, Nieuwenhuis R (2014) Curriculum-based course timetabling with SAT and MaxSAT. Ann. Oper. Res. 218(1):71–91.CrossrefGoogle Scholar
  • Aspvall B, Plass MF, Tarjan RE (1979) A linear-time algorithm for testing the truth of certain quantified Boolean formulas. Inform. Processing Lett. 8(3):121–123.CrossrefGoogle Scholar
  • Bonet ML, Levy J, Manya F (2007) Resolution for Max-SAT. Artificial Intelligence 171(8–9):606–618.CrossrefGoogle Scholar
  • Boyd S, Parikh N, Chu E, Peleato B, Eckstein J (2011) Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations Trends Machine Learning 3(1):1–122.Google Scholar
  • Cook SA (1971) The complexity of theorem-proving procedures. Lewis PM, chairman. Proc. Third Annual ACM Sympos. Theory Comput. (Association for Computing Machinery, New York), 151–158.Google Scholar
  • de Klerk E, van Maaren H, Warners J (2000) Relaxations of the satisfiability problem using semidefinite programming. J. Automatic Reasoning 24(1):37–65.CrossrefGoogle Scholar
  • de Meijer F, Sotirov R (2021) SDP-based bounds for the quadratic cycle cover problem via cutting-plane augmented Lagrangian methods and reinforcement learning: Informs journal on computing meritorious paper awardee. INFORMS J. Comput. 33(4):1262–1276.AbstractGoogle Scholar
  • Drusvyatskiy D, Li G, Wolkowicz H (2017) A note on alternating projections for ill-posed semidefinite feasibility problems. Math. Programming 162(1):537–548.CrossrefGoogle Scholar
  • Gabay D, Mercier B (1976) A dual algorithm for the solution of nonlinear variational problems via finite element approximations. Comput. Math. Appl. 2(7):17–40.CrossrefGoogle Scholar
  • Gattermann P, Großmann P, Nachtigall K, Schöbel A (2016) Integrating passengers’ routes in periodic timetabling: A SAT approach. Goerigk M, Werneck RF, eds. 16th Workshop Algorithmic Approaches Transportation Model. Optim. Systems (Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Wadern, Germany), 3:1–3:15.Google Scholar
  • Goemans MX, Williamson DP (1995) Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. J. ACM 42(6):1115–1145.CrossrefGoogle Scholar
  • Graham N, Hu H, Im J, Li X, Wolkowicz H (2022) A restricted dual Peaceman-Rachford splitting method for a strengthened DNN relaxation for QAP. INFORMS J. Comput. 34(4):2125–2143.LinkGoogle Scholar
  • Halperin E, Zwick U (2001) Approximation algorithms for MAX 4-SAT and rounding procedures for semidefinite programs. J. Algorithms 40(2):184–211.CrossrefGoogle Scholar
  • Håstad J (2001) Some optimal inapproximability results. J. ACM 48(4):798–859.CrossrefGoogle Scholar
  • He B, Ma F, Yuan X (2016) Convergence study on the symmetric version of ADMM with larger step sizes. SIAM J. Imaging Sci. 9(3):1467–1501.CrossrefGoogle Scholar
  • Henrion D, Malick J (2011) Projection methods for conic feasibility problems: Applications to polynomial sum-of-squares decompositions. Optim. Methods Software 26(1):23–46.CrossrefGoogle Scholar
  • Karloff H, Zwick U (1997) A 7/8-approximation algorithm for MAX 3SAT? Torwick I, ed. Proc. 38th Annual Sympos. Foundations Comput. Sci. (IEEE, Piscataway, NJ), 406–415.Google Scholar
  • Kautz H, Selman B (1999) Unifying SAT-based and graph-based planning. Dean T, ed. Proc. Sixteenth Internat. Joint Conf. Artificial Intelligence—Volume 1 (Morgan Kaufmann Publishers Inc., San Francisco), 318–325.Google Scholar
  • Lasserre JB (2001) Global optimization with polynomials and the problem of moments. SIAM J. Optim. 11(3):796–817.CrossrefGoogle Scholar
  • Lasserre JB (2007) A sum of squares approximation of nonnegative polynomials. SIAM Rev. 49(4):651–669.CrossrefGoogle Scholar
  • Laurent M (2009) Sums of squares, moment matrices and optimization over polynomials. Putinar M, Sullivant S, eds. Emerging Applications of Algebraic Geometry (Springer, New York), 157–270.CrossrefGoogle Scholar
  • Lewin M, Livnat D, Zwick U (2002) Improved rounding techniques for the MAX 2-SAT and MAX DI-CUT problems. Cook WJ, Schulz AS, eds. Internat. Conf. Integer Programming Combin. Optim. (Springer), 67–82.Google Scholar
  • Li CM, Manya F (2021) MaxSAT, hard and soft constraints. Biere A, Heule M, van Maaren H, Walsh T, eds. Handbook of Satisfiability, Frontiers in Artificial Intelligence and Applications, vol. 336 (IOS Press, Amsterdam), 903–927.CrossrefGoogle Scholar
  • Marques-Silva JP, Sakallah KA (2000) Boolean satisfiability in electronic design automation. De Micheli G, chairman. Proc. 37th Annual Design Automation Conf. (Association for Computing Machinery, New York), 675–680.Google Scholar
  • Mendonca M, Wa¸sowski A, Czarnecki K (2009) SAT-based analysis of feature models is easy. McGregor JD, Muthig D, eds. Proc. 13th Internat. Software Product Line Conf. (Carnegie Mellon University, Pittsburgh), 231–240.Google Scholar
  • MOSEK ApS (2023) The MOSEK optimization toolbox for MATLAB manual, Version 10.0.20. Accessed January 2023, https://docs.mosek.com/10.0/toolbox/index.html.Google Scholar
  • Oliveira DE, Wolkowicz H, Xu Y (2018) ADMM for the SDP relaxation of the QAP. Math. Programming Comput. 10(4):631–658.CrossrefGoogle Scholar
  • Parrilo PA, Thomas RR, eds. (2020) Sum of Squares: Theory and Applications. Proc. Sympos. Appl. Math., vol. 77 (American Mathematical Society, Providence, RI).CrossrefGoogle Scholar
  • Peaceman DW, Rachford HH Jr (1955) The numerical solution of parabolic and elliptic differential equations. J. Soc. Indust. Appl. Math. 3(1):28–41.CrossrefGoogle Scholar
  • Prasad MR, Biere A, Gupta A (2005) A survey of recent advances in SAT-based formal verification. Internat. J. Software Tools Tech. Transfer 7(2):156–173.CrossrefGoogle Scholar
  • Putinar M (1993) Positive polynomials on compact semi-algebraic sets. Indiana Univ. Math. J. 42(3):969–984.CrossrefGoogle Scholar
  • Scheiderer C (2009) Positivity and sums of squares: A guide to recent results. Putinar M, Sullivant S, eds. Emerging Applications of Algebraic Geometry (Springer, New York), 271–324.CrossrefGoogle Scholar
  • van Maaren H, van Norden L (2005) Sums of squares, satisfiability and maximum satisfiability. Bacchus F, Walsh T, eds. Internat. Conf. Theory Appl. Satisfiability Testing (Springer, New York), 294–308.Google Scholar
  • van Maaren H, van Norden L, Heule MJ (2008) Sums of squares based approximation algorithms for MAX-SAT. Discrete Appl. Math. 156(10):1754–1779.CrossrefGoogle Scholar
  • Wang J, Magron V, Lasserre JB (2021) Chordal-TSSOS: A moment-SOS hierarchy that exploits term sparsity with chordal extension. SIAM J. Optim. 31(1):114–141.CrossrefGoogle Scholar
  • Wang PW, Zico Kolter J (2019) Low-rank semidefinite programming for the MAX2SAT problem. Van Hentenryck P, Zhou Z-H, program chairs. Proc. Conf. AAAI Artificial Intelligence, vol. 33 (AAAI Press, Palo Alto, CA), 1641–1649.Google Scholar
  • Zheng Y, Fantuzzi G, Papachristodoulou A (2017) Exploiting sparsity in the coefficient matching conditions in sum-of-squares programming using ADMM. IEEE Control Systems Lett. 1(1):80–85.CrossrefGoogle Scholar