Skip to content

    Backtracking

    AI fundamentals & modelsReset procedureTraceability searchbacktracking search
    Reading time: 2 min.Editorially reviewed on:

    Definition

    Algorithmic search technique that reverses a partial decision as soon as it is apparent that it does not lead to a valid solution.

    Backtracking builds a solution step by step. If a choice leads to an impasse, the procedure jumps back to the last decision point and tries an alternative. Conceptually, this often corresponds to a depth-first search in the tree of possible partial solutions.

    Simply explained

    You're trying one way. If it doesn’t work, you go back to the last turn and take the next path.

    Why it matters in practice

    Basic engineering for combinatorial problems such as assignment, configuration, puzzles, constraint satisfaction and certain planning tasks.

    Example from business

    Example scenario: In a deployment planning, an impermissible assignment is discarded and the previous decision is attempted again with another resource.

    Limits and pitfalls

    • Confuse backtracking with dynamic programming; do not use early exclusion conditions; underestimate exponential runtime; and present all search problems as efficiently solvable.

    Origin & history

    Backtracking was described as a general programming technique early on in computer science. A well-known early depiction is by Golomb and Baumert from 1965.

    Use in mid-sized companies

    • Useful for small or well-limited configuration problems; for large search spaces, check additional heuristics, constraints or other optimization methods.

    Frequently asked questions

    Does backtracking always find a solution quickly?

    No.

    Is it the same as brute force?

    It also searches possibilities but can discard unusable partial branches early.

    Can it be implemented recursively?

    Often yes.

    Sources

    • Backtracking · NIST Dictionary of Algorithms and Data Structures, Backtracking

    Source check: 09.10.2026. Definition and documented classification verified; examples describe possible applications.

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice