Foundations of Artificial Intelligence
- 24. Constraint Satisfaction Problems: Backtracking
Malte Helmert and Thomas Keller
University of Basel
Foundations of Artificial Intelligence 24. Constraint Satisfaction - - PowerPoint PPT Presentation
Foundations of Artificial Intelligence 24. Constraint Satisfaction Problems: Backtracking Malte Helmert and Thomas Keller University of Basel April 8, 2020 CSP Algorithms Naive Backtracking Variable and Value Orders Summary Constraint
University of Basel
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
function NaiveBacktracking(C, α): V , dom, (Ruv) := C if α is inconsistent with C: return inconsistent if α is a total assignment: return α select some variable v for which α is not defined for each d ∈ dom(v) in some order: α′ := α ∪ {v → d} α′′ := NaiveBacktracking(C, α′) if α′′ = inconsistent: return α′′ return inconsistent input: constraint network C and partial assignment α for C (first invocation: empty assignment α = ∅) result: solution of C or inconsistent
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
for each non-total assignment α, choose variable v = select(α) that is unassigned in α transition α
assignv,d
− − − − − → α ∪ {v → d} for each d ∈ dom(v)
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g g r y r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g g r y r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g g r b r y r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g g r b r y r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
v1 v7 v4 v5 v6 v3 v2 b b r b r g b b r b g g r b r b g y r
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
function NaiveBacktracking(C, α): V , dom, (Ruv) := C if α is inconsistent with C: return inconsistent if α is a total assignment: return α select some variable v for which α is not defined for each d ∈ dom(v) in some order: α′ := α ∪ {v → d} α′′ := NaiveBacktracking(C, α′) if α′′ = inconsistent: return α′′ return inconsistent
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
intuition: few subtrees smaller tree extreme case: only one value forced assignment
intuition: constraints tested early inconsistencies recognized early smaller tree
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
CSP Algorithms Naive Backtracking Variable and Value Orders Summary
goal: critical decisions as early as possible
goal: most promising assignments first