Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function BACKTRACKING-SEARCH(csp)returns a solution,or failure
- return BACKTRACK({},csp)
- Function BACKTRACK(assignment, csp) returns a solution, or failure
- begin
- if assignment is complete then return assignment
- var = SELECT-UNASSIGNED-VARIABLE(VARIABLES[csp],assignment,csp)
- for each value in ORDER-DOMAIN-VALUES(var, assignment, csp) do
- if value is consistent with assignment then
- add {var = value} to assignment
- Result ←BACKTRACK(assignment,csp)
- If Result ≠ failure then
- return Result
- Remove {var=value} and inferences from assignment
- End if
- End for
- Return failure
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement