Chapter 3 Constraint Programming Paragraph 1 Puzzles, Domains, and Constraints
Who Owns the Fish? 1. The Brit lives in the red house. 2. The Swede keeps dogs as pets. 3. The Dane drinks tea. 4. The green house is on the left of the white house. 5. The green house's owner drinks coffee. 6. The person who smokes Pall Mall rears birds. 7. The owner of the yellow house smokes Dunhill. 8. The man living in the center house drinks milk. 9. The Norwegian lives in the first house. 10. The man who smokes Blends lives next to the one who keeps cats. 11. The man who keeps the horse lives next to the man who smokes Dunhill. 12. The owner who smokes Bluemasters drinks beer. 13. The German smokes Prince. 14. The Norwegian lives next to the blue house. 15. The man who smokes Blends has a neighbor who drinks water. CS 195 - Intro to CO 2
Constrained Programming – An Archeological Puzzle AB CA DE + = + + + + = A E A = + CE CA DA CS 195 - Intro to CO 3
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D = A=C A+1=C + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 4
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 5
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 6
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 7
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 8
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 9
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 10
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 11
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 12
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 13
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 14
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 15
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 16
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 17
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 18
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 19
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 20
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 21
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D = A=C A+1=C + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 22
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 23
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 24
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 25
Constrained Programming – An Archeological Puzzle AB + CA = DE B+A=E B+A=E+10 + + + + = A E A A+C=D A+C+1=D A=C A+1=C = + CE CA DA E+A=A E+A=A+10 A 0,1,2,3,4,5,6,7,8,9 2C=D 2C+1=D B 0,1,2,3,4,5,6,7,8,9 D=D D+1=D AllDiff(A,B,C,D,E) C 0,1,2,3,4,5,6,7,8,9 D 0,1,2,3,4,5,6,7,8,9 E 0,1,2,3,4,5,6,7,8,9 CS 195 - Intro to CO 26
Recommend
More recommend