Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Skill

Backtracking

Enumerate subsets, permutations and constrained configurations systematically, and prune the search early.

Intermediate1 roadmap

4 objectives 6 steps about 120 min

Check what you know

The lessons are coming later. The knowledge check is ready now.

Take the knowledge check

This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.

Learning objectives

  • Write choose-explore-unchoose recursion that generates all subsets, permutations and combinations without duplicates.
  • Solve constraint problems (N-queens, sudoku, word search on a grid) with pruning, and measure how pruning changes the number of explored states.
  • Estimate the size of a search space (such as 2^n or n!) and decide from input limits whether exhaustive search is feasible.
  • Solve an optimization search with branch and bound, pruning any partial solution whose optimistic bound cannot beat the best complete solution found so far, and order choices so good solutions appear early.

Lesson plan

6 steps, about 120 min · 0 of 5 lessons available so far

  1. Decisions as a Tree of States Concept · 15 min · coming later
  2. Generating Subsets, Orderings and Selections Worked example · 25 min · coming later
  3. Lab: N-Queens with a Pruning Counter Lab · 25 min · coming later
  4. How Big Is the Search Space? Concept · 15 min · coming later
  5. Branch and Bound: Pruning with an Optimistic Bound Worked example · 25 min · coming later
  6. Check: Backtracking Problems Knowledge check · 8 questions

Practise it

Implement combination-sum, permutations of a list with repeated values, and a sudoku solver; cross-check the generators against itertools and report explored-node counts with and without pruning. Then solve 0/1 knapsack by branch and bound with a fractional-knapsack bound and report how many nodes the bound prunes.

Build it from scratch

Practice builds that exercise this skill by re-creating a real technology.

Browse 9 tutorials that practise it

References

Hard prerequisites

Unlocks

On these roadmaps

Progress and evidence for this skill are shared across all of them.