a guest Jun 17th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function BACKTRACKING-SEARCH(csp)returns a solution,or failure
  2. return BACKTRACK({},csp)
  3. Function BACKTRACK(assignment, csp) returns a solution, or failure
  4. begin
  5. if assignment is complete then return assignment
  6. var = SELECT-UNASSIGNED-VARIABLE(VARIABLES[csp],assignment,csp)
  7. for each value in ORDER-DOMAIN-VALUES(var, assignment, csp) do
  8. if value is consistent with assignment then
  9. add {var = value} to assignment
  10. Result ←BACKTRACK(assignment,csp)
  11. If Result ≠ failure then
  12. return Result
  13. Remove {var=value} and inferences from assignment
  14. End if
  15. End for
  16. Return failure
  17. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand