This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. IEEE TRANSACTIONS ON CYBERNETICS

1

Clause States Based Configuration Checking in Local Search for Satisfiability Chuan Luo, Shaowei Cai, Kaile Su, and Wei Wu

Abstract—Two-mode stochastic local search (SLS) and focused random walk (FRW) are the two most influential paradigms of SLS algorithms for the propositional satisfiability (SAT) problem. Recently, an interesting idea called configuration checking (CC) was proposed to handle the cycling problem in SLS. The CC idea has been successfully used to improve SLS algorithms for SAT, resulting in state-of-the-art solvers. Previous CC strategies for SAT are based on neighboring variables, and prove successful in two-mode SLS algorithms. However, this kind of neighboring variables based CC strategy is not suitable for improving FRW algorithms. In this paper, we propose a new CC strategy which is based on clause states. We apply this clause states based CC (CSCC) strategy to both two-mode SLS and FRW paradigms. Our experiments show that the CSCC strategy is effective on both paradigms. Furthermore, our developed FRW algorithms based on CSCC achieve state-of-the-art performance on a broad range of random SAT benchmarks. Index Terms—Clause states based configuration checking (CSCC), local search, satisfiability (SAT).

I. I NTRODUCTION HE propositional satisfiability (SAT) problem is a prototypical NP-complete problem, and has been extensively studied in many domains of computer science and artificial intelligence due to its significant importance in both principles and practice [3]. Given a propositional formula with conjunctive normal form (CNF), the SAT problem is to decide whether there exists an assignment that satisfies all clauses in this formula. The SAT problem is fundamental in solving many practical problems in mathematical logic, inference, machine learning, constraint satisfaction, VLSI engineering, and computing theory [4]. An important and well-studied family of SAT is the uniform random k-SAT. Random k-SAT provides a relatively unbiased sample for benchmarking algorithms, and permits

T

Manuscript received January 10, 2014; revised May 30, 2014; accepted July 17, 2014. This work was supported in part by the China National 973 Program under Project 2010CB328103 and Project 2014CB340301, in part by the ARC under Grant FT0991785, and in part by the NSFC under Grant 61370072. Two preliminary versions of this paper have appeared in ECAI 2012 [1] and CP 2013 [2]. This paper was recommended by Associate Editor H. Wang. C. Luo and W. Wu are with the Key Laboratory of High Confidence Software Technologies of Ministry of Education, Peking University, Beijing 100871, China (e-mail: [email protected]; [email protected]). S. Cai is with the State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing 100190, China and also with the Queensland Research Laboratory, National ICT Australia, Brisbane, QLD 4001, Australia (e-mail: [email protected]). K. Su is with the Institute for Integrated and Intelligent Systems, Griffith University, Brisbane, QLD 4111, Australia (e-mail: [email protected]). Digital Object Identifier 10.1109/TCYB.2014.2343242

algorithms to be tested on statistically significant samples of hard instances. Actually, random k-SAT is underlying one of the three main categories in well-known SAT competitions [5]. Particularly, random 3-SAT is an important special case of SAT, and is also a classic problem in combinatorics, at the heart of computational complexity studies [6]. Practical algorithms for solving SAT are mainly based on search [7]. Over the years, search algorithms have been used to solve problems in diverse application areas [8]. There are two popular classes in practical algorithms for SAT: complete algorithms based on DPLL [9], [10] and stochastic local search (SLS) algorithms. SLS algorithms are typically incomplete, i.e., they cannot determine with certainty that a given formula is unsatisfiable. However, SLS algorithms usually find solutions for satisfiable instances surprisingly effectively [11]. SLS strategies can also be applied to solving a multiobjective optimization problem by combining a multiobjective optimization algorithm [12]. The basic schema of SLS algorithms can be described as follows. Initially, the SLS algorithm generates an assignment randomly. Then the algorithm selects and flips a variable according to a variable selection heuristic repeatedly until it seeks out a solution or timeout. Hence, the variable selection heuristic is the most important component in SLS algorithms. According to different variable selection heuristics, SLS algorithms for SAT can be mainly categorized into two paradigms: two-mode SLS algorithms and focused random walk (FRW) algorithms. Two-mode SLS algorithms switch between the greedy mode and the random (diversification) mode. In the greedy mode, they prefer to select variables whose flips can decrease the number of unsatisfied clauses. In the random mode, they tend to better explore the search space and avoid local optima. FRW algorithms conduct the search by always selecting a variable to flip from an unsatisfied clause chosen uniformly randomly in each step [13]. An important issue of SLS algorithms is that they suffer from the cycling problem, i.e., revisiting a candidate solution that has been visited recently [14]. To deal with this serious problem, there are some basic strategies for SLS algorithms, such as random walk and the restarting strategy [5]. However, as these strategies are too naive, although they show effectiveness on the cycling problem, the performance of SLS algorithms which incorporate them is still not satisfactory. An influential method is the tabu search [15], [16], which keeps a tabu list of the recently visited solutions and does not allow a return to any of the solutions in the list [14]. The tabu search has been widely used in local search algorithms [17]–[20].

c 2014 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. 2168-2267  See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 2

Another commonly used strategy for SAT is the exploiting promising decreasing variables strategy [21], which prefers to flip the promising decreasing variable with the greatest score globally in the greedy mode if such variables exist. The exploiting promising decreasing variables strategy is adopted by several two-mode SLS algorithms for SAT [21]–[25]. Recently, an interesting idea called configuration checking (CC) [26] has been proposed to handle the cycling problem. The CC idea was first utilized to solve minimum vertex cover [26], which is one of the best known combinatorial optimization problems in the past decades [27]. Afterwards, the CC idea has been successfully applied to solving SAT [3], [5], [28], resulting in several efficient two-mode SLS algorithms for SAT, such as CCASat [3], which is the winner of random satisfiable category of SAT Challenge 2012. While previous heuristics select the flipping variable based on variable properties, the CC idea takes the circumstance of the variable into account, to address the cycling problem. The CC strategy for SAT in the literature [3] forbids a variable x to be flipped if none of x’s neighboring variables has been flipped since x’s last flip, and is called neighboring variables based CC (NVCC) in this paper for convenience. Moreover, the experimental results in the literature [3] indicate that the NVCC strategy is more effective than the tabu search and the exploiting promising decreasing variables strategy on solving random 3-SAT instances. However, NVCC only succeeds in the two-mode SLS algorithms [3], [5], [28]. Actually, when NVCC is applied to FRW algorithms, it makes most candidate variables configuration changed during the search process, and thus loses its power. Empirical evidences, which present the ineffectiveness of NVCC on FRW algorithms, can be found in Section IX. In this paper, we propose an alternative CC strategy that works not only on two-mode SLS algorithms but also on FRW ones. The first contribution of this paper is that we propose an alternative CC strategy, called clause states based CC (CSCC). Compared to NVCC where a variable x’s configuration refers to Boolean values of x’s neighboring variables, in CSCC, a variable x’s configuration refers to the states of clauses where x appears. Further, we propose a quantitative version of the CSCC strategy. The quantitative CSCC strategy takes the quantitative variation into account, and prefers to flip the variable whose quantitative variation of configuration is greater. We use quantitative CSCC to develop a new two-mode SLS algorithm for SAT called Swqcc. The Swqcc algorithm is built on the top of Swcc [5], which is the first SLS algorithm based on NVCC. The Swqcc algorithm shows effectiveness on solving random 3-SAT. In our experiments, Swqcc outperforms its two-mode competitors namely Swcc and Sparrow2011 [23]. We note that Sparrow2011 is the winner of the random SAT category of SAT Competition 2011. The second contribution is to adapt the CSCC strategy to make it applicable to FRW algorithms. We propose a new variable selection heuristic called CCBM, which combines the CSCC strategy and the commonly used break minimum (BM) strategy in a subtle way. Then we use CCBM to develop an efficient FRW algorithm dubbed FrwCB. When comparing to state-of-the-art SLS solvers on random 3-SAT instances,

IEEE TRANSACTIONS ON CYBERNETICS

FrwCB exhibits the best performance on huge sized random 3-SAT instances with up to 4 million variables and ratio of 4.2. Also, FrwCB cooperates well with the SP algorithm [29], and their combination pushes forward state of the art in solving huge random 3-SAT with 107 variables and ratio of 4.2. The third contribution of this paper is to improve the performance of FrwCB on solving the random k-SAT problem with k > 3. We combine FrwCB with the recently proposed linear make function [30], resulting in a new FRW algorithm named FrwCBlm. The evaluations present that FrwCBlm performs much better than original FrwCB on random k-SAT instances with k > 3. Furthermore, the experiments show that FrwCBlm significantly outperforms its FRW competitors namely WalkSAT [31] and probSAT [32] on random 5-SAT and 7-SAT instances. Moreover, the FrwCBlm algorithm dramatically outperforms CCASat on random 5-SAT instances and competes well on random 7-SAT instances. Additionally, as Swqcc exhibits good performance on solving random 3-SAT instances, it is interesting to test Swqcc on solving structured instances. Thus, we conduct more new experiments to evaluate the performance of Swqcc on structured instances (the selected benchmark of 84 crafted instances in SAT Competition 2011). The related experimental results illustrate that, on solving structured instances, Swqcc competes well with Swcc and Sparrow2011. Also, we give discussions about the implementation of the CSCC strategy in our work, and do further empirical analyzes on comparing CSCC against NVCC when they are applied to FRW algorithms. According to our observations, NVCC loses its effectiveness when applying to FRW, and, to the best of our knowledge, CSCC is currently the only CC strategy that can be used to improve performance of FRW algorithms. We note that the first contribution (Sections IV and V) and the second contribution (Section VII) have been reported in the conference versions (i.e., [1] and [2], respectively) of this paper. The third contribution (Section VIII) and new experiments on evaluating the performance of Swqcc on structured instances (Section VI) as well as discussions on the implementation of CSCC and further empirical analyzes (Section IX) are new in this paper. The rest of this paper is structured as follows. In Section II, we provide some necessary preliminaries. Section III briefly reviews the NVCC strategy. Section IV proposes the CSCC strategy. In Section V, we describe the Swqcc algorithm and present the evaluations of Swqcc. In Section VI, we do more new experiments to evaluate the performance of Swqcc on solving structured instances. In Section VII, we introduce the CCBM heuristic and the FrwCB algorithm, along with the experiments of FrwCB. Section VIII shows the FrwCBlm algorithm and the empirical results of FrwCBlm. Further discussions on the approximate implementation of CSCC and empirical analyzes on CSCC and NVCC applied to FRW algorithms are demonstrated in Section IX. Finally, Section X concludes the paper and lists some future work. II. P RELIMINARIES Given a set of n Boolean variables V = {x1 , x2 , . . . , xn } and also the set of literals which are corresponding to these

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

variables, i.e., L = {x1 , ¬x1 , x2 , ¬x2 , . . . , xn , ¬xn }, a clause is a disjunction of literals, and we use V(c) to denote the set of all variables which appear in clause c. A formula in CNF can be described as follows: F = c1 ∧ . . . ∧ cm , where the number of clauses in F is denoted m and ci (1  i  m) is a clause in F. Thus, a formula can be described as a set of clauses. A k-SAT formula is a formula in which all clauses contain exactly k literals. We use V(F) to denote the set of all variables in formula F, and r = m/n to denote clause-to-variable ratio of F. Two different variables are neighbors if they appear simultaneously in at least one clause, and N(x) = {y | y ∈ V(F), y and x are neighbors} is the set of all neighbors of variable x. We also define CL(x) = {c | c is a clause which x appears in}. A mapping α : V(F) → {0, 1} is called an assignment. If assignment α maps all variables to a Boolean value, it is complete. For SLS algorithms on solving SAT, a candidate solution is a complete assignment. Given a complete assignment α, each clause has two possible states: satisfied or unsatisfied; a clause is satisfied if at least one literal in that clause is true under α; otherwise, the clause is unsatisfied. Given a CNF formula F, the SAT problem is to decide whether there exists a complete assignment that satisfies all clauses in F. In each step, the flipping variable is usually selected based on its properties, such as make [30], [33], break [31], [34] and score [21], [35], [36]. For the unweighted definitions of these properties, given a variable x, make(x) is defined as the number of clauses that would become satisfied if variable x is flipped; break(x) is the number of clauses that would become unsatisfied if variable x is flipped; score(x) is the increment in the number of satisfied clauses if variable x is flipped, and can be understood as make(x) − break(x). Several SLS algorithms employ the clause weighting techniques. In such SLS algorithms, each clause c is associated with a positive integer weight(c) as its weight. Here we introduce the weighted definitions of make, break and score: given a variable x, make(x) is defined as the total weight of clauses that would become satisfied if variable x is flipped; break(x) is the total weight of clauses that would become unsatisfied if variable x is flipped; the property score(x) is the increment in the total weight of satisfied clauses if variable x is flipped, and also can be understood as make(x) − break(x). In this paper, Swqcc adopts the weighted definitions of make, break and score, while the FrwCB and FrwCBlm algorithms utilize the unweighted definitions. III. N EIGHBORING VARIABLES BASED C ONFIGURATION C HECKING R EVIEW CC is a diversification idea, which aims to handle the cycling problem in local search [26]. The CC idea prevents SLS algorithms from encountering a scenario they recently visited. CC remembers each variable’s circumstance information, and forbids flipping variable x whose circumstance information has not been changed since x’s last flip. CC is based on the definition of configuration. In the context of SAT, originally stated in the literature [3], given a CNF

3

formula F and a complete assignment α, the configuration of a variable x in the neighboring variables based CC (NVCC) strategy refers to a vector consisting of Boolean values of N(x) (all neighboring variables of x). Previous SLS algorithms for SAT never take circumstance information of variables into consideration. They usually select the flipping variable according to the properties of variables, such as make, break, and score. However, the CC idea combines the circumstance information with the traditional heuristics on selecting the flipping variable. This is the essential difference between the CC idea and previous works. IV. C LAUSE S TATES BASED C ONFIGURATION C HECKING As CC is still in its infancy, a natural question is whether there exists an alternative CC strategy for SAT which is more efficient and robust than the NVCC strategy on improving SLS algorithms for SAT. In this section, compared to the NVCC strategy which is based on neighboring variables, we propose a novel clause states based CC (CSCC) strategy. A. Definitions and Notations in the CSCC Strategy We first give some necessary definitions and notations used in the CSCC strategy. Different from the NVCC strategy, where the configuration of a variable x refers to the Boolean values of x’s all neighboring variables, in the CSCC strategy the configuration of a variable x refers to the states of all clauses in which x appears. We give the formal definition of configuration in CSCC as follows. Definition 1: Given a CNF formula F and a complete assignment α to V(F), the configuration of a variable x ∈ V(F) is a vector configuration(x) consisting of the states of all clauses in CL(x) under assignment α. For a variable x, a change on any bit of configuration(x) is considered as a change on the whole configuration(x) vector. The CSCC strategy prefers to flip the variable x whose configuration have been changed more times since x’s last flip. B. Implementation of the CSCC Strategy In order to implement the CSCC strategy in an efficient method, inspired by the literature [3], we employ an integer array ConfTimes, whose size is equal to the number of variables in the formula. For each variable x, ConfTimes measures the frequency (i.e., the number of times) that configuration(x) has been changed since x’s last flip. The array ConfTimes is maintained as follows. Rule 1: In the beginning, for each variable x ∈ V(F), ConfTimes(x) is set to 1. Rule 2: Whenever a variable x is flipped during the search, ConfTimes(x) is reset to 0 immediately. Then each clause c ∈ CL(x) is checked whether c’s state is changed (from satisfied to unsatisfied or from unsatisfied to satisfied) by flipping x. If this is the case (c’s state is changed by flipping x), for each variable y (y = x) in c, ConfTimes(y) is increased by 1.

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 4

IEEE TRANSACTIONS ON CYBERNETICS

According to the implementation of the CSCC strategy, apparently, a variable x’s configuration has been changed since x’s last flip if ConfTimes(x) > 0. C. Identities and Differences Between NVCC and CSCC There are two main identities between NVCC and CSCC, as described below. 1) CC is a general local search idea, and the NVCC and CSCC strategies are both evolved from this idea. 2) As both the NVCC and CSCC strategies prefer to select the variable whose configuration has been changed since its last flip (although the definitions of configuration of NVCC and CSCC are different), NVCC and CSCC are both designed to deal with the cycling problem. However, these two strategies have significant differences, as described below. 1) In the NVCC strategy, a variable x’s configuration refers to Boolean values of x’s neighboring variables, while in the CSCC strategy, a variable x’s configuration refers to states of the clauses in which x appears. 2) The NVCC strategy only considers whether a variable’s configuration has been changed or not; in contrast, the CSCC strategy takes the quantitative variation of a variable’s configuration into account. 3) As used in the Swcc algorithm, the NVCC strategy is only used as a condition for filtering candidate variables in the greedy mode, while in the Swqcc algorithm, the CSCC strategy is able to be used to break ties in the greedy mode and serves as the priority selecting criterion in the random mode, and also CSCC can be applied effectively to the focused random walk algorithm, such as the FrwCB and FrwCBlm algorithms. V. U SING THE CSCC S TRATEGY TO D EVELOP T WO -M ODE SLS A LGORITHM In this section, we use the CSCC strategy to develop a twomode SLS algorithm for SAT namely Swqcc, which is built on the top of Swcc, and present experimental comparisons among Swqcc, Swcc, and Sparrow2011 on random 3-SAT instances. A. Auxiliary Techniques Before introducing the details of Swqcc, we first introduce the auxiliary techniques used in Swqcc. 1) SWT Scheme: As Swqcc is on the basis of Swcc, Swqcc adopts the same clause weighting scheme called SWT [3] employed in Swcc. The SWT scheme resembles the SAPS scheme [37] in some aspects. Whenever SWT is called, it increases clause weights of all unsatisfied clauses by one; further, if the averaged clause weight w exceeds threshold δ, for each clause c in F, the clause weight of c is smoothed as: weight(c) = weight(c) ∗ e + w ∗ f , where both e and f are real numbers and 0  e, f  1. Further, in the Swqcc algorithm, inspired by the success of smoothing techniques in clause weighting SLS algorithms for SAT, we use a smoothing mechanism to decrease the value of ConfTimes periodically. We employ the array

Algorithm 1: Swqcc Input: CNF-formula F, maxSteps Output: A satisfying assignment α of F or Unknown 1 initialize a random assignment α; 2 initialize all weight(c) as 1 and compute score(x) for each variable x; 3 initialize ConfVariation(x) as 1 for each variable x; 4 put variables with score(x) > 0 into the G set; 5 for step ← 1 to maxSteps do 6 if α satisfies F then return α; 7 if G = ∅ then 8 v ← x with the greatest score(x) in G, breaking ties by preferring the one with the greatest ConfVariation(x); 9 else 10 increase weights of all unsatisfied clauses by 1; 11 G ← G ∪ {y | score(y) > 0 & ConfVariation(y) > 0}; 12 if w > δ then 13 smooth ConfVariation and clause weight; 14 15

16 17

18

c ← randomly choose an unsatisfied clause; v ← the greatest ConfVariation(x) variable in clause c, breaking tie by choosing least recently flipped variable; flip v; update ConfVariation and score; G ← (G− {y | score(y)  0}) ∪ {y | score(y) > 0 & y ∈ N(v)}; return Unknown;

ConfVariation to represent the smoothed version of ConfTimes. The ConfVariation array is maintained according to Rule 1 and Rule 2 of ConfTimes as well as a new rule (Rule 3) which describes the smoothing mechanism and Rule 3 is given as below. Rule 3: When the averaged clause weight w exceeds threshold δ, for each variable x ∈ V(F) with ConfVariation(x) > 0, the value ConfVariation of x is smoothed as the expression: ConfVariation(x) = ConfVariation(x) ∗ β + 1, where β is a real number and 0  β  1. Due to the smoothing mechanism, recent changes on configuration contribute more to ConfVariation. Therefore, for a variable, the greater its ConfVariation value is, the more times its configuration has been changed recently. In the Swqcc algorithm, the variable with greater ConfVariation value is preferred to be flipped. B. Swqcc Algorithm We outline the Swqcc algorithm in Algorithm 1, as described below. In the beginning, the assignment α is generated randomly. All the clause weights are set to 1, and the score for each variable is computed accordingly. Also, ConfVariation(x) is initialized as 1 for each variable x. Then Swqcc collects the variables with

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

score(x) > 0 into a candidate variable set named G, which is maintained during the search (lines 11 and 17 in Algorithm 1). After the initialization, Swqcc executes a loop until the number of steps exceeds maxSteps or a satisfying assignment is found. The Swqcc algorithm switches between the greedy mode and the random mode to select a variable to be flipped, depending on G is empty or not. If G is not empty, Swqcc works in the greedy mode and chooses the flipping variable from G; otherwise, Swqcc picks the flipping variable according to the random mode. 1) Greedy Mode: Swqcc chooses a variable x with the greatest score in G to flip, breaking ties by preferring the one with the greatest ConfVariation(x) (line 8 in Algorithm 1). 2) Random Mode: Swqcc activates the SWT scheme and also smooths ConfVariation(x) according to Rule 3. Then Swqcc selects an unsatisfied clause c randomly, and chooses variable x with the greatest ConfVariation(x) in c to flip, breaking ties by preferring the least recently flipped one (lines 10 to 15 in Algorithm 1).

5

TABLE I C OMPARING S WQCC W ITH S WCC AND S PARROW 2011 ON THE 3-SAT_SC2011 B ENCHMARK

TABLE II C OMPARING S WQCC W ITH S WCC AND S PARROW 2011 ON THE 3-SAT_L ARGE B ENCHMARK . S WCC FAILS TO S OLVE A NY I NSTANCE IN T HIS B ENCHMARK , S O W E D O N OT R EPORT I TS R ESULTS

C. Experiment Evaluations of Swqcc In this subsection, we evaluate the performance of Swqcc on random 3-SAT instances. 1) Experiment Preliminaries: We evaluate Swqcc on a broad range of random 3-SAT instances including the 3-SAT_SC2011 and 3-SAT_Large benchmarks. The 3-SAT_SC2011 benchmark contains all 100 large random 3-SAT instances of the SAT Competition 20111 (r = 4.2, 2500  n  50 000, ten instances each size). The 3-SAT_Large benchmark is a set of instances (r = 4.2, 0.1M  n  0.4M where 1.0M = 106 , 20 instances each size) created according to the fixed clause length model (no tautologies, no duplicate clauses and no duplicate literals in a clause). The Swqcc algorithm is implemented in C/C++ and built on the basis of Swcc. For the two parameters e and β in Swqcc, we set both of them to 0.3 as constants. For the two parameters δ and f in Swqcc, we test all groups of δ = 100, 200, . . . , 1000 and f = 0.1, 0.2, . . . , 0.9, the preliminary results show that, on solving random 3-SAT instances, the value of δ is positively correlated to n (the number of variables) and f = 0.7 is the best setting. Thus, for Swqcc on solving random 3-SAT, we set δ to 200 + (n + 250)/500 , and f to 0.7. We compare Swqcc with Swcc [5] and Sparrow2011 [23], the winner of the random satisfiable category of SAT Competition 2011. The source code of Swcc can be downloaded online.2 The version of Sparrow20113 we test is the one submitted to SAT Competition 2011. In this paper, all experiments are carried out on a machine with Intel Core i7 2.7GHz CPU under GNU/Linux. We report the number of success runs (#suc) and the averaged run time (avg time) in CPU seconds for each solver on each instance class. For the 3-SAT_SC2011 benchmark, each solver is performed for ten runs on each instance within 2000 s. For the 1 http://www.cril.univ-artois.fr/SAT11/bench/SAT11-CompetitionSelectedBenchmarks.tar 2 http://shaoweicai.net/Code/Swcc%20code.tar.gz 3 http://www.cril.univ-artois.fr/SAT11/solvers/SAT2011-sources.tar.gz

Fig. 1. Averaged time of Swqcc and its competitors on the 3-SAT_Large benchmark. Swcc fails to solve any instance in this benchmark, so we do not report its results.

3-SAT_Large benchmark, each solver is performed for one run on each instance within 10 000 s. 2) Experiment Results a) On the 3-SAT_SC2011 benchmark: Table I presents performance of Swqcc, Swcc, and Sparrow2011 on the 3-SAT_SC2011 benchmark. It is clear that Swqcc significantly outperforms both Swcc and Sparrow2011, indicating the efficiency of Swqcc on this benchmark. b) On the 3-SAT_Large benchmark: We report the experimental results on the 3-SAT_Large benchmark in Table II and Fig. 1. Apparently, Swqcc stands out as the best solver and performs much better than Swcc and Sparrow2011 on this benchmark. c) Summarization: The experiments show that Swqcc consistently outperforms Sparrow2011 and Swcc on solving

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 6

IEEE TRANSACTIONS ON CYBERNETICS

TABLE III C OMPARATIVE R ESULTS OF S WQCC , S WCC , AND S PARROW 2011 ON THE S ELECTED _C RAFTED _SC2011 B ENCHMARK

random 3-SAT instances. We believe that the better performance of Swqcc is mainly attributed to the CSCC strategy. VI. E VALUATING S WQCC ON S TRUCTURED I NSTANCES In this section, we evaluate the performance of Swqcc and its competitors (Swcc and Sparrow2011) on structured instances. We adopt the selected benchmark of 84 crafted instances in SAT Competition 20114 (Selected_Crafted_SC2011) as the testing structured benchmark, which covers a broad range of structured types. For the two parameters e and β in Swqcc, we set both of them to 0.3 as constants. For the two parameters δ and f in Swqcc, we test all groups of δ = 100, 200, . . . , 1000 and f = 0.1, 0.2, . . . , 0.9, the preliminary results show that, on solving structured instances, the group of δ = 300 and f = 0.1 is best for structured instances. We set the settings of δ and f for Swqcc accordingly. For the Selected_Crafted_SC2011 benchmark, each solver is performed for ten runs on each instance within 2000 s. Table III illustrates the comparative results of Swqcc, Swcc, and Sparrow2011 on the Selected_Crafted_SC2011 benchmark. According to the experimental results, Swqcc competes well with Swcc and Sparrow2011. More particularly, on the direct comparison between Swqcc and Sparrow2011, although Sparrow2011 performs better than Swqcc on three instance classes (i.e., “GreenTao,” “sgen,” and “VanDerWaerden_pd_3k”), Swqcc also outperforms Sparrow2011 on three instance classes (i.e., “automata-synchronization,” “battleship,” and “SRHD-SGI”). The experimental results can be concluded by remarking that Swqcc and Sparrow2011 are complementary to each other. VII. A PPLYING THE CSCC S TRATEGY TO THE F OCUSED R ANDOM WALK PARADIGM In this section, we apply the CSCC strategy to the focused random walk (FRW) paradigm. First we propose a new variable selection heuristic called CCBM, which combines CSCC with the commonly used break minimum variable-picking strategy. Then we utilize the CCBM heuristic to design a new FRW algorithm called FrwCB for SAT. Afterwards, we present the empirical evaluations of FrwCB on a broad range of SAT instances. 4 http://www.cril.univ-artois.fr/SAT11/bench/SAT11-CompetitionSelectedBenchmarks.tar

A. CCBM Heuristic Before introducing the CCBM heuristic, we give definitions of the CSCCD variable and the BM variable, both of which are important concepts in the CCBM heuristic. Definition 2: Given a CNF formula F and a complete assignment α to V(F), a variable x is clause states based configuration changed decreasing (CSCCD) if and only if score(x) > 0 and ConfTimes(x) > 0. Definition 3: Given a CNF formula F and a complete assignment α to V(F), for each clause c, a variable x is the break minimum (BM) variable of clause c if and only if x appears in clause c and break(x) = min{break(y) | y appears in c}. In this paper, we use CSCCDVars(c) and BMVars(c) to denote the sets of all CSCCD variables and all BM variables of clause c, respectively. The main idea of the CCBM heuristic is to prefer to flip CSCCD variables and BM variables from a randomly chosen unsatisfied clause. Flipping a CSCCD variable brings down the number of unsatisfied clauses and also prevents the algorithm from revisiting the recently faced scenario. Whenever no CSCCD variable exists, CCBM prefers to pick a BM variable of a random unsatisfied clause as the flipping variable, leading the algorithm to search deeply. Specially, the CCBM heuristic works as follows. After randomly selecting an unsatisfied clause c, CCBM switches between two levels, i.e., the CSCCD level and the probability (PROB) level, depending on whether CSCCDVars(c) is empty or not. If CSCCDVars(c) is not empty, CCBM works in the CSCCD level; otherwise it works in the PROB level. In the CSCCD level, CCBM does a gradient decreasing walk, i.e., selecting the variable x with the greatest score(x) in CSCCDVars(c) to flip. In the PROB level, with a probability p, CCBM chooses the variable x with the greatest ConfTimes(x) in BMVars(c); in the remaining case, it employs a diversification strategy to pick a variable x in c. In this paper, this is accomplished by selecting the one with the greatest ConfTimes from clause c. B. FrwCB Algorithm We utilize the CCBM heuristic to develop a new FRW algorithm dubbed FrwCB. The pseudo-code of the FrwCB algorithm is outline in Algorithm 2. At the start of FrwCB, a complete assignment α is generated randomly as the initial solution, and for each variable x, ConfTimes(x) is initialized as 1. After the initialization, the

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

Algorithm 2: FrwCB Input: CNF-formula F, maxSteps Output: A satisfying assignment α of F or Unknown 1 generate a random assignment α; 2 initialize ConfTimes(x) as 1 for each variable x; 3 for step ← 1 to maxSteps do 4 if α satisfies F then return α; 5 c ← an unsatisfied clause chosen randomly; 6 if CSCCDVars(c) = ∅ then 7 v ← x with the greatest score(x) in CSCCDVars(c), breaking ties by preferring the one with the greatest ConfTimes(x); 8 9

10 11

12 13

else if with the fixed probability p then v ← x with the greatest ConfTimes(x) in BMVars(c), breaking ties by preferring the least recently flipped one; else v ← x with the greatest ConfTimes(x) in clause c, breaking ties by preferring the least recently flipped one; flip v and update ConfTimes; return Unknown;

FrwCB algorithm repeats picking and flipping a variable according to the CCBM heuristic and updating ConfTimes until it seeks out a satisfying assignment or the number of search steps reaches the step limit. If FrwCB finds a satisfying assignment, it outputs the satisfying assignment; otherwise it reports Unknown. C. Experiment Evaluations of FrwCB We evaluate FrwCB on a broad range of SAT instances, including random 3-SAT ones and structured ones. 1) Benchmarks: FrwCB is evaluated on random 3-SAT instances as well as structured ones. Random 3-SAT instances are the best studied random instances and thus we have four different sets of random 3-SAT. Specially, we adopt the following benchmarks. a) The 3-SAT_SC2011 benchmark described in Section V. b) The 3-SAT_SC2012 benchmark: all 120 satisfiable random 3-SAT instances in SAT Challenge 20125 (4.2  r  4.267, 2000  n  40 000, 12 instances each ratio). c) The 3-SAT_Huge benchmark: 220 huge satisfiable random 3-SAT instances (r = 4.2, 0.1M  n  4.5M where 1.0M = 106 , 20 instances each size), generated according to the fixed clause length random model. d) The 3-SAT_10M benchmark: 20 extremely huge satisfiable random 3-SAT instances (r = 4.2, n = 10.0M = 107 ), generated according to the fixed clause length random model. For the structured benchmark, we adopt satisfiable crafted instances from SATLIB,6 including the ais, blocksworld, gcp,

7

jnh, logistics, par8, par8-c, par16 and par16-c classes, which have been widely tested in the literature [38]–[40], as well as the largest and thus the most difficult frb instances7 (frb50-23, frb53-24, frb56-25, and frb59-26). These frb instances are generated randomly in the phase transition area according to the Model RB [41], and are very difficult to solve by current techniques in spite of their relative small size. Also, these instances generated in phase transition prove to be difficult both in theories and applications [42]. These frb instances have been extensively used in the SAT competitions8 and MAX-SAT evaluations,9 and in the literature [43]–[45]. 2) Experiment Preliminaries: The FrwCB algorithm is implemented in C/C++. For the parameter p in FrwCB, we first test p = 0.1, 0.2, . . . , 0.9 to find the most efficient one, and then test FrwCB with the values of p which are around this most efficient value. The preliminary results show that the p = 0.6 is best for 3-SAT with r < 4.26, p = 0.63 is best for 3-SAT with r  4.26, p = 0.65 is best when FrwCB cooperates with the survey propagation (SP) algorithm [29], and p = 0.95 is best for structured instances. We set the setting of p for FrwCB accordingly. We compare FrwCB with Swqcc and other four state-ofthe-art SLS solvers, including WalkSAT [31], probSAT [32], CCASat [3], and Sattime [25]. WalkSAT is the most famous FRW solver, and is still highly competitive with the state of the art on random 3-SAT instances. The probSAT solver is the current best SLS solver for random 3-SAT instances especially the huge ones. The CCASat solver is the winner of the random track in SAT Challenge 2012 and the current best solver using the NVCC strategy. The Sattime solver is the best SLS solver for crafted instances in SAT Competition 2011. For WalkSAT, we adopt Version 50 from its author’s website,10 and we set the noise parameter to 0.567 for 3-SAT and 0.1 for structured instances, as reported in the literature [32]. The binary of probSAT is kindly provided by its author, and we use the default parameter settings tuned by its authors. The source code of CCASat can be downloaded online,11 and we use the parameter settings as the one used in SAT Challenge 2012. The Sattime solver we adopt is the one submitted to SAT Competition 2011.12 3) Results on Random 3-SAT Benchmarks a) On the 3-SAT_SC2011 benchmark: Table IV shows experimental results on the 3-SAT_SC2011 benchmark, where each solver is performed for ten runs for each instance with a cutoff time of 2000 s. On the instances with n = 2500, CCASat and Swqcc outperform all FRW algorithms, among which FrwCB performs best. On the instances with n = 5000, FrwCB outperforms its competitors (except CCASat). On the other hand, FrwCB significantly outperforms its competitors on the instances with n > 5000. Especially, on the largest sized instances (with n = 50 000), FrwCB performs about 3 times as fast as Swqcc does, about 2.5 times as fast as CCASat does, 7 http://www.nlsde.buaa.edu.cn/∼kexu/benchmarks/benchmarks.htm 8 http://www.satcompetition.org/ 9 http://maxsat.ia.udl.cat:81/ 10 http://www.cs.rochester.edu/∼kautz/walksat/Walksat_v50.zip

5 http://baldur.iti.kit.edu/SAT-Challenge-2012/downloads/sc2012-random.tar

11 http://shaoweicai.net/Code/CCASat-Opensource.zip

6 http://www.satlib.org/

12 http://www.cril.univ-artois.fr/SAT11/solvers/SAT2011-sources.tar.gz

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 8

IEEE TRANSACTIONS ON CYBERNETICS

TABLE IV C OMPARATIVE R ESULTS ON THE 3-SAT_SC2011 B ENCHMARK . E ACH S OLVER I S P ERFORMED 100 T IMES ON E ACH I NSTANCE C LASS

TABLE V C OMPARATIVE R ESULTS ON THE 3-SAT_SC2012 B ENCHMARK

TABLE VI C OMPARATIVE R ESULTS ON THE 3-SAT_H UGE B ENCHMARK . E ACH S OLVER I S P ERFORMED 20 T IMES FOR E ACH I NSTANCE C LASS

about 2 times as fast as WalkSAT does, and about 1.5 times as fast as probSAT does. Indeed, FrwCB is so efficient that it solves all large random 3-SAT instance classes in SAT Competition 2011 with an averaged time less than 100 s. b) On the 3-SAT_SC2012 benchmark: Table V reports experimental results on the 3-SAT_SC2012 benchmark with various clause-to-variable ratios. Each solver is performed for ten runs for each instance with a cutoff time of 2000 s. FrwCB outperforms its competitors in terms of both success rate and averaged run time on this benchmark. FrwCB succeeds in 1043 (out of 1200) runs, 40 more than the second best solver namely probSAT does. The good performance of FrwCB on these instances with various clause-to-variable ratios indicates its robustness on random 3-SAT instances. c) On the 3-SAT_Huge benchmark: To evaluate the genuine solving ability on random 3-SAT, we compare FrwCB with its competitors on the 3-SAT_Huge benchmark, and the results are reported in Table VI and Fig. 2, where each solver is performed for one run for each instance with a cutoff time of 10 000 s (less than 3 h). FrwCB stands out as the best solver and dramatically outperforms others. While other solvers all fail to solve any instance with n  2.5M, FrwCB consistently solves all instances with up to 3.5M variables, and the results clearly show the superiority of FrwCB to other solvers. Furthermore, FrwCB remains effective on the instances with

Fig. 2. Averaged time of FrwCB and its competitors on the 3-SAT_Huge benchmark.

4.0M variables. This is, to our best knowledge, the first time that such huge random 3-SAT instances are solved by an SLS algorithm in reasonable time. We conclude this section by remarking that the averaged run time of FrwCB seems to scale linearly (or close to that) in the number of variables on random 3-SAT instances with r = 4.2. 4) Results of Combining SP With FrwCB: Although SP exhibits the best performance on random 3-SAT instances, it needs to call an SLS solver (such as WalkSAT) to solve the sub-formula after it simplifies the original formula. We also perform some experiments on the 3-SAT_10M benchmark to show the good cooperation of SP and FrwCB. As reported

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

9

TABLE VII C OMPARATIVE R ESULTS ON THE 3-SAT_10M B ENCHMARK (r = 4.2, n = 107 ). T HE L EGEND “A . T. SLS ” M EANS THE AVERAGED T IME OF THE SLS C OMPONENT IN SP+SLS H YBRID S OLVER

TABLE VIII C OMPARATIVE P ERFORMANCE R ESULTS ON THE S TRUCTURED B ENCHMARK

in [29], SP calls WalkSAT to solve the simplified formula, and we refer to this hybrid solver as SP+WalkSAT. In this experiment, the source code of SP+WalkSAT is downloaded from its author’s website13 and is evaluated with the default settings. We replace WalkSAT with probSAT, CCASat, Swqcc and FrwCB, and then obtain four new hybrid solvers which are referred to as SP+probSAT, SP+CCASat, SP+Swqcc and SP+FrwCB, respectively. The related results are summarized in Table VII, where each solver is performed for one run for each of the 20 instances. Each SLS solver is given 2000 s to solve each sub-formula simplified by SP using the parameter f = 5% (with 6320 s on average). To solve the simplified instances, the averaged time of FrwCB is 251.7 s, while those of WalkSAT and probSAT are 810.5 and 685.2 s, respectively. Also, CCASat and Swqcc fail to solve all these simplified instances within the cutoff time. Therefore, SP+FrwCB exhibits the best performance among these hybrid solvers on the 3-SAT_10M benchmark. The results show the efficiency of SP+FrwCB and also indicates that FrwCB cooperates well with SP. 5) Results on the Structured Benchmark: We compare FrwCB with WalkSAT, probSAT, CCASat, and Sattime on the structured benchmark. Table VIII illustrates the results on structured instances, where each solver is performed for ten runs for each instance within 2000 s. On these structured instances, although FrwCB performs worse than Sattime on structured instances, and it does show improvement over WalkSAT, probSAT, and CCASat, especially on frb instances, indicating that the CCBM heuristic does improve the FRW algorithms on structured instances. We also note that Sattime performs preprocess before local search, which is helpful for solving structured instances. To investigate the influence of preprocess on par16 instances, 13 http://www.ictp.trieste.it/∼zecchina/SP/sp-1.4b.tgz

we run the preprocessor in Lingeling14 [46] to simplify the instances. It turns out that the simplified par16 instances can be solved by WalkSAT, CCASat, and FrwCB (probSAT is able to solve four instances), compared to the fact that all solvers but Sattime cannot solve the original instances. Specially, the averaged time of FrwCB on solving the simplified par16 instances is 13.2 s, while those of WalkSAT, probSAT, CCASat and Sattime are 102.6, 1294.4, 90.8, and 2.3 s, respectively. 6) Effectiveness of Each Component in CCBM: There are three components in CCBM: the CSCCD component corresponding to the CSCCD level, the BM component and the diversification component based on ConfTimes. We perform three additional experiments to analyze the effectiveness of these components. Our analysis suggests that the good performance of FrwCB is mainly due to the first two components. a) Effectiveness of the CSCCD component: We modify FrwCB to obtain an alternative algorithm Frw1 which works without the CSCCD level, that is, deleting lines 6 and 7 in Algorithm 2. The probability p is set to 0.86 for Frw1 according to some tuning. We test Frw1 on the 3-SAT_SC2011 benchmark, one run for each instance within 2000 s, and it fails to solve any instance when n  15 000, indicating the importance of the CSCCD component. b) Effectiveness of the BM component: By removing the BM component (deleting lines 8 and 9 in Algorithm 2), we obtain another degenerating algorithm Frw2, which differs from FrwCB only in the PROB level. Specifically, in the PROB level of Frw2, it always selects the variable with the greatest ConfTimes in the chosen unsatisfied clause to flip. We test Frw2 on the first benchmark, one run for each instance within 2000 s. The related results show that Frw2 fails to solve any instance from the 3-SAT_SC2011 benchmark, demonstrating the significance of the BM component. 14 http://fmv.jku.at/lingeling/lingeling-ala-b02aa1a-121013.tar.gz

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 10

IEEE TRANSACTIONS ON CYBERNETICS

c) Effectiveness of the diversification component based on ConfTimes: We replace the diversification component based on ConfTimes in FrwCB with the one based on age, resulting in the third alternative algorithm Frw3. Frw3 differs from FrwCB in lines 7, 9 and 11 in Algorithm 2: in line 7, Frw3 selects the variable x with the greatest score(x) appearing in CSCCDVars(c) to flip, breaking ties by preferring the least recently flipped one; in line 9, Frw3 selects the least recently flipped variable in BMVars(c); in line 11, Frw3 selects the least recently flipped variable in clause c. We set the parameter p to 0.6 for Frw3 according to some tuning. We test Frw3 on the 3-SAT_SC2011 benchmark, one run for each instance within 2000 s. The related results show that Frw3 succeeds in all runs, and the averaged time of Frw3 is 69 s. These observations suggest that the performance of Frw3 is comparable with that of FrwCB (at least on the 3-SAT_SC2011 benchmark). This also indicates that CCBM is a general heuristic and can work well with different diversification strategies.

Algorithm 3: FrwCBlm Input: CNF-formula F, maxSteps Output: A satisfying assignment α of F or Unknown 1 generate a random assignment α; 2 initialize ConfTimes(x) as 1 for each variable x; 3 for step ← 1 to maxSteps do 4 if α satisfies F then return α; 5 c ← an unsatisfied clause chosen randomly; 6 if CSCCDVars(c) = ∅ then 7 v ← x with the greatest score(x) in CSCCDVars(c), breaking ties by preferring the one with the greatest ConfTimes(x); 8 9

10 11

VIII. C OMBINING F RW CB W ITH L INEAR M AKE This section improves FrwCB for random k-SAT with k > 3. First we review the linear make function, which is originally proposed in the literature [30]. Then we present the way to combine FrwCB with linear make, resulting in a new FRW algorithm called FrwCBlm. Finally we evaluate FrwCBlm on extensive random k-SAT instances with k > 3. A. Linear Make Function In this subsection, we review the necessary concepts about linear make. As originally stated in the literature [30], given a complete assignment α, a clause is τ -true if and only if it contains exactly τ true literals under α; for a variable x, its τ th level make, denoted by makeτ (x), is the number of (τ −1)-true clauses that would become τ -true by flipping x. The combinations of makeτ (and other properties) successfully result in several SLS algorithms [30], [47]. Particularly, the linear make function is a combination of makeτ properties. In this paper, we adopt the same combination used in the literature [30], as described below. For a variable x, its linear make function (lmake(x)) is lmake(x) = w1 · make1 (x) + w2 · make2 (x). B. FrwCBlm Algorithm We use the linear make function to improve the FrwCB algorithm and just do a minor modification on FrwCB, resulting in a new FRW algorithm called FrwCBlm. We outline the pseudo-code of FrwCBlm in Algorithm 3. According to Algorithms 2 and 3, it is clear that FrwCBlm differs from FrwCB only in the BM component that selects a variable from the BMVars(c) set (line 9 in both Algorithms 2 and 3). While FrwCB prefers to pick variable x with the greatest ConfTimes(x) in BMVars(c), FrwCBlm selects the variable x with the greatest lmake(x) in BMVars(c). Our related experiments indicate that performance of FrwCBlm is much better than that of FrwCB on random k-SAT instances with k > 3. The main intuitive reason of the improvement is possibly that there usually exists more

12 13

else if with the fixed probability p then v ← x with the greatest lmake(x) in BMVars(c), breaking ties by preferring the one with the greatest ConfTimes(x); else v ← x with the greatest ConfTimes(x) in clause c, breaking ties by preferring the least recently flipped one; flip v and update ConfTimes; return Unknown;

than one variable with minimum break value in an unsatisfied clause, and thus flipping a variable with more lmake value may capture the complementary information to the break property [30]. C. Experiment Evaluations of FrwCBlm In this subsection, we evaluate FrwCBlm on extensive random SAT instances with long clauses. 1) Experiment Preliminaries: To evaluate FrwCBlm, we set up four benchmarks. The first benchmark (the 5-SAT benchmark) includes all 50 large random 5-SAT instances from SAT Competition 2011 (r = 20, 750  n  2000, ten instances each size) and 40 large generated random 5-SAT instances (r = 20, 3000  n  6000, ten instances each size) according to the fixed length model. The second one (the 7-SAT benchmark) contains large random 7-SAT instances with n = 150, 200, 250, and 300 (r = 85, ten instances each size) from SAT Competition 2011, as those ones with n  300 are beyond the solving abilities of all the solvers and are thus not included. The third benchmark (the Great_k-SAT_SC2012 benchmark) consists of all 480 random k-SAT instances with k > 3 from SAT Challenge 2012, and each k-SAT subbenchmark (k = 4, 5, 6, 7) contains 120 k-SAT instances with various size and ratio. The fourth one namely the (4-7)-SAT benchmark includes 40 random (4-7)-SAT instances (r = 21, 2000  n  8000, ten instances each size), where the length of each clause in a (4-7)-SAT instance is chosen from 4 to 7 randomly. The FrwCBlm algorithm is developed on the top of FrwCB, and thus is implemented in C/C++. For the two parameters w1 and w2 in FrwCBlm, we set w1 to 3 and w2 to 2 as constants. For the parameter p in FrwCBlm, we first test

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

11

TABLE IX C OMPARATIVE R ESULTS OF F RW CB LM AND I TS C OMPETITORS ON THE 5-SAT B ENCHMARK

TABLE X C OMPARATIVE R ESULTS OF F RW CB LM AND I TS C OMPETITORS ON THE 7-SAT B ENCHMARK

p = 0.1, 0.2, . . . , 0.9 to find the most efficient one, and then test FrwCBlm with the values of p which are around this most efficient value. The preliminary results show that p = 0.53 is best for 4-SAT, p = 0.58 is best for 5-SAT with r  20.1, p = 0.6 is best for 5-SAT with r > 20.1, p = 0.69 is best for 6-SAT with r  42.4, p = 0.71 is best for 6-SAT with r > 42.4, p = 0.76 is best for 7-SAT with r  85.2, p = 0.82 is best for 7-SAT with r > 85.2, and p = 0.6 is best for (4-7)-SAT. We set the setting of p for FrwCBlm accordingly. For FrwCB on solving random instances with long clauses, we first test p = 0.1, 0.2, . . . , 0.9 to find the most efficient one, and then test FrwCB with the values of p which are around this most efficient value. The preliminary results show that p = 0.7 is best for 4-SAT, p = 0.8 is best for 5-SAT, p = 0.85 is best for 6-SAT, p = 0.9 is best for 7-SAT, and p = 0.8 is best for (4-7)-SAT. We set the setting of p for FrwCB accordingly. For WalkSAT and CCASat, the parameters are set as the ones used in SAT Challenge 2012. For probSAT, we use the default parameter settings tuned by its authors. For the 5-SAT benchmark and the 7-SAT benchmark, each solver is performed for ten runs for each instance. For the Great_k-SAT_SC2012 benchmark and the (4-7)-SAT benchmark, each solver is performed for one run for each instance. The cutoff time for all runs is set to 2000 s. 2) Experiment Results a) Results on the 5-SAT benchmark: Table IX and Fig. 3 illustrate comparative results of FrwCBlm and its competitors on the 5-SAT benchmark. According to the results, FrwCBlm stands out as the best solver and dominates this benchmark. FrwCBlm shows significant superiority over FrwCB, and performs much better than the other competitors. Especially, on the 5SAT-v5000 instance class, FrwCB succeeds in 9 runs, while all of its competitors fail to solve any instance. b) Results on the 7-SAT benchmark: Table X shows experimental results on the 7-SAT benchmark. From Table X, it is apparent that both CCASat and FrwCBlm dramatically outperform other solvers. Although FrwCBlm performs worse

Fig. 3. Averaged time of FrwCBlm and its competitors on the 5-SAT benchmark.

than CCASat, which is the winner of random satisfiable category in SAT Challenge 2012, FrwCBlm does show significant improvements than all other FRW solvers, i.e., WalkSAT, probSAT and FrwCB, indicating the efficiency and the effectiveness of combining the CCBM heuristic with the linear make function on FRW algorithms. c) Results on the Great_k-SAT_SC2012 benchmark: Table XI reports the number of solved instances and the averaged time for FrwCBlm and its competitors on this benchmark consisting of random k-SAT instances with k > 3. Seen from Table XI, the performance of FrwCBlm is much better than those of other FRW algorithms (WalkSAT, probSAT and FrwCB), and is highly competitive with that of CCASat. The number of solved instances of FrwCBlm is 400, while those of WalkSAT, probSAT, FrwCB and CCASat are 273, 361, 315 and 417, respectively. We would like to note that probSAT is the current best FRW algorithm on solving random instances. These promising results of FrwCBlm confirm the effectiveness of the cooperation between CCBM and linear make. d) Results on the (4-7)-SAT benchmark: To show the robustness of FrwCBlm on other types of random instances with long clauses, we compare FrwCBlm with its competitors on the (4-7)-SAT benchmark, where lengths of all clauses are varying. Table XII presents the results of FrwCBlm

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 12

IEEE TRANSACTIONS ON CYBERNETICS

TABLE XI C OMPARATIVE R ESULTS OF F RW CB LM AND I TS C OMPETITORS ON THE G REAT _k-SAT_SC2012 B ENCHMARK

TABLE XII C OMPARATIVE R ESULTS OF F RW CB LM AND I TS C OMPETITORS ON THE (4-7)-SAT B ENCHMARK . T HE L EGEND “T IME ” I S THE A BBREVIATION FOR “AVG T IME ”

and its competitors on this benchmark. According to the results, FrwCBlm stands out as the best solver and significantly performs better than its competitors, which confirms the robustness of FrwCBlm on random instances with long clauses. IX. F URTHER D ISCUSSION AND E MPIRICAL A NALYZES In this section, we first give discussions about the implementation of the CSCC strategy. Then we conduct some further experiments to demonstrate the significant superiority of the CSCC strategy over the NVCC strategy. A. Approximate Implementation of CSCC Inspired by the approximate implementation of NVCC [3], which significantly decreases the time complexity of the naive accurate implementation of NVCC, in this paper, the implementation of CSCC described in Section IV-B is also an approximate one. Inspired by the naive accurate implementation of NVCC [3], we first propose a naive accurate implementation of CSCC, which stores the configuration (i.e., states of all clauses in CL(x)) for each variable x ∈ V(F). The maintenance of the naive accurate implementation is described as follows: whenever a variable x is flipped during the search, first x’s configuration is stored. Then each clause c ∈ CL(x) is checked whether c’s state is changed (from satisfied to unsatisfied or from unsatisfied to satisfied) by flipping x. If this is the case (c’s state is changed by flipping x), for each variable y (y = x) in c, y’s configuration is updated. We use #Lit(x) to denote the occurrence number of variable x. As variable x must appear in a clause, thus #Lit(x) is equal to |CL(x)|. Given a random k-SAT formula F with n variables and m clauses (r = m/n is the clause-to-variable ratio of F), for each variable x ∈ V(F), it is easy to derive that E(|CL(x)|) = E(#Lit(x)) = k · m/n = k · r. We note that the discussions

TABLE XIII C OMPARATIVE R ESULTS ON THE 3-SAT_SC2011 B ENCHMARK . E ACH S OLVER I S P ERFORMED FOR T EN RUNS ON E ACH I NSTANCE W ITH A C UTOFF T IME 2000 S

below are all based on the condition that F is a random k-SAT formula. For the naive accurate implementation of CSCC, apparently, the time complexity of checking a variable x’s configuration is O(E(|CL(x)|)) = O(k · r), and the time complexity of maintenance is O(E(|CL(x)|)) + O(E(|CL(x)|) · E(|CL(y)|)) = O(k · r) + O(k2 · r2 ) = O(k2 · r2 ), where variable y appears in a state-changed clause which is caused by flipping x. For the approximate implementation of CSCC (described in Section IV-B), the time complexity of checking a variable x’s configuration is O(1) (checking whether Conftimes is greater than 0 or not), and the time complexity of maintenance is O(k · E(|CL(x)|)) = O(k2 · r). Therefore, it is clear that the approximate implementation is much efficient than the naive accurate one. According to the revised version15 of the literature [3], it shows O(E(|N(x)|)) = O(k · (k − 1) · r). For the approximate implementation of NVCC, the time complexity of checking a variable x’s configuration is O(1) (checking whether its confChange is 0 or 1), and the time complexity of maintenance is O(E(|N(x)|)) = O(k · (k − 1) · r) = O(k2 · r). Thus, both the time complexities of checking a variable’s configuration and maintenance of the approximate implementation of NVCC are equal to those of the approximate implementation of CSCC. As CC is a potential idea for handling the cycling problem and the FRW paradigm shows efficiency on picking the flipping variable in each search step, thus it is interesting to apply CC to FRW. While the existing NVCC strategy is ineffective when applying to FRW, the CSCC strategy shows effectiveness when combining into FRW, and the related empirical analyzes will be shown in Section IX-B. The possible reason is that CSCC helps FRW algorithms to decrease blind unreasonable greedy search and thus leads FRW algorithms to promising search spaces. 15 http://shaoweicai.net/Paper/AIJ-SAT(version2014.2).pdf

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. LUO et al.: CLAUSE STATES BASED CONFIGURATION CHECKING IN LOCAL SEARCH FOR SATISFIABILITY

TABLE XIV C OMPARATIVE R ESULTS ON THE 3-SAT_SC2012 B ENCHMARK . E ACH S OLVER I S P ERFORMED FOR T EN RUNS ON E ACH I NSTANCE W ITH A C UTOFF T IME OF 2000 S

TABLE XV C OMPARATIVE R ESULTS ON THE 3SAT- V0.1M C LASS (1.0M = 106 ) F ROM THE 3-SAT_H UGE B ENCHMARK . E ACH S OLVER I S P ERFORMED FOR O NE RUN ON E ACH I NSTANCE W ITH A C UTOFF T IME OF 10 000 S

13

achieves state-of-the-art performance on a broad range of random 3-SAT instances with up to million variables, and competes well with state-of-the-art solvers on structured instances. Then we used the recently proposed linear make function to improve FrwCB, resulting in a new FRW algorithm dubbed FrwCBlm, which shows great efficiency and robustness on random k-SAT instances with k > 3. Besides the efficiency, the experiments also demonstrate that CSCC is very robust, as CSCC can be applied to designing efficient two-mode SLS and FRW algorithms, and cooperates well with several different strategies, such as break minimum, age, and linear make. For future work, we plan to combine the CSCC strategy with other algorithmic techniques, such as probability distribution [23], [32] and aspiration [3]. Also, inspired by the success of combining CSCC with NVCC based on their relationship [48], we would like to explore relationships among CSCC and other forbidden strategies, and thus combine them to develop more efficient SLS algorithms for SAT. Additionally, we would like to apply the CSCC strategy to improving the performance of SLS algorithms on solving the weighted maximum satisfiability problem [49]. ACKNOWLEDGMENT

Fig. 4. Averaged time of FrwCB and FrwCB_alt on the 3-SAT_SC2011 benchmark.

The authors would like to thank the anonymous referees for their helpful comments and suggestions in this paper and also in preliminary versions [1], [2] of this paper. They would also like to thank J. Li for proofreading this paper. R EFERENCES

B. Empirical Analyzes on CSCC and NVCC Applied to FRW To show the superiority of CSCC over NVCC on FRW, we directly replace CSCC with NVCC in the pseudo-code of FrwCB (Algorithm 2), resulting in an alternative version called FrwCB_alt. Then, we compare FrwCB with FrwCB_alt on extensive random 3-SAT instances, including the 3-SAT_SC2011 benchmark, the 3-SAT_SC2012 benchmark and the 3SAT-v0.1M class from the 3-SAT_Huge benchmark. The experimental results are presented in Tables XIII–XV, and Fig. 4. According to the experimental results, it is apparent that FrwCB dramatically outperforms FrwCB_alt by several orders of magnitudes on these evaluating benchmarks, indicating that CSCC is much more efficient and more effective than NVCC in FRW algorithms. To the best of our knowledge, the CSCC strategy is currently the only CC strategy that can be used to improve performance of FRW algorithms. X. C ONCLUSION We proposed a completely new CC strategy based on clause states, which is called CSCC. Compared to the previous NVCC strategy which is only effective on the two-mode SLS paradigm and loses power on the FRW paradigm, the CSCC strategy shows its efficiency on both two-mode SLS and FRW paradigms. We used CSCC to develop a two-mode SLS algorithm called Swqcc and an FRW algorithm called FrwCB. The related experiments show that Swqcc significantly outperforms Swcc on random 3-SAT instances. Also, FrwCB

[1] C. Luo, K. Su, and S. Cai, “Improving local search for random 3-SAT using quantitative configuration checking,” in Proc. 20th Eur. Conf. Artif. Intell. (ECAI), 2012, pp. 570–575. [2] C. Luo, S. Cai, W. Wu, and K. Su, “Focused random walk with configuration checking and break minimum for satisfiability,” in Proc. Constraint Program., Uppsala, Sweden, Sep. 2013, pp. 481–496. [3] S. Cai and K. Su, “Local search for Boolean satisfiability with configuration checking and subscore,” Artif. Intell., vol. 204, pp. 75–98, Nov. 2013. [4] J. Gu, “Local search for satisfiability (SAT) problem,” IEEE Trans. Syst., Man, Cybern., Syst., vol. 23, no. 4, pp. 1108–1129, Jul./Aug. 1993. [5] S. Cai and K. Su, “Local search with configuration checking for SAT,” in Proc. 23rd IEEE Int. Conf. Tools Artif. Intell. (ICTAI), Boca Raton, FL, USA, Nov. 2011, pp. 59–66. [6] E. Aurell, U. Gordon, and S. Kirkpatrick, “Comparing beliefs, surveys and random walks,” in Proc. Adv. Neural Inf. Process. Syst., vol. 17. 2005, pp. 49–56. [7] P. W. Purdom, “Solving satisfiability with less searching,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 6, no. 4, pp. 510–513, Apr. 1984. [8] S. G. Vadlamudi, S. Aine, and P. P. Chakrabarti, “MAWA∗ —A memorybounded anytime heuristic-search algorithm,” IEEE Trans. Syst., Man, Cybern. B, Cybern., vol. 41, no. 3, pp. 725–735, Jun. 2011. [9] M. Davis and H. Putnam, “A computing procedure for quantification theory,” J. ACM, vol. 7, no. 3, pp. 201–215, Jul. 1960. [10] M. Davis, G. Logemann, and D. W. Loveland, “A machine program for theorem-proving,” Commun. ACM, vol. 5, no. 7, pp. 394–397, 1962. [11] H. H. Hoos and T. Stützle, Stochastic Local Search: Foundations & Applications. San Francisco, CA, USA: Elsevier/Morgan Kaufmann, Sep. 2004. [12] H. Xia, J. Zhuang, and D. Yu, “Combining crowding estimation in objective and decision space with multiple selection and search strategies for multi-objective evolutionary optimization,” IEEE Trans. Cybern., vol. 44, no. 3, pp. 378–393, Mar. 2014. [13] C. H. Papadimitriou, “On selecting a satisfying truth assignment,” in Proc. 32nd Annu. Symp. Found. Comput. Sci., San Juan, PR, USA, Oct. 1991, pp. 163–169. [14] W. Michiels, E. H. L. Aarts, and J. H. M. Korst, Theoretical Aspects of Local Search. Berlin, Germany: Springer, 2007.

This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination. 14

[15] F. Glover, “Tabu search—Part I,” INFORMS J. Comput., vol. 1, no. 3, pp. 190–206, Aug. 1989. [16] F. Glover, “Tabu search—Part II,” INFORMS J. Comput., vol. 2, no. 1, pp. 4–32, Feb. 1990. [17] B. Mazure, L. Sais, and É. Grégoire, “Tabu search for SAT,” in Proc. Amer. Assoc. Artif. Intell., 1997, pp. 281–285. [18] R. Battiti and M. Protasi, “Reactive local search for the maximum clique problem,” Algorithmica, vol. 29, no. 4, pp. 610–637, Apr. 2001. [19] K. Smyth, H. H. Hoos, and T. Stützle, “Iterated robust tabu search for MAX-SAT,” in Proc. Can. Conf. Artif. Intell., Halifax, NS, Canada, Jun. 2003, pp. 129–144. [20] L. D. Gaspero and A. Schaerf, “A composite-neighborhood tabu search approach to the traveling tournament problem,” J. Heuristics, vol. 13, no. 2, pp. 189–207, Apr. 2007. [21] C. M. Li and W. Q. Huang, “Diversification and determinism in local search for satisfiability,” in Proc. SAT, St. Andrews, U.K., Jun. 2005, pp. 158–172. [22] C. M. Li, W. Wei, and H. Zhang, “Combining adaptive noise and look-ahead in local search for SAT,” in Proc. SAT, Lisbon, Portugal, May 2007, pp. 121–133. [23] A. Balint and A. Fröhlich, “Improving stochastic local search for SAT with a new probability distribution,” in Proc. SAT, Edinburgh, U.K., Jul. 2010, pp. 10–15. [24] O. Gableske and M. Heule, “EagleUP: Solving random 3-SAT using SLS with unit propagation,” in Proc. SAT, Ann Arbor, MI, USA, Jun. 2011, pp. 367–368. [25] C. M. Li and Y. Li, “Satisfying versus falsifying in local search for satisfiability,” in Proc. SAT, Trento, Italy, Jun. 2012, pp. 477–478. [26] S. Cai, K. Su, and A. Sattar, “Local search with edge weighting and configuration checking heuristics for minimum vertex cover,” Artif. Intell., vol. 175, nos. 9–10, pp. 1672–1696, Jun. 2011. [27] Y. Yang and X. Li, “Towards a snowdrift game optimization to vertex cover of networks,” IEEE Trans. Cybern., vol. 43, no. 3, pp. 948–956, Jun. 2013. [28] S. Cai and K. Su, “Configuration checking with aspiration in local search for SAT,” in Proc. Amer. Assoc. Artif. Intell., 2012, pp. 434–440. [29] A. Braunstein, M. Mézard, and R. Zecchina, “Survey propagation: An algorithm for satisfiability,” Random Struct. Algorithms, vol. 27, no. 2, pp. 201–226, Sep. 2005. [30] S. Cai, K. Su, and C. Luo, “Improving WalkSAT for random k-satisfiability problem with k > 3,” in Proc. Amer. Assoc. Artif. Intell., 2013, pp. 145–151. [31] B. Selman, H. A. Kautz, and B. Cohen, “Noise strategies for improving local search,” in Proc. Amer. Assoc. Artif. Intell., Seattle, WA, USA, Jul. 1994, pp. 337–343. [32] A. Balint and U. Schöning, “Choosing probability distributions for stochastic local search and the role of make versus break,” in Proc. SAT, Trento, Italy, Jun. 2012, pp. 16–29. [33] D. A. D. Tompkins, A. Balint, and H. H. Hoos, “Captain Jack: New variable selection heuristics in local search for SAT,” in Proc. SAT, Ann Arbor, MI, USA, Jun. 2011, pp. 302–316. [34] D. A. McAllester, B. Selman, and H. A. Kautz, “Evidence for invariants in local search,” in Proc. Amer. Assoc. Artif. Intell., Providence, RI, USA, 1997, pp. 321–326. [35] B. Selman, H. J. Levesque, and D. G. Mitchell, “A new method for solving hard satisfiability problems,” in Proc. Amer. Assoc. Artif. Intell., San Jose, CA, USA, Jul. 1992, pp. 440–446. [36] H. H. Hoos and T. Stützle, “Local search algorithms for SAT: An empirical evaluation,” J. Autom. Reasoning, vol. 24, no. 4, pp. 421–481, 2000. [37] F. Hutter, D. A. D. Tompkins, and H. H. Hoos, “Scaling and probabilistic smoothing: Efficient dynamic local search for SAT,” in Proc. Constraint Program., Ithaca, NY, USA, Sep. 2002, pp. 233–248. [38] H. H. Hoos and T. Stützle, “Systematic vs. local search for SAT,” in Proc. KI, Bonn, Germany, Sep. 1999, pp. 289–293. [39] Z. Wu and B. W. Wah, “An efficient global-search strategy in discrete Lagrangian methods for solving hard satisfiability problems,” in Proc. Amer. Assoc. Artif. Intell., 2000, pp. 310–315. [40] W. Wei, C. M. Li, and H. Zhang, “Switching among non-weighting, clause weighting, and variable weighting in local search for SAT,” in Proc. Constraint Program., Sydney, NSW, Australia, Sep. 2008, pp. 313–326. [41] K. Xu, F. Boussemart, F. Hemery, and C. Lecoutre, “A simple model to generate hard satisfiable instances,” in Proc. Int. Joint Conf. Artif. Intell. (IJCAI), Edinburgh, U.K., 2005, pp. 337–342.

IEEE TRANSACTIONS ON CYBERNETICS

[42] K. Xu, F. Boussemart, F. Hemery, and C. Lecoutre, “Random constraint satisfaction: Easy generation of hard (satisfiable) instances,” Artif. Intell., vol. 171, nos. 8–9, pp. 514–534, Jun. 2007. [43] M. D. T. Lewis, T. Schubert, and B. Becker, “Speedup techniques utilized in modern SAT solvers,” in Proc. SAT, Andrews, U.K., Jun. 2005, pp. 437–443. [44] M. Järvisalo, A. Biere, and M. Heule, “Simulating circuit-level simplifications on CNF,” J. Autom. Reasoning, vol. 49, no. 4, pp. 583–619, Dec. 2012. [45] W. Guo, G. Yang, W. N. N. Hung, and X. Song, “Complete Boolean satisfiability solving algorithms based on local search,” J. Comput. Sci. Technol., vol. 28, no. 2, pp. 247–254, Mar. 2013. [46] A. Biere. (2011). “Lingeling and friends at the SAT competition 2011,” Inst. Formal Models Verif., Johannes Kepler Univ., Linz, Austria, Tech. Rep. 11/1, [Online]. Available: http://fmv.jku.at/papers/ Biere-FMV-TR-11-1.pdf [47] C. Luo, K. Su, and S. Cai, “More efficient two-mode stochastic local search for random 3-satisfiability,” Appl. Intell., to be published. [48] C. Luo, S. Cai, W. Wu, and K. Su, “Double configuration checking in stochastic local search for satisfiability,” in Proc. Amer. Assoc. Artif. Intell., 2014, pp. 2703–2709. [49] C. Luo, S. Cai, W. Wu, Z. Jie, and K. Su, “CCLS: An efficient local search algorithm for weighted maximum satisfiability,” IEEE Trans. Comput., to be published.

Chuan Luo received the B.Eng. degree in computer science from the South China University of Technology, Guangzhou, China, in 2011. He is currently pursuing the Ph.D. degree in computer science from Peking University, Beijing, China. His current research interests include heuristic search and optimization.

Shaowei Cai received the B.Eng. degree in computer science from the South China University of Technology, Guangzhou, China, in 2008, and the Ph.D. degree in computer science from Peking University, Beijing, China, in 2012. His current research interests include optimization, heuristics, and randomized algorithms.

Kaile Su received the Ph.D. degree in mathematics from Nanjing University, Nanjing, China, in 1995. He is currently an Associate Professor with the Institute for Integrated and Intelligent Systems, Griffith University, Brisbane, QLD, Australia. His current research interests include modal logic, model checking multiagent systems, and experimental algorithms for hard problems.

Wei Wu received the B.Eng. degree in computer science from the Central South University, Changsha, China, in 2011. He is currently pursuing the M.Sc. degree in computer science from Peking University, Beijing, China. His current research interests include local search and data mining.

Clause states based configuration checking in local search for satisfiability.

Two-mode stochastic local search (SLS) and focused random walk (FRW) are the two most influential paradigms of SLS algorithms for the propositional sa...
2MB Sizes 7 Downloads 5 Views