Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement