In constraint programming and SAT solving, backjumping (also known as non-chronological backtracking or intelligent backtracking) is an enhancement for backtracking algorithms which reduces the search space. While backtracking always goes up one level in the search tree when all values for a variable have been tested, backjumping may go up more levels. In this article, a fixed order of evaluation of variables x1,…,xn is used, but the same considerations apply to a dynamic order of evaluation.
Definition Whenever backtracking has tried all values for a variable without finding any solution, it reconsiders the last of the previously assigned variables, changing its value or further backtracking if no other values are to be tried. If x1=a1,…,xk=ak is the current partial assignment and all values for xk+1 have been tried without finding a solution, backtracking concludes that no solution extending x1=a1,…,xk=ak exists. The algorithm then "goes up" to xk, changing xk's value if possible, backtracking again otherwise. The partial assignment is not always necessary in full to prove that no value of xk+1 leads to a solution. In particular, a prefix of the partial assignment may have the same property, that is, there exists an index j<k such that x1,…,xj=a1,…,aj cannot be extended to form a solution with whatever value for xk+1. If the algorithm can prove this fact, it can directly consider a different value for xj instead of reconsidering xk as it would normally do.
The efficiency of a backjumping algorithm depends on how high it is able to backjump. Ideally, the algorithm could jump from xk+1 to whichever variable xj is such that the current assignment to x1,…,xj cannot be extended to form a solution with any value of xk+1. If this is the case, j is called a safe jump. Establishing whether a jump is safe is not always feasible, as safe jumps are defined in terms of the set of solutions, which is what the algorithm is trying to find. In practice, backjumping algorithms use the lowest index they can efficiently prove to be a safe jump. Different algorithms use different methods for determining whether a jump is safe. These methods have different costs, but a higher cost of finding a higher safe jump may be traded off a reduced amount of search due to skipping parts of the search tree.
Backjumping at leaf nodes The simplest condition in which backjumping is possible is when all values of a variable have been proved inconsistent without further branching. In constraint satisfaction, a partial evaluation is consistent if and only if it satisfies all constraints involving the assigned variables, and inconsistent otherwise. It might be the case that a consistent partial solution cannot be extended to a consistent complete solution because some of the unassigned variables may not be assigned without violating other constraints. The condition in which all values of a given variable xk+1 are inconsistent with the current partial solution x1,…,xk=a1,…,ak is called a leaf dead end. This happens exactly when the variable xk+1 is a leaf of the search tree (which correspond to nodes having only leaves as children in the figures of this article.) The backjumping algorithm by John Gaschnig does a backjump only in leaf dead ends. In other words, it works differently from backtracking only when every possible value of xk+1 has been tested and resulted inconsistent without the need of branching over another variable. A safe jump can be found by simply evaluating, for every value ak+1, the shortest prefix of x1,…,xk=a1,…,ak inconsistent with xk+1=ak+1. In other words, if ak+1 is a possible value for xk+1, the algorithm checks the consistency of the following evaluations:
The smallest index (lowest the listing) for which evaluations are inconsistent would be a safe jump if xk+1=ak+1 were the only possible value for xk+1. Since every variable can usually take more than one value, the maximal index that comes out from the check for each value is a safe jump, and is the point where John Gaschnig's algorithm jumps. In practice, the algorithm can check the evaluations above at the same time it is checking the consistency of xk+1=ak+1.
Backjumping at internal nodes The previous algorithm only backjumps when the values of a variable can be shown inconsistent with the current partial solution without further branching. In other words, it allows for a backjump only at leaf nodes in the search tree. An internal node of the search tree represents an assignment of a variable that is consistent with the previous ones. If no solution extends this assignment, the previous algorithm always backtracks: no backjump is done in this case. Backjumping at internal nodes cannot be done as for leaf nodes. Indeed, if some evaluations of xk+1 required branching, it is because they are consistent with the current assignment. As a result, searching for a prefix that is inconsistent with these values of the last variable does not succeed. In such cases, what proved an evaluation xk+1=ak+1 not to be part of a solution with the current partial evaluation x1,…,xk is the recursive search. In particular, the algorithm "knows" that no solution exists from this point on because it comes back to this node instead of stopping after having found a solution. This return is due to a number of dead ends, points where the algorithm has proved a partial solution inconsistent. In order to further backjump, the algorithm has to take into account that the impossibility of finding solutions is due to these dead ends. In particular, the safe jumps are indexes of prefixes that still make these dead ends to be inconsistent partial solutions.
In other words, when all values of xk+1 have been tried, the algorithm can backjump to a previous variable xi provided that the current truth evaluation of x1,…,xi is inconsistent with all the truth evaluations of xk+1,xk+2,... in the leaf nodes that are descendants of the node xk+1.
Simplifications
… excerpt ends here. Continue reading the full article.





