1 / 30

CSP

CSP. Yaron Kassner Winter 2013. Reminder. Arc Consistency: the domains of pairs of variables are consistent. k-consistency: the domains of every k variables are consistent. AC3 – an algorithm that reduces the domains of variables by enforcing arc-consistency. Reminder.

dore
Télécharger la présentation

CSP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSP YaronKassner Winter 2013

  2. Reminder • Arc Consistency: the domains of pairs of variables are consistent. • k-consistency: the domains of every k variables are consistent. • AC3 – an algorithm that reduces the domains of variables by enforcing arc-consistency.

  3. Reminder • CSP problems can be solved using search. • Heuristics: • assign the variable with the minimum number of remaining values • Most constraining variable – choose the variable that constrains the most variables. • choose the least-constraining-value: the value that is inconsistent with as few other values as possible. • Forward checking – after assignment, reduce domain of neighboring variables. • MAC – maintain arc-consistency: do a back-tracking search, and fix arc consistency after every assignment.

  4. AC-3 complexity

  5. Example: Cryptarithmetic Problem C3 C2 C1 C2 0 1 TWO + TWO _____ FOUR T 0 1 2 3 4 5 6 7 8 9 O 0 1 2 3 4 5 6 7 8 9 R 0 1 2 3 4 5 6 7 8 9 C1 0 1 W 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 U F 1 2 3 4 5 6 7 8 9 C3 0 1

  6. Example: Cryptarithmetic Problem 1 C2 C1 C2 0 1 TWO + TWO _____ 1OUR T 0 1 2 3 4 5 6 7 8 9 O 0 1 2 3 4 5 6 7 8 9 R 0 1 2 3 4 5 6 7 8 9 C1 0 1 W 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 U F 1 C3 1 Characters are distinct

  7. Example: Cryptarithmetic Problem 1 C2 C1 C2 0 1 TWO + TWO _____ 1OUR T 0 2 3 4 5 6 7 8 9 O 0 2 3 4 5 6 7 8 9 R 0 2 3 4 5 6 7 8 9 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  8. Example: Cryptarithmetic Problem 1 C2 C1 C2 0 1 TWO + TWO _____ 1OUR T 0 2 3 4 5 6 7 8 9 O 2 3 4 5 6 7 8 9 R 0 2 4 6 8 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  9. Example: Cryptarithmetic Problem 1 C2 C1 C2 0 1 TWO + TWO _____ 1OUR T 5 6 7 8 9 O 2 3 4 5 6 7 8 9 R 0 2 4 6 8 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  10. Example: Cryptarithmetic Problem 1 C2 C1 C2 0 1 TWO + TWO _____ 1OUR T 6 7 8 9 O 2 3 4 5 6 7 8 9 R 0 2 4 6 8 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  11. Example: Cryptarithmetic Problem 1 1 C1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 9 O 2 3 4 5 6 7 8 9 R 0 2 4 6 8 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  12. Example: Cryptarithmetic Problem 1 1 C1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 2 4 6 8 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  13. Example: Cryptarithmetic Problem 1 1 C1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 4 6 C1 0 1 W 0 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  14. Example: Cryptarithmetic Problem 1 1 C1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 4 6 C1 0 1 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  15. Example: Cryptarithmetic Problem 1 1 0 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 4 6 C1 0 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  16. Example: Cryptarithmetic Problem 1 1 0 C2 1 TW3 + TW3 _____ 13UR T 6 7 8 O 3 R 0 4 6 C1 0 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  17. Example: Cryptarithmetic Problem 1 1 0 C2 1 TW3 + TW3 _____ 13U6 T 6 7 8 O 3 R 6 C1 0 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  18. Example: Cryptarithmetic Problem 1 1 0 C2 1 6W3 + 6W3 _____ 13U6 T 6 O 3 R 6 C1 0 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1 גלגול אחורה

  19. Example: Cryptarithmetic Problem 1 1 C1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 4 6 C1 0 1 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  20. Example: Cryptarithmetic Problem 1 1 1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 3 5 7 R 0 4 6 C1 1 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  21. Example: Cryptarithmetic Problem 1 1 1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 5 7 R 0 4 6 C1 1 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  22. Example: Cryptarithmetic Problem 1 1 1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 5 7 R 0 4 C1 1 W 5 6 7 8 9 0 2 3 4 5 6 7 8 9 U F 1 C3 1

  23. Example: Cryptarithmetic Problem 1 1 1 C2 1 TWO + TWO _____ 1OUR T 6 7 8 O 5 7 R 0 4 C1 1 W 6 7 8 3 5 7 U F 1 C3 1

  24. Example: Cryptarithmetic Problem 1 1 1 C2 1 TWO + TWO _____ 1OUR T 7 8 O 5 7 R 0 4 C1 1 W 6 7 8 3 5 7 U F 1 C3 1

  25. Example: Cryptarithmetic Problem 1 1 1 C2 1 8WO + 8WO _____ 1OUR T 8 O 5 7 R 0 4 C1 1 W 6 7 8 3 5 7 U F 1 C3 1

  26. Example: Cryptarithmetic Problem 1 1 1 C2 1 8W7 + 8W7 _____ 17UR T 8 O 7 R 0 4 C1 1 W 6 7 8 3 5 7 U F 1 C3 1

  27. Example: Cryptarithmetic Problem 1 1 1 C2 1 8W7 + 8W7 _____ 17U4 T 8 O 7 R 4 C1 1 W 6 7 8 3 5 7 U F 1 C3 1 Distinct character values

  28. Example: Cryptarithmetic Problem 1 1 1 C2 1 867 + 867 _____ 17U4 T 8 O 7 R 4 C1 1 W 6 3 5 U F 1 C3 1

  29. Example: Cryptarithmetic Problem 1 1 1 C2 1 867 + 867 _____ 1734 T 8 O 7 R 4 C1 1 W 6 3 U F 1 C3 1

  30. Example: Zebra puzzle • http://www.youtube.com/watch?v=_dcsqBY04OY • Some kind of MAC.

More Related