Backtracking builds a candidate solution one choice at a time and checks constraints as it goes. When a branch cannot work, it undoes the most recent choice and its consequences and tries another option at that junction.
Say you're scheduling a full day of talks, three sessions in the morning and three in the afternoon. You need hosts, people at check-in, and someone to run the equipment. Each person gets one job for the day, and nobody but Li can run the demo. At the final slot, you see you've put Li on morning check-in.
You look down at a sheet that's almost full. Do you erase the whole thing, or can you go back far enough to change just part of it?
Backtracking Search is a way to try choices one at a time and step back to the last place where you still have an option. Let's walk back through the schedule and see how much of it you can keep. Then we'll look at what makes the way back take so long.
How it works
Stop at the slot you can't fill and look back through the choices you made. Each time you fill a slot, check whether the arrangement can still meet the rules. If it can't, undo the latest choice and what it changed. If that slot has a name you haven't tried, see whether that person can do it instead.
Picture hitting a dead end in a maze. There may still be a path at the junction you just passed, so walk back and take a turn you haven't tried. Mark the turns you've already taken so you don't walk into the same dead end again.
- 01 · Try a choice Choose an untried candidate that is compatible so far.
- 02 · Check for conflict Stop extending a branch once it violates a hard constraint.
- +1 more mechanism steps & animation in the app
When it fails & limits
Stepping back only saves time if you can use your rules to tell which way to go. The search becomes harder when the rules are wrong or you can't check them early.
Unlock the full Backtracking Search lesson in ConceptFlow
You’ve read the core idea and opening case. Get the ConceptFlow app to continue through the full breakdown, failure modes, 5-minute audio lesson, and decision practice.
- ▸5-minute English & Mandarin audio lesson
- ▸5 more deep-dive case & mechanism insights
- ▸All 5 failure boundaries & counter-examples
- ▸3-point decision checklist + 6-step practice
Tap a store button on mobile, or scan with your phone camera on desktop.