ArticleslgStudy

computer science

Backjumping

Backjumping is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Backjumping rather than just read about it. In short: 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.

Backjumping — main illustration
Backjumping — illustration

Key takeaways

  • Backjumping belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Backjumping to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Backjumping from memory before moving on to harder problems.

Reference excerpt

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.

Illustrations

Backjumping illustration
Backjumping illustration
Backjumping illustration
Backjumping illustration
Backjumping illustration

Worked examples

Example 1 — a first encounter with Backjumping

Start with the simplest possible case. Write down what Backjumping claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Backjumping before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Backjumping ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Backjumping

In research
Backjumping appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Backjumping in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Backjumping is common in secondary-school and first-year university syllabi. It links to neighbouring topics Constraint programming, Search algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Backjumping outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Backjumping” →

How to study Backjumping in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Backjumping means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Backjumping out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Backjumping in simple terms?

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 variab…

Why does Backjumping matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Backjumping?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Backjumping.

Tags

  • Constraint programming
  • Search algorithms

Keep exploring