> For the complete documentation index, see [llms.txt](https://welchj.gitbook.io/cp-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://welchj.gitbook.io/cp-notes/foundementals/backtracking.md).

# Backtracking

Backtracking is one of the techniques of a complete search algorithm.

> A backtracking algorithm begins with an empty solution and extends the solution step by step. The search recursively goes through all different ways how a solution can be constructed. --CPH

Some sorts of optimizations usually come with backtracking to save a lot of time and recursive calls, aka pruning the search tree.
