Constraint Satisf action CS 486/ 686 May 17, 2005 Universit y of - - PowerPoint PPT Presentation

constraint satisf action
SMART_READER_LITE
LIVE PREVIEW

Constraint Satisf action CS 486/ 686 May 17, 2005 Universit y of - - PowerPoint PPT Presentation

Constraint Satisf action CS 486/ 686 May 17, 2005 Universit y of Wat erloo 1 CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart Outline What are CSPs? St andard search and CSPs I mprovement s Backt r acking


slide-1
SLIDE 1

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

1

Constraint Satisf action

CS 486/ 686 May 17, 2005 Universit y of Wat erloo

slide-2
SLIDE 2

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

2

Outline

  • What are CSPs?
  • St andard search and CSPs
  • I mprovement s

– Backt r acking – Backt r acking + heurist ics – Forward checking

slide-3
SLIDE 3

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

3

I ntroduction

  • I n t he last couple of lect ures we have

been solving problems by searching in a space of st at es

– Treat ing st at es as black boxes, ignoring any st ruct ure inside t hem – Using pr oblem-specif ic rout ines

  • Today we st udy problems where t he

st at e st ruct ure is import ant

slide-4
SLIDE 4

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

4

  • States: all arrangement s
  • f 0,1,…

, or 8 queens on t he board

  • I nitial state: 0 queens on

t he boar d

  • Successor f unction: Add a

queen t o t he board

  • Goal test: 8 queens on t he

board wit h no t wo of t hem at t acking each ot her

64x63x… 57 ≈ 3x1014 st at es

slide-5
SLIDE 5

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

5

  • States: all arrangement s k

queens (0 ≤ k ≤ 8), one per column in t he lef t most k columns, wit h no queen at t acking anot her

  • I nitial state: 0 queens on

t he boar d

  • Successor f unction: Add a

queen t o t he lef t most empt y column such t hat it is not at t acked

  • Goal test: 8 queens on t he

board 2057 St at es

slide-6
SLIDE 6

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

6

I ntroduction

  • Earlier search met hods st udied of t en

make choices in an arbit rary order

  • I n many problems t he same st at e can be

reached independent of t he order in which t he moves are chosen (commut at ive act ions)

  • Can we solve problems ef f icient ly by

being smart in t he order in which we t ake act ions?

slide-7
SLIDE 7

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

7

4- queens Constraint Propagation

Place a queen in a squar e Remove conf lict ing squares f rom consider at ion

slide-8
SLIDE 8

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

8

4- queens Constraint Propagation

Place a queen in a squar e Remove conf lict ing squares f rom consider at ion

slide-9
SLIDE 9

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

9

4- queens Constraint Propagation

Place a queen in a squar e Remove conf lict ing squares f rom consider at ion

slide-10
SLIDE 10

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

10

4- queens Constraint Propagation

Place a queen in a squar e Remove conf lict ing squares f rom consider at ion

slide-11
SLIDE 11

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

11

CSP Def inition

  • A const raint sat isf act ion problem (CSP)

is def ined by {V,D,C} where

– V ={V1,V2,… ,Vn} is a set of variables – D={D1,… ,Dn} is t he set of domains, Di is t he domain of possible values f or variable Vi – C={C

1,…

,C

m} is t he set of const raint s

  • Each const raint involves some subset of t he

variables and specif ies t he allowable combinat ions of values f or t hat subset

slide-12
SLIDE 12

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

12

CSP Def inition

  • A st at e is an assignment of values t o some or

all of t he variables

– {Vi=xi, Vj=xj,… }

  • An assignment is consist ent if it does not

violat e any const r aint s

  • A solut ion is a complet e, consist ent

assignment (“hard const raint s”)

– Some CSPs also require an obj ect ive f unct ion t o be

  • pt imized (“sof t const raint s”)
slide-13
SLIDE 13

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

13

Example 1: 8- Queens

  • 64 variables Vij, i=1 t o 8, j =1 t o 8
  • Domain of each variable is {0,1}
  • Const raint s

– Vij=1 Vik=0 f or all k ≠ j – Vij=1 Vkj=0 f or all k ≠ i – Similar const raint f or diagonals – ∑i,j Vij=8 Binary const raint s relat e t wo variables

slide-14
SLIDE 14

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

14

Example 2 – 8 queens

  • 8 variables Vi, i=1 t o 8
  • Domain of each variable is {1,2,…

,8}

  • Const raint s

– Vi=k Vj≠ k f or all j ≠ i – Similar const raint s f or diagonals Binary const raint s relat e t wo variables

slide-15
SLIDE 15

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

15

Example 3 - Map Coloring

7 var iables {WA,NT,SA,Q,NSW,V,T} Each variable has t he same domain: {red, green, blue} No t wo adj acent variables have t he same value:

WA≠ ≠ ≠ ≠NT, WA≠ ≠ ≠ ≠SA, NT≠ ≠ ≠ ≠SA, NT≠ ≠ ≠ ≠Q, SA≠ ≠ ≠ ≠Q, SA≠ ≠ ≠ ≠NSW, SA≠ ≠ ≠ ≠V,Q≠ ≠ ≠ ≠NSW, NSW≠ ≠ ≠ ≠V WA NT SA Q NSW V T WA NT SA Q NSW V T

T WA NT SA Q NSW V

Const raint graph

slide-16
SLIDE 16

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

16

Example 4 - St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house The Spaniard has a Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

Who owns t he Zebra? Who drinks Wat er? Who owns t he Zebra? Who drinks Wat er?

Example from R and N, Annotations from Stanford CS121

slide-17
SLIDE 17

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

17

St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house The Spaniard has a Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

(Ni = English) ⇔ (C

i = Red)

(Ni = J apanese) ⇔ (J i = Paint er) (N1 = Norwegian) lef t as an exercise (C

i = Whit e) ⇔ (C i+1 = Green)

(C

5 ≠ Whit e)

(C

1 ≠ Green)

Example from R and N, Annotations from Stanford CS121

slide-18
SLIDE 18

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

18

St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house The Spaniard has a Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

(Ni = English) ⇔ (C

i = Red)

(Ni = J apanese) ⇔ (J i = Paint er) (N1 = Norwegian) (C

i = Whit e) ⇔ (C i+1 = Green)

(C

5 ≠ Whit e)

(C

1 ≠ Green)

unary const raint s Example from R and N, Annotations from Stanford CS121

slide-19
SLIDE 19

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

19

St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house The Spaniard has a Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

∀ ∀ ∀ ∀i,j ∈[1,5], i≠j , Ni ≠ Nj ∀ ∀ ∀ ∀i,j ∈[1,5], i≠j , C

i ≠ C j

...

Example from R and N, Annotations from Stanford CS121

slide-20
SLIDE 20

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

20

St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house The Spaniard has a Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t

  • N1 = Norwegian

The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk

  • D3 = Milk

The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

Example from R and N, Annotations from Stanford CS121

slide-21
SLIDE 21

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

21

St reet Puzzle

1 2 3 4 5

Ni = {English, Spaniard, Japanese, I talian, Norwegian} Ci = {Red, Green, White, Yellow, Blue} Di = {Tea, Cof f ee, Milk, Fruit- juice, Water} J i = {Painter, Sculptor, Diplomat, Violinist, Doctor} Ai = {Dog, Snails, Fox, Horse, Zebra} The Englishman lives in the Red house

  • C

1 ≠

≠ ≠ ≠ Red The Spaniard has a Dog

  • A1 ≠

≠ ≠ ≠ Dog The Japanese is a Painter The I talian drinks Tea The Norwegian lives in the f irst house on the lef t

  • N1 = Norwegian

The owner of the Green house drinks Cof f ee The Green house is on the right of the White house The Sculptor breeds Snails The Diplomat lives in the Yellow house The owner of the middle house drinks Milk

  • D3 = Milk

The Norwegian lives next door to the Blue house The Violinist drinks Fruit juice

  • J 3 ≠

≠ ≠ ≠ Violinist The Fox is in the house next to the Doctor’s The Horse is next to the Diplomat’s

Example from R and N, Annotations from Stanford CS121

slide-22
SLIDE 22

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

22

Example 5 - Scheduling

Four t asks T1, T2, T3, and T4 are relat ed by t ime const raint s:

  • T1 must be done during T3
  • T2 must be achieved bef or e T1 st ar t s
  • T2 must overlap wit h T3
  • T4 must st art af t er T1 is complet e

Are t he const raint s compat ible? What ar e t he possible t ime relat ions bet ween t wo t asks? What if t he t asks use resources in limit ed supply?

slide-23
SLIDE 23

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

23

Example 6 - 3- Sat

  • n Boolean variables, V1,…

,Vn

  • K const raint s of t he f orm Vi v Vj v Vk

where Vi is eit her t rue or f alse

  • NP-complet e

– Recall GSAT and WALKSAT

slide-24
SLIDE 24

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

24

Properties of CSPs

  • Types of variables

– Discret e and f init e

  • Map colouring, 8-queens, boolean CSPs

– Discret e variables wit h inf init e domains

  • Scheduling j obs in a calendar
  • Require a const raint language (J ob1+3 ≤ J ob2)

– Cont inuous domains

  • Scheduling on t he Hubble t elescope
  • Linear programming
slide-25
SLIDE 25

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

25

Properties of CSPs

  • Types of cont raint s

– Unary const raint rest rict s a variable t o a single value

  • Queensland=Blue, SA≠Green

– Binary const raint s relat es t wo variables

  • SA≠NSW
  • Can use a const raint graph t o repr esent CSPs wit h only

binary const raint s

– Higher order const raint s involve t hree of more variables

  • Alldif f (V1,…

,Vn)

  • Can use a const raint hypergraph t o represent t he problem
slide-26
SLIDE 26

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

26

CSPs and search

  • N var iables V1,…

,Vn

  • Valid assignment : {V1=x1,…

,Vk=xk} f or 0 ≤ k ≤ n such t hat values sat isf y const raint s on t he variables

  • St at es: valid assignment s
  • I nit ial st at e: empt y assignment
  • Successor:

– {V1=x1,… ,VK=xk} {V1=x1,… ,Vk=xk, Vk+1=xk+1}

  • Goal t est : complet e assignment
  • I f all domains all have size d, t hen t here are

O(dn) complet e assignment s

slide-27
SLIDE 27

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

27

CSPs and commutativity

  • CSPs are commut at ive!

– The order of applicat ion of any given set of act ions has no ef f ect on t he out come – When assigning values t o variables we reach t he same part ial assignment , no mat t er t he order – All CSP search algorit hms generat e successors by considering possible assignment s f or only a single variable at each node in t he search t ree

slide-28
SLIDE 28

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

28

CSPs and commutativity

  • 3 var iables V1, V2, V3
  • Let t he current assignment be

– A={V1=x1}

  • Pick var iable 3
  • Let domain of V3 be {a,b,c}
  • The successors of A are

– {V1=x1,V3=a} – {V1=x1,V3=b} – {V1=x1,V3=c}

slide-29
SLIDE 29

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

29

Backtracking Search

Dept h f irst search which chooses values f or one variable at a t ime Backt racks when a variable has no legal values t o assign

slide-30
SLIDE 30

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

30

Backtracking

T WA NT SA Q NSW V

slide-31
SLIDE 31

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

31

Backtracking

T WA NT SA Q NSW V WA=blue WA=green WA=red

slide-32
SLIDE 32

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

32

Backtracking

T WA NT SA Q NSW V WA=blue WA=green WA=red NT=red NT=green NT=blue

slide-33
SLIDE 33

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

33

Backtracking

T WA NT SA Q NSW V WA=blue WA=green WA=red NT=red NT=green SA=green NT=blue SA=red SA=blue

slide-34
SLIDE 34

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

34

Backtracking and ef f iciency

  • Backt racking search is an uninf ormed

search met hod

– Not very ef f icient

  • We can do bet t er by t hinking about t he

f ollowing quest ions

– Which variable should be assigned next ? – I n which order should it s values be t r ied? – Can we det ect inevit able f ailure early (and avoid t he same f ailure in ot her pat hs)?

slide-35
SLIDE 35

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

35

Most constrained variable

  • Choose t he variable which has t he

f ewest “legal” moves

– AKA minimum remaining values (MRV) heurist ic

DNT={green, blue} DSA={green, blue} Dothers={red, green, blue} DSA={blue} DQ={blue, red} Dothers={red,green,blue}

slide-36
SLIDE 36

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

36

Most constraining variable

  • Most const raining variable:

– choose t he variable wit h t he most const r aint s on remaining var iables

  • Tie-breaker among most const rained

variables

SA is involved in 5 constraints

slide-37
SLIDE 37

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

37

Least- constraining value

  • Given a variable, choose t he least

const raining value:

– t he one t hat rules out t he f ewest values in t he remaining variables

slide-38
SLIDE 38

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

38

Forward checking

  • The t hird quest ions was

– I s t here a way t o det ect f ailure early?

  • Forward checking

– Keep t rack of remaining legal values f or unassigned var iables – Terminat e search when any variable has no legal values

slide-39
SLIDE 39

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

39

Forward Checking in Map Coloring

RGB RGB RGB RGB RGB RGB RGB T SA V NSW Q NT WA

T WA NT SA Q NSW V

slide-40
SLIDE 40

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

40

RGB RGB RGB RGB RGB RGB R RGB RGB RGB RGB RGB RGB RGB T SA V NSW Q NT WA

T WA NT SA Q NSW V

Forward Checking in Map Coloring

Forward checking removes t he value Red of NT and of SA

slide-41
SLIDE 41

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

41

RGB GB RGB RGB G GB R RGB GB RGB RGB RGB GB R RGB RGB RGB RGB RGB RGB RGB T SA V NSW Q NT WA

Forward Checking in Map Coloring

T WA NT SA Q NSW V

slide-42
SLIDE 42

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

42

RGB B B RB G B R RGB B RGB RB G B R RGB GB RGB RGB RGB GB R RGB RGB RGB RGB RGB RGB RGB T SA V NSW Q NT WA

Forward Checking in Map Coloring

T WA NT SA Q NSW V

slide-43
SLIDE 43

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

43

RGB B B RB G B R RGB B RGB RB G B R RGB GB RGB RGB RGB GB R RGB RGB RGB RGB RGB RGB RGB T SA V NSW Q NT WA

Forward Checking in Map Coloring

Empt y set : t he current assignment {(WA R), (Q G), (V B)} does not lead t o a solut ion

slide-44
SLIDE 44

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

44

Example: 4 Queens

X1 {1,2,3,4} X2 {1,2,3,4} X3 {1,2,3,4} X4 {1,2,3,4}

1 2 3 4 1 2 3 4

slide-45
SLIDE 45

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

45

Example: 4 Queens

X1 {1,2,3,4} X2 {1,2,3,4} X3 {1,2,3,4} X4 {1,2,3,4}

1 2 3 4 1 2 3 4

slide-46
SLIDE 46

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

46

Example: 4 Queens

X1 {1,2,3,4} X2 { , ,3,4} X3 { ,2, ,4} X4 { ,2,3, }

1 2 3 4 1 2 3 4

slide-47
SLIDE 47

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

47

Example: 4 Queens

X1 {1,2,3,4} X2 { , ,3,4} X3 { ,2, ,4} X4 { ,2,3, }

1 2 3 4 1 2 3 4

slide-48
SLIDE 48

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

48

Example: 4 Queens

X1 {1,2,3,4} X2 { , ,3,4} X3 { , , , } X4 { ,2, , }

1 2 3 4 1 2 3 4

slide-49
SLIDE 49

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

49

Example: 4 Queens

X1 {1,2,3,4} X2 { 1, 2,3,4} X3 { 1,2,3,4} X4 { 1,2,3,4}

1 2 3 4 1 2 3 4

slide-50
SLIDE 50

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

50

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, ,3, } X4 { ,2,3,4}

1 2 3 4 1 2 3 4

slide-51
SLIDE 51

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

51

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, ,3, } X4 { ,2,3,4}

1 2 3 4 1 2 3 4

slide-52
SLIDE 52

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

52

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, , , } X4 { , ,3,4}

1 2 3 4 1 2 3 4

slide-53
SLIDE 53

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

53

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, , , } X4 { , ,3,4}

1 2 3 4 1 2 3 4

slide-54
SLIDE 54

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

54

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, , , } X4 { , , ,4}

1 2 3 4 1 2 3 4

slide-55
SLIDE 55

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

55

Example: 4 Queens

X1 {1,2,3,4} X2 { , , ,4} X3 { 1, , , } X4 { , , ,4}

1 2 3 4 1 2 3 4

slide-56
SLIDE 56

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

56

Summary

  • What you should know

– How t o f ormalize problems as CSPs – Backt r acking sear ch – Heurist ics

  • Variable ordering
  • Value ordering

– Forward checking

slide-57
SLIDE 57

CS486/686 Lecture Slides (c) 2005 K. Larson and P. Poupart

57

Next class

  • Adversarial search

– Russell and Norvig, Chapt er 6