Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Vector generalized linear model wikipedia , lookup
Pattern recognition wikipedia , lookup
Factorization of polynomials over finite fields wikipedia , lookup
Dynamic programming wikipedia , lookup
Numerical continuation wikipedia , lookup
Knapsack problem wikipedia , lookup
Granular computing wikipedia , lookup
K-nearest neighbors algorithm wikipedia , lookup
Computing q-Horn Strong Backdoor Sets: a preliminary experimentation Richard Ostrowski and Lionel Paris! LSIS CNRS UMR 7296 Université d’Aix Marseille {richard.ostrowski, lionel.paris}@lsis.org Abstract. Identifying and exploiting hidden problem structures is recognized as a fundamental way to deal with the intractability of combinatorial problems. A particular structure called (Strong) Backdoor has been identified in the context of the satisfiability problem. Connections has been established between Backdoors and problem hardness leading to a better approximation of the worst case time complexity. Strong Backdoor sets can be computed for any tractable class. In [1], a method for the approximation of Strong Backdoor sets for the Horn-Sat fragment was proposed. This approximation is realized in two steps. First, the best Horn renaming of the original CNF formula, in term of number of clauses, is computed. Then a Horn Strong Backdoor set is extracted from the non Horn part of the renamed formula. In this article, we extend this method to the class of q-Horn [2] which is an extension of the Horn class and 2-SAT. Experimental results show that the size of the Strong Backdoor set with respect to the q-Horn fragment is slightly better than for the Horn fragment. 1 Introduction Propositional satisfiability (SAT) is the problem of deciding whether a Boolean formula in conjunctive normal form (CNF) is satisfiable or not. SAT is one of the most studied NP-Complete problems because of its theoretical and practical importance. Encouraged by the impressive progress in practical solving of SAT, various applications (planning, formal verification, equivalency and logical circuits simplifications, etc.) are encoded and solved using SAT. Most of the best complete solvers are based on the Conflict Driven Clause Learning scheme introduced by Grasp [3], efficiently implemented in Chaff [4] and popularized by Minisat [?]. Such a basic algorithm is enhanced with many important pruning techniques such as learning, extended use of Boolean constraints propagation, preprocessing, symmetries detection and exploitation, etc. The other important class of satisfiability algorithms concerns local search based methods. These techniques can not prove unsatisfiability, since search space is explored in a non systematic way (e.g. [5, 6]). However, impressive performance are obtained on hard and large satisfiable instances (including random instances). During last years, several authors have focused on detecting possible hidden structures inside SAT instances (e.g backbones [7], Backdoors [8, 9], equivalences ! This work was supported by the French National Research Agency under grant TUPLES (ANR-2010-BLAN-0210). [10] and functional dependencies [11]), cardinality constraints [12] allowing to explain and improve the efficiency of SAT solvers on large real-world instances. Other important theoretical results like heavy tailed phenomena [8] and backbones [13] were also obtained leading to a better understanding of problem hardness. The efficiency of satisfiability solvers can be in part explained using these results. In this paper, we focuses our attention on the Strong Backdoor sets computation problem. Let us recall that a set of variables forms a Backdoor for a given formula if there exists an assignment to these variables such that the simplified formula can be solved in polynomial time. Such a set of variables is called a Strong Backdoor, if any assignment to these variables leads to a tractable sub-formula. As all optimization problems, computing the smallest Strong Backdoor is an NP-hard problem. Approximating (in polynomial time) the ”smallest” Strong Backdoor set is an interesting and important research issue. In this article, we are interested in computing a Strong Backdoor set for the tractable q-Horn class. The q-Horn class, generalizing the important classes of 2-SAT, Horn, and disguised Horn formulas, has been introduced in [2]. In [14], the authors proposed a linear algorithm for recognizing a q-Horn formula. We implemented this algorithm to determine whether a formula is q-Horn and if it is not, we compute a Strong Backdoor. This Strong Backdoor set corresponds to a deletion Strong Backdoor set introduced in [15]. In this article, the authors propose a algorithm with a time complexity exponential in the size of the Strong Backdoor set. This huge complexity prevents it from being tractable. That is why we suggest approximating it with a competitive algorithm. The paper is organized as follows. First we give preliminary definitions linked to the paper context. Then, we recall the principle of the algorithm to determine whether a formula is q-Horn. If the formula is not a q-Horn formula, we calculate a Strong Backdoor set by translating the associated feedback vertex set problem into a MAX-SAT problem. Finally, we present some experimental results comparing the size of the Strong Backdoor computed when considering the tractable class of Horn (or disguised Horn) and q-Horn. To conclude, the scope of these results is discussed and some paths for future works are given. 2 Preliminary Definitions and Notations Let B be a Boolean (i.e. propositional) language of formulas built in the standard way, using usual connectives (∨, ∧, ¬, ⇒, ⇔) and a set of propositional variables. A CNF formula Σ is a set (interpreted as a conjunction) of clauses, where a clause is a set (interpreted as a disjunction) of literals. A literal is a positive (l) or negated (¬l or l) propositional variable. Let us recall that any Boolean formula can be translated to CNF using linear Tseitin ! encoding [16]. The size of CNF Σ is defined by c∈Σ |c| where |c| is the number of literals in c. A unit (resp. binary) clause is a clause of size 1 (resp. 2). A unit literal is the unique literal of a unit clause. A unit clause C = {l} is said to be positive if its unit literal l is positive (l ∈ V). We note nbV ar(Σ) (resp. nbCla(Σ)) the number of variables (resp. clauses) of Σ. V(Σ) (resp. L(Σ)) is the set of variables (resp. literals) occurring in Σ. A set of literals S ⊂ L(Σ) is consistent iff ∀l ∈ S, ¬l ∈ / S. Given a set of literals S, we define ∼ S = {¬l|l ∈ S}. A literal l ∈ L(Σ) is called monotone if ¬l ∈ / L(Σ). We note V + (Σ) (resp. V − (Σ)) as the set of variables occurring in Σ at least one time with positive (resp. negative) polarity. For each literal l, OccΣ (l) represents the set {C ∈ Σ|l ∈ C} i.e. the set of clauses of Σ in witch literal l appears. We will simply write Occ(l) if no confusion can be made. A truth assignment of a Boolean formula Σ is an assignment of truth values {true, f alse} to its variables. A variable x is satisfied (resp. falsified) under I if I[x] = true (resp. I[x] = f alse). A truth assignment I can be represented as a set of literals. A literal l ∈ I (resp. ¬l ∈ I) if I[l] = true (resp. I[l] = f alse). When considering partial assignments, in witch some variables are not yet instantiated, those uninstantiated variables does not occur in the interpretation, neither in positive polarity, nor in negative one. A model of a formula Σ is a truth assignment I such that I(Σ) = {}. Accordingly, SAT consists in determining if the formula admits a model, or not. 3 Algorithm for q-Horn formulas detection A CNF formula Σ is a q-Horn formula if it exists a certifying! function β: L(Σ) → {0, 1/2, 1} with β(l)=1-β(l) for every l ∈ V(Σ) such that l∈C β(l) ≤ 1 for every clause C of Σ. In [14], the authors proposed a linear time algorithm to determine if a CNF formula is a q-Horn formula. The principle is to convert the set of clauses into a directed graph G and then to calculate the Strongly connected components. Depending on the component, a value among 0,1/2 or 1 is assigned to each literal of the formula. The set of variables corresponding to the literals assigned to 0 or 1 is called H, whereas the set of variables corresponding to the literals assigned to 1/2 is called Q. Each clause is finally analyzed to verify that the sum of the value of the literals is less or equal to 1 (meaning that each clause must contain at most 2 literals of L(Q)). 4 Computing a Strong Backdoor set When a formula is not a q-Horn formula, we use the values returned by the previous algorithm for each literal to calculate a Strong Backdoor set. The principle is to focus on the clauses for which the sum of the value of the literals (provided by the certifying function) is greater than 1. This means that there is at least 3 literals per clause having the value 1/2. The Strong Backdoor corresponds to the smallest set of variables of Q such that, when withdrawing them from the formula, every clauses contain at most 2 variables of L(Q). This problem can be reduced easily to the optimization version of the Feedback Vertex Set problem, known to be N P − Hard [17]. Different approaches are used to solve the FVS problem efficiently [18]. Recently, [19, 20] proposed new local search methods. All these approaches are based on a graph representation. As the implementation of their algorithms are not public, we reduce the FVS problem into a weighted MAX-SAT problem where efficient solvers are available [21, 22]. The reduction consists in: – Extracting the set of variables corresponding to the literals of Q in all the clauses containing more than 2 of them. – Considering these sets as positive clauses. – For all these clauses, encoding a set of clauses expressing the cardinality constraint ”at most 2 among all the concerned literals”. All of the added clauses have an infinite weight – Adding the unit clauses containing the positive literals with a weight of 1. – Using MaxWalkSAT [22] to find the smallest Strong Backdoor (variables set to 1). 5 Experimental results In order to validate our approach, we computed Strong Backdoor sets with respect to q-Horn using the proposed algorithm, and compared the results in terms of size, to the results obtained with respect to Horn, using the approach proposed in [1]. For the experimentation, we selected more that 5000 instances issued from the last SAT competitions and satLib, and we ran both methods on them. In the amount of instances, we excluded all the random ones, and those with a huge size. The results that we obtained are shown in figure 1. Each point represents an instance, and both coordinate are equals to the size of the smallest q-Horn Strong Backdoor set and the size of the smallest Horn Strong Backdoor set. All the points located above the med-line represent the instances for which the Horn Strong Backdoor sets are bigger that the q-Horn ones. As we can see, the results are not as propitious as we would like. Indeed, as q-Horn is a strict generalization of Horn, we would have expected that in the worst case, the q-Horn Strong Backdoor set would have the same size as the Horn one. But this is not the case! We investigated the situation to find an explanation, and discovered this particular case: Lets consider the set of clauses {l1 ∨ l2 ∨ ¬l3 ∨ ¬l4 , ¬l1 ∨ ¬l2 ∨ l3 , ¬l1 ∨ ¬l2 , ∨l4 }. We can see that only the first clause is not Horn and contains 2 positive literals. Thus, a Horn Strong Backdoor is obtained by removing one of these literals and then, the size of the set is one. On the other hand, according to the recognition algorithm of q-Horn formulas, we obtain that all the variables are assigned to 1/2. Thus, we need to remove at least 2 variables in the first clauses and 1 in the second one. Hence, the minimal size of the q-Horn Strong Backdoor set is two. By increasing the size of this simple example, we can easily explain the fact that sometimes (quite often unfortunately), the Horn Strong Backdoor sets are smaller. 6 Conclusions and perspectives In this work we presented an original way to compute Strong Backdoor sets with respect to q-Horn clauses, which is one of the largest tractable class known. As a reminder, we have: Horn ! Renameable − Horn ! q − Horn " 2 − SAT As far as we know, this is the first attempt to exploit ”in practice” the qHorn class. We saw that most of the time, the size of the Strong Backdoor sets computed with our method provides smaller sets than regrading Horn formulas. However, if in the case of Horn clauses, the exploitation of the Strong Backdoors were trivial, due to the fact that solving a Horn Formula is done by using unit 450 1600 400 1400 350 1200 300 #SB Horn #SB Horn 1000 250 200 800 600 150 400 100 200 50 0 50 100 #SB q-Horn 150 0 200 3000 3500 2500 3000 2000 2500 #SB Horn #SB Horn 0 1500 1500 500 1000 500 600 700 #SB q-Horn 800 900 1000 240 260 280 300 320 #SB q-Horn 340 360 380 400 1200 1400 1600 1800 2000 2200 #SB q-Horn 2400 2600 2800 3000 2000 1000 0 400 220 500 1000 Fig. 1. Size of the Strong Backdoor for horn and q-Horn sub-formulas on some instances propagation (and all the solvers do unit propagation at each node), in the case of q-Horn clauses, we have to implement a dedicated method in the chosen solver. This represents our main perspective: find a way to exploit the Strong Backdoors sets obtained by our new method. Another perspective would be to tackle the phenomenon discovered during the experimentations. Indeed, q-Horn including strictly Horn, there must be a way to guarantee that the Strong Backdoor sets obtained with the q-Horn class will strictly be smaller than the one obtained with Horn formulas. The fact that, in our method we only deal with variables in Q to compute our Strong Backdoor set, may be the cause of the problem. Maybe we should find a way to integrate the variables of H in the computation of the Strong Backdoor set to circumvent the problem. References 1. Paris, L., Ostrowski, R., Siegel, P., Saı̈s, L.: Computing and exploiting horn strong backdoor sets thanks to local search. In: Proceedings of the 18th International Conference on Tools with Artificial Intelligence (ICTAI’2006), Washington DC, United States (2006) 139–143 2. Boros, E., Crama, Y., Hammer, P.L.: Polynomial-time inference of all valid implications for horn and related formulae. Annals of Mathematics and Artificial Intelligence 1 (1990) 21–32 3. Silva, J.P.M., Sakallah, K.A.: GRASP: A new search algorithm for satisfiability. In: Proceedings of the IEEE/ACM International Conference on Computer-Aided Design, Washington, IEEE Computer Society Press (1996) 220–227 4. Moskewicz, M.W., Madigan, C.F., Zhao, Y., Zhang, L., Malik, S.: Chaff : Engineering an efficient sat solver. In: Proceedings of 38th Design Automation Conference (DAC01). (2001) 5. Selman, B., Kautz, H.A.: An empirical study of greedy local search for satisfiability testing. (1993) 6. Mazure, B., Saı̈s, L., Grégoire, É.: Tabu search for SAT. In: Proceedings of the 14th National Conference on Artificial Intelligence and 9th Innovative Applications of Artificial Intelligence Conference (AAAI-97/IAAI-97), AAAI Press (1997) 281–285 7. Dubois, O., Dequen, G.: A backbone-search heuristic for efficient solving of hard 3–sat formulae. In: Proceedings of the 17th International Joint Conference on Artificial Intelligence (IJCAI–01). (2001) 8. Williams, R., Gomes, C., Selman, B.: On the connections between heavy-tails, backdoors, and restarts in combinatorial search. In: International Conference on Theory and Applications of Satisfiability Testing (SAT’2003). (2003) 9. Williams, R., Gomes, C., Selman, B.: Backdoors to typical case complexity. In: Procceding of Intenrational Joint Conference on Artificial Intelligence (IJCAI’2003). (2003) 10. Li, C.M.: Integrating equivalency reasoning into davis-putnam procedure. In: proceedings of Conference on Artificial Intelligence AAAI, Austin, USA, AAAI Press (2000) 291–296 11. Grégoire, E., Mazure, B., Ostrowski, R., Saı̈s, L.: Automatic extraction of functional dependencies. In: proc. of SAT. Volume 3542 of LNCS. (2005) 122–132 12. Biere, A., Berre, D.L., Lonca, E., Manthey, N.: Detecting cardinality constraints in cnf. 17th International Conference on Theory and Applications of Satisfiability Testing (2014) 13. Kilby, P., Slaney, J., Thiebaux, S., Walsh, T.: Backbones and backdoors in satisfiability. In: AAAI’2005. (2005) 14. Boros, E., Hammer, P.L., Sun, X.: Recognition of q-Horn formulae in linear time. Discrete Applied Mathematics 55 (1994) 1–13 15. Gaspers, S., Ordyniak, S., Ramanujan, M.S., Saurabh, S., Szeider, S.: Backdoors to q-horn. Symposium on Theoretical Aspects of Computer Science (2013) 16. Tseitin, G.: On the complexity of derivations in the propositional calculus. In Slesenko, H., ed.: Structures in Constructives Mathematics and Mathematical Logic, Part II. (1968) 115–125 17. Karp, R.M.: Reducibility among combinatorial problems. In Miller, R.E., Thatcher, J.W., eds.: Symposium on Complexity of Computer Computations, New York, Plenum Press, New York (1972) 85–103 18. Brunetta, L., Maffioli, F., Trubian, M.: Solving the feedback vertex set problem on undirected graphs. Discrete Applied Mathematics 101 (1999) 37–51 19. Zhang, Z., Ye, A., Zhou, X., Shao, Z.: An efficient local search for the feedback vertex set problem. (2013) 20. Philippe, G., Adjarath, L.E., Bouzidi, Wassim, M.: Applying local search to the feedback vertex set problem. Journal of Heuristics 19 (2013) 797–818 21. Xing, Z., Zhang, W.: Maxsolver: An efficient exact algorithm for (weighted) maximum satisfiability. Artificial Intelligence 164 (2005) 47–80 22. Selman, B., Kautz, H., Cohen, B.: Local search strategies for satisfiability testing. In: DIMACS SERIES IN DISCRETE MATHEMATICS AND THEORETICAL COMPUTER SCIENCE. (1995) 521–532