Computational Thinking and Programming

Lesson Backtracking algorithms

Backtracking algorithms

  • Backtracking is an algorithmic technique used to solve constrained problems, like puzzles or board games, by incrementally building potential solutions. If a partial solution fails, it backtracks to a previous step, attempting different options. It explores all potential paths in a 'tree of choices' until it finds a solution or exhausts all options. The key applications include abstract games like Go or peg solitaire.
  • Recommended reading:
  • Backtracking: An algorithmic technique that incrementally builds solutions and abandons paths that fail to meet criteria.
  • Tree of Choices: A conceptual tree where each node represents a possible move or decision in a problem.
  • Peg Solitaire: A single-player board game used here to demonstrate backtracking, where pegs jump over each other to empty holes.
  • AlphaGo: An AI by Google DeepMind that uses tree search and backtracking principles to play the board game Go.
  • Leaf Nodes: In backtracking, leaf nodes represent potential end states, which can be winning or losing configurations.
  • Recursive Step: The part of backtracking where the algorithm explores potential moves or decisions from the current state.