Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSP Yaron Kassner Winter 2013. Reminder Arc Consistency: the domains of pairs of variables are consistent. k-consistency: the domains of every k variables.

Similar presentations


Presentation on theme: "CSP Yaron Kassner Winter 2013. Reminder Arc Consistency: the domains of pairs of variables are consistent. k-consistency: the domains of every k variables."— Presentation transcript:

1 CSP Yaron Kassner 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 TWO + TWO _____ FOUR O R C1 W U C2 T F 01 01 0123456789 0123456789 0123456789 0123456789 0123456789 123456789 C301 C3 C2 C1

6 TWO + TWO _____ 1OUR O R C1 W U C2 T F 01 01 0123456789 0123456789 0123456789 0123456789 0123456789 1 C31 Characters are distinct 1 C2 C1 Example: Cryptarithmetic Problem

7 TWO + TWO _____ 1OUR O R C1 W U C2 T F 01 01 023456789 023456789 023456789 023456789 023456789 1 C31 1 C2 C1 Example: Cryptarithmetic Problem

8 TWO + TWO _____ 1OUR O R C1 W U C2 T F 01 01 023456789 23456789 02468 023456789 023456789 1 C31 1 C2 C1 Example: Cryptarithmetic Problem

9 TWO + TWO _____ 1OUR O R C1 W U C2 T F 01 01 56789 23456789 02468 023456789 023456789 1 C31 1 C2 C1 Example: Cryptarithmetic Problem

10 TWO + TWO _____ 1OUR O R C1 W U C2 T F 01 01 6789 23456789 02468 023456789 023456789 1 C31 1 C2 C1 Example: Cryptarithmetic Problem

11 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 01 6789 23456789 02468 023456789 023456789 1 C31 1 1 C1 Example: Cryptarithmetic Problem

12 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 01 678 357 02468 023456789 023456789 1 C31 1 1 C1 Example: Cryptarithmetic Problem

13 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 01 678 357 046 023456789 023456789 1 C31 1 1 C1 Example: Cryptarithmetic Problem

14 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 01 678 357 046 56789 023456789 1 C31 1 1 C1 Example: Cryptarithmetic Problem

15 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 0 678 357 046 56789 023456789 1 C31 1 1 0 Example: Cryptarithmetic Problem

16 TW3 + TW3 _____ 13UR O R C1 W U C2 T F 1 0 678 3 046 56789 023456789 1 C31 1 1 0 Example: Cryptarithmetic Problem

17 TW3 + TW3 _____ 13U6 O R C1 W U C2 T F 1 0 678 3 6 56789 023456789 1 C31 1 1 0 Example: Cryptarithmetic Problem

18 6W3 + 6W3 _____ 13U6 O R C1 W U C2 T F 1 0 6 3 6 56789 023456789 1 C31 1 1 0 גלגול אחורה Example: Cryptarithmetic Problem

19 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 01 678 357 046 56789 023456789 1 C31 1 1 C1 Example: Cryptarithmetic Problem

20 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 1 678 357 046 56789 023456789 1 C31 1 1 1 Example: Cryptarithmetic Problem

21 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 1 678 57 046 56789 023456789 1 C31 1 1 1 Example: Cryptarithmetic Problem

22 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 1 678 57 04 56789 023456789 1 C31 1 1 1 Example: Cryptarithmetic Problem

23 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 1 678 57 04 678 357 1 C31 1 1 1 Example: Cryptarithmetic Problem

24 TWO + TWO _____ 1OUR O R C1 W U C2 T F 1 1 78 57 04 678 357 1 C31 1 1 1 Example: Cryptarithmetic Problem

25 8WO + 8WO _____ 1OUR O R C1 W U C2 T F 1 1 8 57 04 678 357 1 C31 1 1 1 Example: Cryptarithmetic Problem

26 8W7 + 8W7 _____ 17UR O R C1 W U C2 T F 1 1 8 7 04 678 357 1 C31 1 1 1 Example: Cryptarithmetic Problem

27 8W7 + 8W7 _____ 17U4 O R C1 W U C2 T F 1 1 8 7 4 678 357 1 C31 1 1 1 Distinct character values Example: Cryptarithmetic Problem

28 867 + 867 _____ 17U4 O R C1 W U C2 T F 1 1 8 7 4 6 35 1 C31 1 1 1 Example: Cryptarithmetic Problem

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

30 Example: Zebra puzzle http://www.youtube.com/watch?v=_dcsqBY0 4OY http://www.youtube.com/watch?v=_dcsqBY0 4OY Some kind of MAC.


Download ppt "CSP Yaron Kassner Winter 2013. Reminder Arc Consistency: the domains of pairs of variables are consistent. k-consistency: the domains of every k variables."

Similar presentations


Ads by Google