Ramos A., van der Tak P., Heule M.J.H. (2011) Between Restarts and Backjumps. In: Sakallah K.A., Simon L. (eds) Theory and Applications of Satisfiability Testing - SAT 2011. SAT 2011. Lecture Notes in Computer Science, vol 6695. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-21581-0_18
Abstract
This paper introduces a novel technique that significantly reduces the computational costs to perform a restart in conflict-driven clause learning (CDCL) solvers. Our technique exploits the observation that CDCL solvers make many redundant propagations after a restart. 译文:我们的技术利用了CDCL求解器在重新启动后会产生许多冗余传播的观察结果。It efficiently predicts which decisions will be made after a restart. This prediction is used to backtrack to the first level at which heuristics may select a new decision rather than performing a complete restart.译文:此预测用于回溯到启发式可能选择新决策而不是执行完全重新启动的第一级。 In general, the number of conflicts that are encountered while solving a problem can be reduced by increasing the restart frequency, even though the solving time may increase. Our technique counters the latter effect. As a consequence CDCL solvers will favor more frequent restarts.译文:一般来说,在解决问题时遇到的冲突数量可以通过增加重启频率来减少,即使解决时间可能会增加。我们的技术对抗后一种效果。因此,CDCL解决程序将倾向于更频繁地重新启动。 |
|
1 Introduction
Restarts are used in satisfiability (SAT) solvers to avoid heavy-tail behavior [4]. Restart strategies [7,14] have been a crucial feature in conflict-driven clause learning (CDCL) solvers [8] to tackle hard industrial problems. These solvers favor frequent restarts in recent years [5]. |
|
CDCL solvers select decision variables based on their involvement in emerged conflicts [10]. In case of frequent restarts, only several new conflicts have been hit between two succeeding restarts. As a consequence, CDCL solvers tend to select the same variables in a similar order after succeeding restarts.译文:因此,CDCL解决程序往往会在随后的重新启动之后以类似的顺序选择相同的变量。
Additionally, phase-saving [12] ensures that decision variables are assigned to the same truth value as the value they were assigned to before a restart.译文:另外,相位节约[12]确保决策变量被赋给与重新启动之前赋给它们的值相同的真值。 Due to these heuristics, CDCL solvers generally do not perform a full restart, but effectively they perform |
|
This paper capitalizes on this observation by introducing two techniques to reduce the computational costs to perform a restart.译文:本文利用这一观察结果,引入了两种技术来降低执行重启的计算成本。 In case the solver wants to restart, we show how to efficiently predict the first level at which the heuristics The solver can perform a partial restart by backtracking to this level, rather than perform a more costly full restart.译文:求解器可以通过回溯到这个级别来执行部分重启,而不是执行开销更大的完全重启。 |
|
Additionally, by reducing the restart costs, it appears that restarting even more frequently improves the performance of CDCL solvers.译文:此外,通过降低重启成本,似乎更频繁地重启可以提高CDCL解决程序的性能。 We implemented our techniques in MiniSAT 2.2 [2]. Experiments show that the enhanced version with rapid restarts solves more real-world SAT instances from the SAT 2009 application suite than the original version.译文:我们在MiniSAT 2.2[2]中实现了我们的技术。实验表明,与原始版本相比,具有快速重启功能的增强版本解决了更多来自SAT 2009应用程序套件的真实SAT实例。 |
|
The remainder of this paper is structured as follows: the next section provides some background information about CDCL solvers and corresponding terminology.
Experimental results are described in Section 5. Finally, we offer suggestions for future work in Section 6 and we draw conclusions in Section 7. |
|
2 Conflict-Driven Clause Learning Solvers
The strategy used by conflict-driven clause learning (CDCL) solvers is to make a series of decisions (heuristically chosen assignments) and to propagate assignments that can be derived from these decisions by means of unit propagation (satisfying the remaining literal in every unit clause). The solver will continue to make decisions and propagate information until either a satisfying assignment is |
|
A conflict emerges if the solver finds a conflicting clause – a clause for which all literals are false. When this occurs, the solver analyzes the reason for the conflict. This is captured in a so-called learned clause [9,10] , which intuitively can be considered a clause that will avoid recurrence of the same combination of assignments that led to the conflict. Now, the solver unassigns variables until the learned clause becomes unit and continues to make decisions and apply other unit propagations as before.译文:现在,求解器将不分配变量,直到learned子句成为单元,并像以前一样继续做出决策并应用其他单元传播。 |
|
The terminology introduced in this section is used in the remainder of this paper. Fig. 1 graphically shows the most important terms. This figure will also be used as a running example throughout the paper. |
|
2.1 Heuristics | |
After a decision variable is selected by the solver, it must be assigned a value. A commonly used method is phase-saving [12], which stores for each variable the last value to which it was assigned by unit propagation. Decision variables are assigned to that value. By assigning variables to their last implied value, the solver picks up where it left off and continues its search in a similar part of the search space after a restart. Therefore, phase-saving facilitates frequent restarts. 译文:通过将变量赋给它们的最后一个隐含值,求解器将从停止的地方继续搜索,并在重新启动后在搜索空间的类似部分继续搜索。因此,节约相位有利于频繁的重新启动。 红色标记处的叙述对吗???--是否把回溯与重启概念搞混了。或者认为回溯就是一种小范围的重启。 |
|
2.2 Decision levels and Backjumping | |
Each decision introduces a new decision level. A decision level consists of the sequence of assignments of a decision variable and all variables that are implied by that decision. Decision levels are numbered incrementally, where 0 is the level where no decisions have yet been made – also known as the restart level.译文:决策级别是递增编号的,其中0是尚未做出决策的级别——也称为重启级别。 Decision level 1 is the first level that involves an actual decision. A decision is the first assignment in each level (denoted in Fig. 1 by the rectangles), other assignments, if any, are caused by unit propagation.译文:决策级别1是涉及实际决策的第一个级别。一个决策是每一层中的第一个分配(如图1中的矩形所示),其他分配,如果有的话,是由单元传播引起的。 |
|
The decision levels form a trail of assignments. This trail can be seen as a list of variable assignments at a certain moment in time. The trail comprises both decisions and unit propagations, where each decision starts a new decision Finally, the backjump level [3] is the level to which the solver backtracks whenever a conflict is found.译文:最后,backjump级别[3]是解决程序在发现冲突时回溯到的级别。 This is the level at which the learned clause is a unit clause. Notice that backjumping could be seen as performing a partial restart.译文:这是已学的子句作为单元子句的水平。请注意,回跳可以看作是执行部分重启。 |
|
2.3 Restart Strategies | |
Modern solvers use restarts to avoid spending too much time searching for a By restarting, When a restart is performed, Because the learned clauses and the VSIDS heuristic will have changed since the previous run, the new run may perform decisions in a different order.译文:因为learn子句和VSIDS启发式在上次运行之后发生了变化,所以新的运行可能以不同的顺序执行决策。 This could reduce the total number of decisions necessary to solve a problem [6]. |
|
A commonly used restart strategy in recent years is based on a sequence of In their work the authors show that the suggested sequence is log optimal when the runtime distribution of the problems is unknown. In this strategy the length of restart i is u · ti when u is a constant unit run and ti
Since unit runs are commonly short, solvers using the Luby restart strategy |
|
In this paper, we propose partial restarts which can be combined with these full restart strategies.译文:在本文中,我们提出了可与全重启策略相结合的部分重启策略。 An alternative partial restart strategy that has been proposed is random jump [15].译文:另一种部分重启策略是随机跳转。 This strategy randomly backtracks to a level between the restart level and the backjump level.译文:此策略随机返回到重新启动级别和回跳级别之间的级别。 In [11] a technique is proposed to partially restart based on the learned clause if certain conditions are met.译文:在[11]中,提出了一种在满足一定条件下,基于已学习子句部分重启的技术。 |
|
3 Motivation
The main contributions of this paper are two techniques to reduce the computational costs of performing a restart.译文:本文的主要贡献是降低执行重启的计算成本的两种技术。 In this section, we motive our work. First, we argue that CDCL solvers actually perform a partial restart and we indicate how to capitalize on that observation (Section 3.1).译文:首先,我们认为CDCL解决程序实际上执行了部分重启,并说明了如何利用该观察(第3.1节)。 Second, we show that CDCL solvers traverse a smaller part of the search space when they restart more frequently.译文:其次,我们展示了CDCL求解器在更频繁地重启时所遍历的搜索空间更小。
|
|
3.1 Partial Restart | |
The first observation that inspired the work below is that modern CDCL solvers
Recall that the variable with the highest activity that is not yet assigned is always selected as the next decision. The left part of Fig. 1 shows the assignments before the restart; the right shows the assignments after.译文:还记得吗,具有最高活动的尚未分配的变量总是被选择为下一个决策。图1左侧为重启前的赋值;右边是之后的作业。 |
|
Let us compare the two trails. The first similarity is that decision level 1 is exactly the same before and after the restart, because variable x1 still has the highest VSIDS score after the restart.————本人注释:实验证明,现代求解器已经不是这样实现了。
Due to this similarity, the solver actually performs a partial restart. Yet this observation is not exploited by current solvers.译文:然而,目前的解决者并没有利用这一观察结果。————做实验验证一下,连续衔接的两次启动(后一次是相对前一次的重启)的初始阶段决策云团是否一致。
We denote by MatchingTrail, the last level at which the trails before and after a restart completely match.译文:完全匹配。 We show how to compute this level efficiently in Section 4.1.
The reason for (i) is that CDCL solvers restart frequently.
This changes the VSIDS order of the variables only slightly.译文:这只稍微改变了变量的VSIDS顺序。 Additionally, (ii) is ensured by the phase-saving heuristic which is used by most CDCL solvers.
Therefore, performing a partial restart to the PermutedTrail level is similar to performing a full restart. 译文:因此,执行到PermutedTrail级别的部分重启类似于执行完全重启。 Section 4.2 shows how to compute this level efficiently. |
|
3.2 Restart Frequency | |
Another observation regarding restarts in modern CDCL solvers was presented in [5] showing that restarting with shorter unit runs reduces the size of the search space the solver explores to tackle a problem.译文:用更短的单元运行重新启动减少了求解者为解决问题而探索的搜索空间的大小。 More specifically, more frequent restarts reduce the number of conflicts encountered during the search.
|
|
First consider the number of solved instances shown in the first three columns. However, due to the costs of restarting frequently, using shorter unit runs does not result in solving more instances.译文:然而,由于频繁重新启动的成本,使用更短的单元运行不会解决更多的实例。 In fact, both effects appear to cancel each other out since the various settings solve practically the same number of instances.译文:实际上,这两种效果似乎是相互抵消的,因为各种设置实际上解决了相同数量的实例。 We aim to reduce the costs of restarts which should in turn favor solvers that restart more frequently.译文:我们的目标是降低重新启动的成本,这反过来应该有利于更频繁重启的解决方案。 |
|
4 Reducing Restart Costs
This section describes the two algorithms we propose to compute the level to which to backtrack, MatchingTrail and PermutedTrail. The algorithms rely on phase-saving, VSIDS ordering, and the absence of random decisions – all default in e.g. the latest MiniSAT 2.2. Furthermore, they should have access to the assignment type of each variable (Decision, Implication, Unassigned) and the decision level at which the variable was assigned.译文:此外,它们应该能够访问每个变量的赋值类型(Decision、Implication、Unassigned)和赋值变量的决策级别。 In the algorithms these are denoted by Assignment Type[x] and DecisionLevel[x] respectively, where x is |
|
4.1 Matching Trail | |
Fig. 2. Pseudo-code of the MatchingTrail algorithm. This algorithm returns the last |
|
Fig. 2 shows the pseudo-code of how to compute the MatchingTrail level.
The algorithm loops through variables in descending order of activity. If the variable is not currently assigned, the next decision level after the restart will be different and If the variable is already assigned a value at MTLevel or before, it will be an implied variable in both trails and can be ignored (Line 5). Finally, if it is a decision variable, it will be the next decision in the trail after the restart. Therefore, if the variable matches the decision at MTLevel, a match is found and MTLevel is incremented (Line 7). If not, the decisions at the next level will be different, and the algorithm returns the last |
|
Example. Again consider the example in Fig. 1. The algorithm starts with |
|
4.2 Permuted Trail | |
Fig. 3. Pseudo-code of the PermutedTrail algorithm. This algorithm returns the |
|
The PermutedTrail algorithm (Fig. 3) aims to compute the last level at which the partial assignment (and hence the reduced formula under this assignment) is exactly the same before and after a restart (recall Section 3.1). Like Matching-Trail, PermutedTrail loops through variables in descending order of activity.
Any variable that is currently unassigned terminates the algorithm, since this variable will become a decision that can never be part of a permutation of the current trail (Line 6). |
|
Now consider what happens when MatchCount = MinimalLevel.译文:现在考虑MatchCount = MinimalLevel时会发生什么。 By definition of MinimalLevel, the set of variables that the algorithm has processed so far is a subset of the variables that are assigned up to MinimalLevel. Because this set includes MatchCount decision variables, it must include each decision variable up to MinimalLevel. Since at least the same decisions are made, unit propagation will ensure that any currently implied variable is also assigned after the restart. Since the algorithm is performed at the backtrack level, no additional unit clauses may appear in the trail after the restart up to this point, which means that both trails must contain the exact same variables. Therefore the algorithm indicates that a partial restart is possible at this level in PTLevel (Line 10). |
|
Example. Consider how the algorithm will find the PermutedTrail level for |
|
4.3 Discussion | |
The MatchingTrail technique has the nice feature that solvers will explore the search space exactly the same as when performing a full restart. 译文:匹配路径技术有一个很好的特性,即求解者将会像执行一次完全重启一样探索搜索空间。
Yet although the reduced formula before and after a restart is exactly the same at the PermutedTrail level, the solver may explore the search space differently when this technique is applied.译文:然而,尽管重新启动之前和之后的简化公式在允许轨迹级别上完全相同,但当应用此技术时,求解者可能会以不同的方式探索搜索空间。 This is caused by the so-called reason clauses [2]. The reason clause for an implied variable is the one that assigned its truth value (the first to become unit). Reason clauses are used to compute learned clauses. By making decisions in a different order, the reason clauses may be different, which in turn could make the conflict clauses different.译文:通过以不同的顺序做决定,原因条款可能会不同,这反过来可能会使冲突条款不同。 This may influence the way the search space is explored.译文:这可能会影响搜索空间的探索方式。 |
|
Ideally one wants to backtrack to the last level at which the partial assignment is exactly the same before and after a restart.译文:理想情况下,我们希望回溯到最后一个级别,在这个级别上,重新启动前后的部分分配完全相同。 Although the Permuted-Trail algorithm is designed to do that, it may return a “subprime” level.译文:尽管保留轨迹算法被设计成这样,但它可能会返回一个“次级”级别。 |
|
To illustrate this, let LastSameAssignment be the ideal backtrack level (i.e. the last level where the partial assignment is the same before and after the restart). Let y be the decision variable at the LastSameAssignment level.
Because the partial assignment is the same, x is assigned in the trail after the restart, and because it has a lower activity than y it must be an implied variable. However, using the PermutedTrail algorithm, we cannot detect that x is implied by the assignments in the new trail.译文:然而,使用PermutedTrail算法,我们无法检测到新路径中的分配隐含了x。 Therefore it will not return the LastSameAssignment level.译文:因此,它不会返回LastSameAssignment级别。 During our experiments we observed that in practice this does not occur often, so that there is not much difference between the level returned by PermutedTrail and the LastSameAssignment level.译文:在我们的实验中,我们观察到这种情况在实践中并不经常发生,所以在允许轨迹返回的电平和最后相同的信号电平之间没有太大的差别。 |
|
5 Experimental Results
We implemented MatchingTrail and PermutedTrail in MiniSAT 2.2 and
We used the (292) application instances of the SAT 2009 competition2. Each |
|
5.1 Matching Trail | |
It turned out that the MatchingTrail algorithm was much less effective than the PermutatedTrail algorithm.译文:结果表明,匹配轨迹算法的效率远远低于置换轨迹算法。 Fig. 4 shows a typical distribution of the MatchingTrail, PermutedTrail, and backjump levels. The distributions of the PermutedTrail and backjump level are quite comparable. However, the MatchingTrail levels are generally much lower – which explains why it is less successful in reducing the restart costs. Therefore, we focused our experiments on the usefulness of the PermutedTrail algorithm.译文:因此,我们的实验集中在PermutedTrail算法的有效性上。 |
|
Fig. 4. Distribution of the MatchingTrail, PermutedTrail, and backjump levels while solving the ACG-15-10p1.cnf benchmark of the SAT 2009 competition using MiniSAT 2.2 with a Luby-1 restart strategy. |
|
5.2 Permuted Trail | |
In this section we compare the performance of MiniSAT 2.2 with and without PermutedTrail.
Comparing the performance of SAT solvers is hard, because a small change, for example to the order in which unit propagation is applied, can have a huge impact on the performance.译文:比较SAT求解器的性能是很困难的,因为一个很小的变化(例如对应用单元传播的顺序)就会对性能产生巨大的影响。 Therefore, our focus in this section is not only on solving time, but also on the number of conflicts per second.The latter seems a bit more robust (recall also Section 3.2).译文:因此,本节的重点不仅是解决时间,而且是每秒的冲突数量。后者似乎更健壮一些。 |
|
We experimented with three restart strategies. First, the default strategy of MiniSAT 2.2, which uses the Luby sequence with a unit run of 100 (in short Luby-100). Second, because we expect that the PermutedTrail technique is especially useful for short unit runs, we added the strategy with the shortest unit run 1 (Luby-1). Third, we included a radical strategy that restarts before every decision (Const-1). This strategy would profit most from PermutedTrail, showing thereby the maximum one could gain using this technique. Notice that a CDCL solver with the Const-1 restart strategy is still complete [13]. |
|
Fig. 5. Comparison of the number of conflicts per second (left) and solver runtime
|
|
Fig. 5 shows the number of conflicts per second (left) and the solving time |
|
In our last experiment, we wanted to see whether the use of Permuted- |
|
Fig. 6. Cactus plot showing the number of instances solved versus the time required 译文:Cactus图显示三种重启策略和两种配置所解决的实例数量与所需时间的对比。 |
|
Figure 6 shows the results. Combining PermutedTrail with = 0.75 increases |
|
6 Suggestions for Future Work
Although our algorithm finds a reasonably high partial restart level, the solver still performs redundant work sometimes when a decision variable becomes an implied variable after a restart (recall Section 4.3).译文:虽然我们的算法找到了一个相当高的部分重启水平,但当一个决策变量在重启后成为一个隐含变量时,求解器仍然执行冗余工作 The current algorithms will not always detect that, and therefore may not return the optimal backtrack level.译文:目前的算法不会总是检测到这一点,因此可能不会返回最佳回溯水平。
Yet, the PermutedTrail algorithm has also an important side effect.译文:然而,许可轨迹算法也有一个重要的副作用。 After a full restart, the reason clauses of implied variables may change, while after a partial restart the reason clauses stay the same.译文:在完全重新启动后,隐含变量的reason子句可能会改变,而在部分重新启动后,reason子句保持不变。 We want to study whether this effect influences the performance positively or negatively.译文:我们想研究这种影响是积极的还是消极的影响绩效。 |
|
7 Conclusion
In this work, we implemented and tested two performance enhancements that reduce restart costs for CDCL solvers.译文:在这项工作中,我们实现并测试了降低CDCL解决程序重启成本的两个性能增强。 We implemented both techniques in the latest MiniSAT solver. We show how to reduce the redundant work that is introduced by a restart by predicting the trail that will occur after a restart.译文:我们将展示如何通过预测重新启动后将出现的轨迹来减少由重新启动引入的冗余工作。 |
|
By applying a partial restart based on this prediction and by restarting more frequently, the performance of CDCL solvers can be improved。译文:通过应用基于此预测的部分重启以及更频繁地重启,可以提高CDCL求解器的性能。 |
|
References
1. Biere, A.: P{re,i}coSAT@SC’09. In: SAT 2009 competitive events booklet: preliminmary
version, pp. 41–44 (2009)
2. E´en, N., S¨orensson, N.: An extensible SAT-solver. In: Theory and Applications of
Satisfiability Testing, 6th International Conference, SAT 2003. pp. 502–518 (2003)
3. Ginsberg, M.L.: Dynamic backtracking. J. Artif. Int. Res. 1, 25–46 (August 1993)
4. Gomes, C.P., Selman, B., Crato, N.: Heavy-tailed distributions in combinatorial
search. In: Principles and Practice of Constraint Programming - CP97, Third International
Conference, Linz, Austria, October 29 - November 1, 1997, Proceedings.
pp. 121–135 (1997)
5. Haim, S., Heule, M.J.H.: Towards ultra rapid restarts (2010),
http://www.st.ewi.tudelft.nl/~marijn/publications/rapid.pdf,
Technical report, UNSW and TU Delft
6. Huang, J.: The Effect of Restarts on the Efficiency of Clause Learning. In: Proceedings
of the International Joint Conference on Artificial Intelligence. pp. 2318–2323
(2007)
7. Luby, M., Sinclair, A., Zuckerman, D.: Optimal speedup of las vegas algorithms.
In: ISTCS. pp. 128–133 (1993)
8. Marques-Silva, J.P., Lynce, I., Malik, S.: Conflict-Driven Clause Learning SAT
Solvers, Frontiers in Artificial Intelligence and Applications, vol. 185, chap. 4, pp.
131–153. IOS Press (February 2009)
9. Marques-Silva, J., Sakallah, K.: Grasp: a search algorithm for propositional satisfiability.
Computers, IEEE Transactions on 48(5), 506 –521 (May 1999)
10. Moskewicz, M.W., Madigan, C.F., Zhao, Y., Zhang, L., Malik, S.: Chaff: engineering
an efficient sat solver. In: Proceedings of the 38th annual Design Automation
Conference. pp. 530–535. DAC ’01, ACM, New York, NY, USA (2001)
11. Nadel, A., Ryvchin, V.: Assignment stack shrinking. In: Strichman, O., Szeider, S.
(eds.) Theory and Applications of Satisfiability Testing SAT 2010, Lecture Notes
in Computer Science, vol. 6175, pp. 375–381. Springer Berlin / Heidelberg (2010)
12. Pipatsrisawat, K., Darwiche, A.: A lightweight component caching scheme for satisfiability
solvers. In: SAT 2007: Theory and Applications of Satisfiability Testing,
10th International Conference,. pp. 294–299 (2007)
13. Pipatsrisawat, K., Darwiche, A.: On the power of clause-learning sat solvers with
restarts. In: Proceedings of the 15th international conference on Principles and
practice of constraint programming. pp. 654–668. CP’09, Springer-Verlag, Berlin,
Heidelberg (2009)
14. Walsh, T.: Search in a small world. In: IJCAI 99: Proceedings of the Sixteenth
International Joint Conference on Artificial Intelligence. pp. 1172–1177 (1999)
15. Zhang, H.: A complete random jump strategy with guiding paths. In: Biere, A.,
Gomes, C. (eds.) Theory and Applications of Satisfiability Testing - SAT 2006,
Lecture Notes in Computer Science, vol. 4121, pp. 96–101. Springer Berlin / Heidelberg
(2006)