Backtracking search with pruning
- Stage
- 4
- Module
- M4.10
- Lessons
- 1
In this module
- Explore all possibilities using recursion and backtrack when a path fails.
- Prune search branches early to avoid exploring impossible solutions.
- Recognize problems that fit the backtracking pattern.
- Handle recursion depth limits with iterative approaches.
Before this module
Lessons
Practice
Try this on the judge. The link opens the problem on DMOJ.
- 2019 J5Rule of Three (opens on DMOJ in a new tab) DMOJ
Search for a valid configuration with constraints, backtracking out of dead ends.