On Solving MAX-SAT Using Sum of Squares
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 -complete. SAT is the first problem proven to be -complete, which implies that any problem contained in the complexity class 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 . 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 , we write . 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,
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 , indicating the variables appearing in Cj. Moreover, we define as the set of unnegated variables appearing in Cj. Similarly, is defined as the set of negated variables appearing in Cj. Thus, the clause associated with Cj reads
We refer to both xi and as literals. For example, the literal is true if xi is false. We denote the length of a clause by ; thus, . We say that constitutes a (MAX-)k-SAT instance if .
The SAT problem is to decide, given , whether a satisfying truth assignment to the variables xi, exists. The MAX-SAT problem is to find an assignment that satisfies the largest number of clauses. We associate to each clause a vector , having entries according to
We write for the set of symmetric n × n matrices and 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 and 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 denotes the zero matrix of m rows and n columns. For , we define the trace inner product as . We write if and only if . The Frobenius norm of a symmetric matrix X is given by . For and , we set
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:
For all .
For all .
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 (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 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 is referred to as a truth assignment. As proposed by Goemans and Williamson (1995), we define a truth function such that, given a logical proposition evaluated for some truth assignment, if and only if is satisfied and zero otherwise. This property uniquely determines v; that is, And, in general, for a clause of length , we have
Assuming now that represents a MAX-2-SAT instance on n variables, the corresponding MAX-2-SAT can be formulated as
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,
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 , for any there exists no 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
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 the truth assignment to the variables. Consider a family of subsets , let , and define . It is clear that , diag, and . Later, to obtain a semidefinite relaxation of SAT, we omit the rank-one constraint.
We index the matrix Y with the elements of and define for all subsets γ contained in some clause of the expression
The expression can refer to multiple entries of Y. By construction of Y, these entries are equal. Stated formally, we have , where
Observe that the sets Δj do not capture all equalities present in Y because of the restriction . 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 (see (6)) for all . We can rewrite this constraint in terms of ; see (10). We now omit the rank-one constraint on Y to obtain the following semidefinite feasibility program, denoted by :
The program contains both the GAP relaxation and the relaxations proposed by Anjos (2004b) as special cases. Specifically, one obtains the GAP relaxation from by taking . 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 .
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 by taking
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 than (12), the resulting relaxation provides the same rank-two guarantee.
Let be a 3-SAT instance and . Let Y be the matrix variable of indexed by elements of . If admits a feasible rank-two matrix, then is satisfiable.
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
By Putinars Positivstellensatz (Putinar 1993), is the set of nonnegative polynomials on . Generally, optimization over is intractable because of its size, which is why we consider
The description of shows that computing this lower bound can be done via SDP.
It is important to note that, in the quotient ring of modulo , all terms , and thus, it suffices to consider only monomials in x for which the highest power is at most one. Thus, we can write
We say that monomial basis x represents a logical proposition if matrix contains all monomials for which . We index this matrix X and the matrix M from (16) with subsets for which . Note that for such , we have
For , we write if X has an entry equal to (modulo ). van Maaren et al. (2008) propose multiple monomial bases x, among them basis SOSp, given by
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 , as an extension to SOSp, the basis
Basis takes basis SOSp and adds all the 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 and SOSp might coincide.
We also define the basis for , 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 , where for . This results in the following chain of inclusions:
We now define, for all such that , a set of ordered pairs as follows:
Set contains the index pairs such that . Therefore, if and only if
Constraints of this form are sometimes referred to as coefficient matching conditions in SOS literature (Zheng et al. 2017). We define
Note that M is constrained to be symmetric, which is reflected in the definition of , because if and only if . Moreover, contains the index pairs of the diagonal entries of M, which correspond to zero-degree monomials in X. Hence, if , then ; see (17) and (19). To maximize the lower bound on (see (17)), we maximize λ, which is, thus, equivalent to minimizing . We can, therefore, compute this lower bound by solving the following SDP:
We note that, for the purpose of solving through interior point methods, program 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 on . We postpone the derivation of the dual of to Section 6, in which we also show its strict feasibility in Theorem 2.
4.2. Properties of
We provide several properties of monomial bases that are exploited within the PRSM; see Section 7.
Denote by the cardinality of the set ; see (24). Because of the symmetry of X (see (20)), is an even number and greater than or equal to two. In particular, when , say , we have
Thus, whenever , the constraint involving in (see (26)), simply fixes two entries of M. van Maaren et al. (2008) refer to these constraints arising from as unit constraints. In section 7 of van Maaren et al. (2008), the authors empirically show that a high percentage of the constraints of 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 in Section 7 that is able to do so.
The following lemma describes the subsets γ that induce unit constraints.
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 , we have , where is a coefficient of ; see (18).
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 for which , but .
Let be an SAT instance on n variables and x its monomial basis according to for some . Let . Then,
.
.
.
See Online Appendix A. □
Part 3 of Lemma 2 shows that the bases are only suited for (MAX-)k-SAT when .
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 , we define the following proposition on k variables:
It is clear that 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 unsatisfied. Therefore, any truth assignment leaves at least one clause unsatisfied, and hence, for as in (13). In the following lemma, we show that the SOSp basis (see (21)), suffices for proving optimality of this assignment.
For all , we have , where , and as in (16).
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, and yi, construct the clauses below the horizontal line:
The MAX-SAT resolution rule states that one may replace clauses C1 and C2 in with a subset of the resolvent clauses below the horizontal line. Namely, clauses that are trivially satisfied, such as , 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 ; see (13). Note that, in Bonet et al. (2007), definition 6, function is stated in terms of 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 and (see (26)), depend only on the coefficients of and . Because , these coefficients are equal, and thus, . Note that the feasible set of is defined in terms of . Hence, it follows that, if given the same basis, program equals program . This equivalence of programs suggests that MAX-SAT resolution does not change our approach; however, we find that, in general, ; see (21). We investigate the effect of this difference.
Returning to the example of in (28), let us define . Observe that, for (assuming k > 3). Let us fix some q, , and consider the clauses . We perform resolution as
We perform resolution again on the third new clause obtained in (30) and to obtain
Observe that the SOSp basis generates six quadratic monomials for the new resolvent clauses, whereas originally, only three quadratic monomials are generated for Cq, , and . We now define for as the logical proposition, obtained by taking and performing resolution as in (30) and (31) for each triple of clauses for each (let us assume here that k is a multiple of three). Note that proposition constitutes a MAX-4-SAT instance, and therefore, basis SOSp is applicable. Let us compare the sizes of the resulting SOSp bases, denoted as . We have
Thus, compared with , basis adds approximately k monomials. None of these monomials strengthens the bound because 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 requires more time for larger matrices.
The example of and 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 (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 (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 ; see (7).
Let be a logical proposition, (see (7)), and ; see (18). Then, and for all nonempty .
See Online Appendix A. □
Let x be a given monomial basis, . Matrix S is indexed by all for which . To simplify the comparison between the SOS approach and the relaxations of Anjos (2004a), we define the set
Let be a logical proposition and x a monomial basis. The SOS program defined by and x is equivalent to
We rewrite program by splitting the matrix variable M as follows:
We now determine the set such that, whenever , the minimization over in (35) is bounded. Observe that places no restrictions on the diagonal. To guarantee a bounded minimum, set should restrict . Each off-diagonal element of a matrix in 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,
We define, for and each clause Cj, the function , which is obtained by taking (6) and replacing each by for some . By (37), we are allowed to pick any such . By Lemma 4, for any nonempty and C as in Theorem 2, we have
Hence, maximizing is equivalent to maximizing the semidefinite relaxation of (see (7)), which equals .
Moreover, in the relaxations of Anjos (2004a) outlined in Section 3, the matrix variable is restricted to satisfy . 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.
Note again the difference between (40) and the relaxations described in Section 3, resulting from using set 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 (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 , 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 , then matrix is clearly also feasible for (39) and attains an objective value of m. Consequently, in this case, we have . 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, 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 . 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 given in (34). The augmented Lagrangian function of (34) with respect to (w.r.t.) the constraint M = Z for a penalty parameter is
Here, is the Lagrange multiplier and 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:
Here, is as in (26), and is the projection operator as in (4). We use that
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 .
Let matrices , indexed by subsets of such that , where the projection operator is given by (4). Then, and
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 , where
The values that we choose for 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 and the resulting 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 depends on the chosen monomial x through ; see (16). Hence, by (17), we have
Ideally, the PRSM algorithm (42) computes the upper bound (48) by finding the optimal M in the set (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 be its smallest eigenvalue. Note that
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 be the weight associated to clause Cj. The generalization of (13) for (unweighted) MAX-SAT to weighted MAX-SAT follows by setting
For weighted partial MAX-SAT, consider a logical proposition on n variables, m soft clauses Cj, and q hard clauses . To each hard clause , we associate the polynomial , similar to (51). Note that fp vanishes for all truth assignments that satisfy clause . Similar to (14) and (16), we define the sets
Let be the set of all truth assignments satisfying the hard clauses (which we assume to be nonempty). From Putinar (1993), it follows that
This allows us to adapt to weighted partial MAX-SAT as follows:
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 (see (23)), we determine the variable weights as for the mean of all soft clause weights wj. For basis , we add all 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)):
Then, the augmented Lagrangian function of (56) w.r.t. Z = M and for a penalty parameter is ; see (41). The PRSM is iteratively and separately optimizing over and 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 can be performed efficiently. By derivations similar to (43), we have
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, and yi, , construct the clause below the horizontal line:
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 (see (52)), by including terms of the form for some , where .
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 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
Hence, (61) is bounded if and only if is contained in the row space of D. This is precisely the requirement that as in (40). We provide one example of this claim in Online Appendix D.
Thus, (61) is bounded if , 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 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 and 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 . 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 . This is done by deriving the dual problem to ; see Theorem 2. In Section 7, we propose the PRSM for solving . We show that PRSM is well-suited for exploiting the structure of , 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 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 , in order to quickly obtain strong bounds. The second one is its ability to quickly parse 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 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 . Second, these instances can possess clauses of length k, where . This is problematic in the current settings because (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 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).
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 is computationally cheap.
References
- (2014) Ahmaxsat: Description and evaluation of a branch and bound Max-SAT solver. J. Satisfiability Boolean Model. Comput. 9(1):89–128.Crossref, Google Scholar
- (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
- (2004a) On semidefinite programming relaxations for the satisfiability problem. Math. Methods Oper. Res. 60(3):349–367.Crossref, Google Scholar
- (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
- (2005) An improved semidefinite programming relaxation for the satisfiability problem. Math. Programming 102(3):589–608.Crossref, Google Scholar
- (2006) Semidefinite optimization approaches for satisfiability and maximum-satisfiability problems. J. Satisfiability Boolean Model. Comput. 1(1):1–47.Google Scholar
- (2007) An extended semidefinite relaxation for satisfiability. J. Satisfiability Boolean Model. Comput. 4(1):15–31.Crossref, Google Scholar
- (2014) Curriculum-based course timetabling with SAT and MaxSAT. Ann. Oper. Res. 218(1):71–91.Crossref, Google Scholar
- (1979) A linear-time algorithm for testing the truth of certain quantified Boolean formulas. Inform. Processing Lett. 8(3):121–123.Crossref, Google Scholar
- (2007) Resolution for Max-SAT. Artificial Intelligence 171(8–9):606–618.Crossref, Google Scholar
- (2011) Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations Trends Machine Learning 3(1):1–122.Google Scholar
- (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
- (2000) Relaxations of the satisfiability problem using semidefinite programming. J. Automatic Reasoning 24(1):37–65.Crossref, Google Scholar
- (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.Abstract, Google Scholar
- (2017) A note on alternating projections for ill-posed semidefinite feasibility problems. Math. Programming 162(1):537–548.Crossref, Google Scholar
- (1976) A dual algorithm for the solution of nonlinear variational problems via finite element approximations. Comput. Math. Appl. 2(7):17–40.Crossref, Google Scholar
- (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
- (1995) Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. J. ACM 42(6):1115–1145.Crossref, Google Scholar
- (2022) A restricted dual Peaceman-Rachford splitting method for a strengthened DNN relaxation for QAP. INFORMS J. Comput. 34(4):2125–2143.Link, Google Scholar
- (2001) Approximation algorithms for MAX 4-SAT and rounding procedures for semidefinite programs. J. Algorithms 40(2):184–211.Crossref, Google Scholar
- (2001) Some optimal inapproximability results. J. ACM 48(4):798–859.Crossref, Google Scholar
- (2016) Convergence study on the symmetric version of ADMM with larger step sizes. SIAM J. Imaging Sci. 9(3):1467–1501.Crossref, Google Scholar
- (2011) Projection methods for conic feasibility problems: Applications to polynomial sum-of-squares decompositions. Optim. Methods Software 26(1):23–46.Crossref, Google Scholar
- (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
- (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
- (2001) Global optimization with polynomials and the problem of moments. SIAM J. Optim. 11(3):796–817.Crossref, Google Scholar
- (2007) A sum of squares approximation of nonnegative polynomials. SIAM Rev. 49(4):651–669.Crossref, Google Scholar
- (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.Crossref, Google Scholar - (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
- (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.Crossref, Google Scholar - (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
- (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- (2018) ADMM for the SDP relaxation of the QAP. Math. Programming Comput. 10(4):631–658.Crossref, Google Scholar
- Parrilo PA, Thomas RR, eds. (2020) Sum of Squares: Theory and Applications. Proc. Sympos. Appl. Math., vol. 77 (American Mathematical Society, Providence, RI).Crossref, Google Scholar
- (1955) The numerical solution of parabolic and elliptic differential equations. J. Soc. Indust. Appl. Math. 3(1):28–41.Crossref, Google Scholar
- (2005) A survey of recent advances in SAT-based formal verification. Internat. J. Software Tools Tech. Transfer 7(2):156–173.Crossref, Google Scholar
- (1993) Positive polynomials on compact semi-algebraic sets. Indiana Univ. Math. J. 42(3):969–984.Crossref, Google Scholar
- (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.Crossref, Google Scholar - (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
- (2008) Sums of squares based approximation algorithms for MAX-SAT. Discrete Appl. Math. 156(10):1754–1779.Crossref, Google Scholar
- (2021) Chordal-TSSOS: A moment-SOS hierarchy that exploits term sparsity with chordal extension. SIAM J. Optim. 31(1):114–141.Crossref, Google Scholar
- (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
- (2017) Exploiting sparsity in the coefficient matching conditions in sum-of-squares programming using ADMM. IEEE Control Systems Lett. 1(1):80–85.Crossref, Google Scholar

