• Aucun résultat trouvé

ECLiPSeELearning HelmutSimonis Chapter4:BasicConstraintReasoning(SEND+MORE=MONEY)

N/A
N/A
Protected

Academic year: 2021

Partager "ECLiPSeELearning HelmutSimonis Chapter4:BasicConstraintReasoning(SEND+MORE=MONEY)"

Copied!
349
0
0

Texte intégral

(1)

Chapter 4: Basic Constraint Reasoning (SEND+MORE=MONEY)

Helmut Simonis

Cork Constraint Computation Centre Computer Science Department

University College Cork

Ireland

(2)

Licence

This work is licensed under the Creative Commons

Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit http:

//creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

Helmut Simonis Basic Constraint Reasoning 2

(3)

Outline

1 Problem

2 Program

3 Constraint Setup

4 Search

5 Lessons Learned

(4)

What we want to introduce

Finite Domain Solver in ECLiPSe Models and Programs

Constraint Propagation and Search

Basic constraints: linear arithmetic, alldifferent, disequality Built-in search: Labeling

Visualizers for variables, constraints and search

Helmut Simonis Basic Constraint Reasoning 4

(5)

Outline

1 Problem

2 Program

3 Constraint Setup

4 Search

5 Lessons Learned

(6)

Problem Definition

A Crypt-Arithmetic Puzzle

We begin with the definition of the SEND+MORE=MONEY puzzle. It is often shown in the form of a hand-written addition:

S E N D

+ M O R E

M O N E Y

Helmut Simonis Basic Constraint Reasoning 6

(7)

Rules

S E N D + M O R E

M O N E Y

Each character stands for a digit from 0 to 9.

Numbers are built from digits in the usual, positional notation.

Repeated occurrence of the same character denote the same digit.

Different characters denote different digits.

Numbers do not start with a zero.

The equation must hold.

(8)

Outline

1 Problem

2 Program

3 Constraint Setup

4 Search

5 Lessons Learned

Helmut Simonis Basic Constraint Reasoning 8

(9)

Model

Each character is a variable, which ranges over the values 0 to 9.

An alldifferent constraint between all variables, which states that two different variables must have different values. This is a very common constraint, which we will encounter in many other problems later on.

Two disequality constraints (variable X must be different from value V ) stating that the variables at the beginning of a number can not take the value 0.

An arithmetic equality constraint linking all variables with

(10)

Program Sendmory

:- module(sendmory). é Define Module :- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 10

(11)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1). é Make predicate visible :- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(12)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic). é Use ic library sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 12

(13)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):- é Predicate definition L = [S,E,N,D,M,O,R,Y],

L :: 0..9, alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(14)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], é Define list L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 14

(15)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y],

L :: 0..9, é Define integer domain 0..9 alldifferent(L),

S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(16)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), é Digits must be different S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 16

(17)

Program Sendmory

S E N D

+ M O R E

M O N E Y

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L),

S #\= 0, M #\= 0, é Numbers don’t start with 0 1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(18)

Program Sendmory

S E N D

+ M O R E

M O N E Y

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 18

(19)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(20)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1). é Export and :- lib(ic).

sendmory(L):- é definition must match L = [S,E,N,D,M,O,R,Y],

L :: 0..9, alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 20

(21)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):- é for predicate definition L = [S,E,N,D,M,O,R,Y],

L :: 0..9, alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(22)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L),

S #\= 0, M #\= 0, é Special symbol for ic 1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 22

(23)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], é Confusing name!

L :: 0..9, alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(24)

Program Sendmory

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 24

(25)

General Program Structure

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], é Variables L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(26)

General Program Structure

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), é Constraints S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E #=

10000*M + 1000*O + 100*N + 10*E + Y, labeling(L).

Helmut Simonis Basic Constraint Reasoning 26

(27)

General Program Structure

:- module(sendmory).

:- export(sendmory/1).

:- lib(ic).

sendmory(L):-

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

alldifferent(L), S #\= 0, M #\= 0,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(28)

Choice of Model

This is one model, not the model of the problem Many possible alternatives

Choice often depends on your constraint system Constraints available

Reasoning attached to constraints Not always clear which is the best model Often: Not clear what is the problem

Alternative 1 Alternative 2

Helmut Simonis Basic Constraint Reasoning 28

(29)

Running the program

To run the program, we have to enter the query sendmory:sendmory(L).

Result

L = [9, 5, 6, 7, 1, 0, 8, 2]

yes (0.00s cpu, solution 1, maybe more)

(30)

Question

But how did the program come up with this solution?

Helmut Simonis Basic Constraint Reasoning 30

(31)

Outline

1 Problem

2 Program

3 Constraint Setup

Domain Definition

Alldifferent Constraint

Disequality Constraints

Equality Constraint

(32)

Domain Definition

L = [S,E,N,D,M,O,R,Y], L :: 0..9,

[S, E, N, D, M, O, R, Y ] ∈ {0..9}

Helmut Simonis Basic Constraint Reasoning 32

(33)

Domain Visualization

0 1 2 3 4 5 6 7 8 9

S

E

N

D

M

O

R

Y

(34)

Domain Visualization

Rows = Variables

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 34

(35)

Domain Visualization

Columns = Values

0 1 2 3 4 5 6 7 8 9

S

E

N

D

M

O

R

Y

(36)

Domain Visualization

Cells= State

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 36

(37)

Alldifferent Constraint

alldifferent(L),

Built-in of ic library

No initial propagation possible

Suspends, waits until variables are changed

When variable is fixed, remove value from domain of other variables

Forward checking

(38)

Alldifferent Visualization

Uses the same representation as the domain visualizer

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 38

(39)

Disequality Constraints

S #\= 0, M#\= 0,

Remove value from domain

S ∈ {1..9}, M ∈ {1..9}

Constraints solved, can be removed

(40)

Domains after Disequality

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 40

(41)

Equality Constraint

Normalization of linear terms Single occurence of variable Positive coefficients

Propagation

(42)

Normalization

1000*S+ 100*E+ 10*N+ D +1000*M+ 100*O+ 10*R+ E 10000*M+ 1000*O+ 100*N+ 10*E+ Y

Helmut Simonis Basic Constraint Reasoning 42

(43)

Normalization

1000*S+ 100*E+ 10*N+ D

+1000*M+ 100*O+ 10*R+ E

10000*M+ 1000*O+ 100*N+ 10*E+ Y

(44)

Normalization

1000*S+ 100*E+ 10*N+ D + 100*O+ 10*R+ E 9000*M+ 1000*O+ 100*N+ 10*E+ Y

Helmut Simonis Basic Constraint Reasoning 44

(45)

Normalization

1000*S+ 100*E+ 10*N+ D

+ 100*O+ 10*R+ E

9000*M+ 1000*O+ 100*N+ 10*E+ Y

(46)

Normalization

1000*S+ 100*E+ 10*N+ D + 10*R+ E 9000*M+ 900*O+ 100*N+ 10*E+ Y

Helmut Simonis Basic Constraint Reasoning 46

(47)

Normalization

1000*S+ 100*E+ 10*N+ D

+ 10*R+ E

9000*M+ 900*O+ 100*N+ 10*E+ Y

(48)

Normalization

1000*S+ 100*E+ D

+ 10*R+ E 9000*M+ 900*O+ 90*N+ 10*E+ Y

Helmut Simonis Basic Constraint Reasoning 48

(49)

Normalization

1000*S+ 100*E+ D

+ 10*R+ E

9000*M+ 900*O+ 90*N+ 10*E+ Y

(50)

Normalization

1000*S+ 91*E+ D

+ 10*R

9000*M+ 900*O+ 90*N+ Y

Helmut Simonis Basic Constraint Reasoning 50

(51)

Simplified Equation

1000 ∗ S + 91 ∗ E + 10 ∗ R + D = 9000 ∗ M + 900 ∗ O +90 ∗ N + Y

(52)

Propagation

1000 ∗ S 1..9 + 91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9 = 9000 ∗ M 1..9 + 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9

Helmut Simonis Basic Constraint Reasoning 52

(53)

Propagation

1000 ∗ S 1..9 + 91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9

| {z }

1000..9918

= 9000 ∗ M 1..9 + 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9

| {z }

9000..89919

(54)

Propagation

1000 ∗ S 1..9 + 91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9

| {z }

9000..9918

= 9000 ∗ M 1..9 + 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9

| {z }

9000..9918

Helmut Simonis Basic Constraint Reasoning 54

(55)

Propagation

1000 ∗ S 1..9 + 91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9

| {z }

9000..9918

= 9000 ∗ M 1..9 + 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9

| {z }

9000..9918

Deduction:

M = 1, S = 9, O ∈ {0..1}

(56)

Propagation

1000 ∗ S 1..9 + 91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9

| {z }

9000..9918

= 9000 ∗ M 1..9 + 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9

| {z }

9000..9918

Deduction:

M = 1, S = 9, O ∈ {0..1}

Why?

Skip

Helmut Simonis Basic Constraint Reasoning 56

(57)

Consider lower bound for S

1000 ∗ S

1..9

+ 91 ∗ E

0..9

+ 10 ∗ R

0..9

+ D

0..9

| {z }

9000..9918

= 9000 ∗ M

1..9

+ 900 ∗ O

0..9

+ 90 ∗ N

0..9

+ Y

0..9

| {z }

9000..9918

Lower bound of equation is 9000

Rest of lhs (left hand side) (91 ∗ E 0..9 + 10 ∗ R 0..9 + D 0..9 ) is atmost 918

S must be greater or equal to 9000−918 1000 = 8.082 otherwise lower bound of equation not reached by lhs S is integer, therefore S ≥ d 9000−918 1000 e = 9

S has upper bound of 9, so S = 9

(58)

Consider upper bound of M

1000 ∗ S

1..9

+ 91 ∗ E

0..9

+ 10 ∗ R

0..9

+ D

0..9

| {z }

9000..9918

= 9000 ∗ M

1..9

+ 900 ∗ O

0..9

+ 90 ∗ N

0..9

+ Y

0..9

| {z }

9000..9918

Upper bound of equation is 9918

Rest of rhs (right hand side) 900 ∗ O 0..9 + 90 ∗ N 0..9 + Y 0..9 is at least 0

M must be smaller or equal to 9918−0 9000 = 1.102 M must be integer, therefore M ≤ b 9918−0 9000 c = 1 M has lower bound of 1, so M = 1

Helmut Simonis Basic Constraint Reasoning 58

(59)

Consider upper bound of O

1000 ∗ S

1..9

+ 91 ∗ E

0..9

+ 10 ∗ R

0..9

+ D

0..9

| {z }

9000..9918

= 9000 ∗ M

1..9

+ 900 ∗ O

0..9

+ 90 ∗ N

0..9

+ Y

0..9

| {z }

9000..9918

Upper bound of equation is 9918

Rest of rhs (right hand side) 9000 ∗ 1 + 90 ∗ N 0..9 + Y 0..9 is at least 9000

O must be smaller or equal to 9918−9000 900 = 1.02

O must be integer, therefore O ≤ b 9918−9000 900 c = 1

O has lower bound of 0, so O ∈ {0..1}

(60)

Propagation of equality: Result

0 1 2 3 4 5 6 7 8 9

S - - - - - - - - Y

E N D

M Y - - - - - - - -

O 6 6 6 6 6 6 6 6

R Y

Helmut Simonis Basic Constraint Reasoning 60

(61)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S - - - - - - - - Y

E N D

M Y - - - - - - - -

O 6 6 6 6 6 6 6 6

R

Y

(62)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S Y

E |

N |

D |

M Y

O

R |

Y |

Helmut Simonis Basic Constraint Reasoning 62

(63)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S

E |

N |

D |

M Y

O |

R |

Y |

(64)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E N D M

O Y

R Y

Helmut Simonis Basic Constraint Reasoning 64

(65)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S

E |

N |

D |

M

O Y

R |

Y |

(66)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

O = 0, [E, R, D, N, Y ] ∈ {2..8}

Helmut Simonis Basic Constraint Reasoning 66

(67)

Waking the equality constraint

Triggered by assignment of variables

or update of lower or upper bound

(68)

Removal of constants

1000 ∗ 9 + 91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8 = 9000 ∗ 1 + 900 ∗ 0 + 90 ∗ N 2..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 68

(69)

Removal of constants

10009 + 91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8 =

90001 + 9000 + 90 ∗ N 2..8 + Y 2..8

(70)

Removal of constants

91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 2..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 70

(71)

Propagation of equality (Iteration 1)

91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8

| {z }

204..816

= 90 ∗ N 2..8 + Y 2..8

| {z }

182..728

(72)

Propagation of equality (Iteration 1)

91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 2..8 + Y 2..8

| {z }

204..728

Helmut Simonis Basic Constraint Reasoning 72

(73)

Propagation of equality (Iteration 1)

91 ∗ E 2..8 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 2..8 + Y 2..8

| {z }

204..728

N ≥ 3 = d 204 − 8

90 e, E ≤ 7 = b 728 − 22

91 c

(74)

Propagation of equality (Iteration 2)

91 ∗ E 2..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 74

(75)

Propagation of equality (Iteration 2)

91 ∗ E 2..7 + 10 ∗ R 2..8 + D 2..8

| {z }

204..725

= 90 ∗ N 3..8 + Y 2..8

| {z }

272..728

(76)

Propagation of equality (Iteration 2)

91 ∗ E 2..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

| {z }

272..725

Helmut Simonis Basic Constraint Reasoning 76

(77)

Propagation of equality (Iteration 2)

91 ∗ E 2..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

| {z }

272..725

E ≥ 3 = d 272 − 88

91 e

(78)

Propagation of equality (Iteration 3)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 78

(79)

Propagation of equality (Iteration 3)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8

| {z }

295..725

= 90 ∗ N 3..8 + Y 2..8

| {z }

272..728

(80)

Propagation of equality (Iteration 3)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

| {z }

295..725

Helmut Simonis Basic Constraint Reasoning 80

(81)

Propagation of equality (Iteration 3)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 3..8 + Y 2..8

| {z }

295..725

N ≥ 4 = d 295 − 8

90 e

(82)

Propagation of equality (Iteration 4)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 82

(83)

Propagation of equality (Iteration 4)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8

| {z }

295..725

= 90 ∗ N 4..8 + Y 2..8

| {z }

362..728

(84)

Propagation of equality (Iteration 4)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

| {z }

362..725

Helmut Simonis Basic Constraint Reasoning 84

(85)

Propagation of equality (Iteration 4)

91 ∗ E 3..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

| {z }

362..725

E ≥ 4 = d 362 − 88

91 e

(86)

Propagation of equality (Iteration 5)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 86

(87)

Propagation of equality (Iteration 5)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8

| {z }

386..725

= 90 ∗ N 4..8 + Y 2..8

| {z }

362..728

(88)

Propagation of equality (Iteration 5)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

| {z }

386..725

Helmut Simonis Basic Constraint Reasoning 88

(89)

Propagation of equality (Iteration 5)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 4..8 + Y 2..8

| {z }

386..725

N ≥ 5 = d 386 − 8

90 e

(90)

Propagation of equality (Iteration 6)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 90

(91)

Propagation of equality (Iteration 6)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8

| {z }

386..725

= 90 ∗ N 5..8 + Y 2..8

| {z }

452..728

(92)

Propagation of equality (Iteration 6)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

| {z }

452..725

Helmut Simonis Basic Constraint Reasoning 92

(93)

Propagation of equality (Iteration 6)

91 ∗ E 4..7 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

| {z }

452..725

N ≥ 5 = d 452 − 8

90 e, E ≥ 4 = d 452 − 88

91 e

No further propagation at this point

(94)

Domains after setup

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 94

(95)

Outline

1 Problem

2 Program

3 Constraint Setup

4 Search Step 1 Step 2

Further Steps

(96)

labeling built-in

labeling([S,E,N,D,M,O,R,Y]) Try variable is order given

Try values starting from smallest value in domain When failing, backtrack to last open choice Chronological Backtracking

Depth First search

Helmut Simonis Basic Constraint Reasoning 96

(97)

Search Tree Step 1

S E

9

(98)

Step 2, Alternative E = 4

Variable E ∈ {4..7}, first value tested is 4

S E

4 9

Helmut Simonis Basic Constraint Reasoning 98

(99)

Assignment E = 4

0 1 2 3 4 5 6 7 8 9

S

E Y - - -

N

D

M

O

R

Y

(100)

Propagation of E = 4, equality constraint

91 ∗ 4 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 100

(101)

Propagation of E = 4, equality constraint

91 ∗ 4 + 10 ∗ R 2..8 + D 2..8

| {z }

386..452

= 90 ∗ N 5..8 + Y 2..8

| {z }

452..728

(102)

Propagation of E = 4, equality constraint

91 ∗ 4 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

| {z }

452

Helmut Simonis Basic Constraint Reasoning 102

(103)

Propagation of E = 4, equality constraint

91 ∗ 4 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 5..8 + Y 2..8

| {z }

452

N = 5, Y = 2, R = 8, D = 8

(104)

Result of equality propagation

0 1 2 3 4 5 6 7 8 9

S E

N Y - - -

D - - - - - - Y

M O

R - - - - - - Y

Y Y - - - - - -

Helmut Simonis Basic Constraint Reasoning 104

(105)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E

N Y - - -

D - - - - - - Y

M O

R - - - - - - Y

Y Y - - - - - -

(106)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S |

E |

N Y - - |

D - - - - - - Y

M |

O |

R - - - - - - Y

Y Y - - - - - |

Alldifferent fails!

Helmut Simonis Basic Constraint Reasoning 106

(107)

Step 2, Alternative E = 5

Return to last open choice, E, and test next value

S E

4

N

5

9

(108)

Assignment E = 5

0 1 2 3 4 5 6 7 8 9

S

E - Y - -

N D M O R Y

Helmut Simonis Basic Constraint Reasoning 108

(109)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S

E - Y - -

N

D

M

O

R

Y

(110)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S

E Y

N |

D |

M O

R |

Y |

Helmut Simonis Basic Constraint Reasoning 110

(111)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S

E

N

D

M

O

R

Y

(112)

Propagation of equality

91 ∗ 5 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 6..8 + Y 2..8

Helmut Simonis Basic Constraint Reasoning 112

(113)

Propagation of equality

91 ∗ 5 + 10 ∗ R 2..8 + D 2..8

| {z }

477..543

= 90 ∗ N 6..8 + Y 2..8

| {z }

542..728

(114)

Propagation of equality

91 ∗ 5 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 6..8 + Y 2..8

| {z }

542..543

Helmut Simonis Basic Constraint Reasoning 114

(115)

Propagation of equality

91 ∗ 5 + 10 ∗ R 2..8 + D 2..8 = 90 ∗ N 6..8 + Y 2..8

| {z }

542..543

N = 6, Y ∈ {2, 3}, R = 8, D ∈ {7..8}

(116)

Result of equality propagation

0 1 2 3 4 5 6 7 8 9

S E

N Y - -

D 6 6 6 6

M O

R - - - - - Y

Y 6 6 6 6

Helmut Simonis Basic Constraint Reasoning 116

(117)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E

N Y - -

D 6 6 6 6

M O

R - - - - - Y

Y 6 6 6 6

(118)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E N

D |

M O

R Y

Y

Helmut Simonis Basic Constraint Reasoning 118

(119)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E N

D Y

M

O

R

Y

(120)

Propagation of alldifferent

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

D = 7

Helmut Simonis Basic Constraint Reasoning 120

(121)

Propagation of equality

91 ∗ 5 + 10 ∗ 8 + 7 = 90 ∗ 6 + Y 2..3

(122)

Propagation of equality

91 ∗ 5 + 10 ∗ 8 + 7

| {z }

542

= 90 ∗ 6 + Y 2..3

| {z }

542..543

Helmut Simonis Basic Constraint Reasoning 122

(123)

Propagation of equality

91 ∗ 5 + 10 ∗ 8 + 7 = 90 ∗ 6 + Y 2..3

| {z }

542

(124)

Propagation of equality

91 ∗ 5 + 10 ∗ 8 + 7 = 90 ∗ 6 + Y 2..3

| {z }

542

Y = 2

Helmut Simonis Basic Constraint Reasoning 124

(125)

Last propagation step

0 1 2 3 4 5 6 7 8 9

S E N D M O R

Y Y -

(126)

Further Steps: Nothing more to do

S E

4

N

5 9

Helmut Simonis Basic Constraint Reasoning 126

(127)

Further Steps: Nothing more to do

S E

4

N D

6

5

9

(128)

Further Steps: Nothing more to do

S E

4

N D M

7 6 5 9

Helmut Simonis Basic Constraint Reasoning 128

(129)

Further Steps: Nothing more to do

S E

4

N D M

1 7 6 5 9

(130)

Further Steps: Nothing more to do

S E

4

N D M O R

0 1 7 6 5 9

Helmut Simonis Basic Constraint Reasoning 130

(131)

Further Steps: Nothing more to do

S E

4

N D M O R

8 0 1 7 6 5 9

(132)

Further Steps: Nothing more to do

S E

4

N D M O R Y

2 8 0 1 7 6 5 9

Helmut Simonis Basic Constraint Reasoning 132

(133)

Complete Search Tree

S E

4

N D M O R Y

8 0 1 7 6

5 6 7 9

(134)

Solution

9 5 6 7

+ 1 0 8 5

1 0 6 5 2

Helmut Simonis Basic Constraint Reasoning 134

(135)

Outline

1 Problem

2 Program

3 Constraint Setup

4 Search

5 Lessons Learned

(136)

Topics introduced

Finite Domain Solver in ECLiPSe, ic library Models and Programs

Constraint Propagation and Search

Basic constraints: linear arithmetic, alldifferent, disequality

Built-in search: labeling

Visualizers for variables, constraints and search

Helmut Simonis Basic Constraint Reasoning 136

(137)

Lessons Learned

Constraint models are expressed by variables and constraints.

Problems can have many different models, which can behave quite differently. Choosing the best model is an art.

Constraints can take many different forms.

Propagation deals with the interaction of variables and constraints.

It removes some values that are inconsistent with a

constraint from the domain of a variable.

(138)

Lessons Learned

Propagation usually is not sufficient, search may be required to find a solution.

Propagation is data driven, and can be quite complex even for small examples.

The default search uses chronological depth-first

backtracking, systematically exploring the complete search space.

The search choices and propagation are interleaved, after every choice some more propagation may further reduce the problem.

Helmut Simonis Basic Constraint Reasoning 138

(139)

Outline

6 Alternative Models

Model without Disequality Multiple Equations

7 Exercises

(140)

Alternative 1

Do we need the constraint “Numbers do not begin with a zero”?

This is not given explicitely in the problem statement Remove disequality constraints from program Previous solution is still a solution

Does it change propagation?

Does it have more solutions?

Helmut Simonis Basic Constraint Reasoning 140

(141)

Program without Disequality

Listing 1: Alternative 1 :−module ( a l t e r n a t i v e 1 ) .

:− e x p o r t ( sendmory / 1 ) . :− l i b ( i c ) .

sendmory ( L ): −

L = [ S , E , N, D,M, O, R, Y ] , L : : 0 . . 9 ,

a l l d i f f e r e n t ( L ) ,

1000*S + 100*E + 10*N + D +

1000*M + 100*O + 10*R + E #=

(142)

After Setup without Disequality

0 1 2 3 4 5 6 7 8 9

S E N D M O R Y

Helmut Simonis Basic Constraint Reasoning 142

(143)

Setup Comparison

original alternative 1

0 1 2 3 4 5 6 7 8 9 S

E N D M O R Y

0 1 2 3 4 5 6 7 8 9 S

E N D M O R Y

(144)

Search Tree: Many Solutions

S

Skip Animation

Helmut Simonis Basic Constraint Reasoning 144

(145)

Search Tree: Many Solutions

S

0

(146)

Search Tree: Many Solutions

S

0 1

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 146

(147)

Search Tree: Many Solutions

S

0 1

E

2

(148)

Search Tree: Many Solutions

S

0 1

E N

8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 148

(149)

Search Tree: Many Solutions

S

0 1

E N D

1

8

2

(150)

Search Tree: Many Solutions

S

0 1

E N D M

7 1 8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 150

(151)

Search Tree: Many Solutions

S

0 1

E N D M O

0 7 1 8 2

(152)

Search Tree: Many Solutions

S

0 1

E N D M O R

3 0 7 1 8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 152

(153)

Search Tree: Many Solutions

S

0 1

E N D M O R

6 3 0 7 1 8 2

(154)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7 1 8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 154

(155)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M

9 1 8 2

(156)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O

0 9 1 8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 156

(157)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R

3 0 9 1 8 2

(158)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

6 3 0 9 1 8 2

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 158

(159)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

(160)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E

3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 160

(161)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N

7 3

(162)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D

1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 162

(163)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

2 1 7 3

(164)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O

0 2 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 164

(165)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R

4 0 2 1 7 3

(166)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R Y

6 4 0 2 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 166

(167)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R Y

9 6 4 0 2 1 7 3

(168)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R Y

9 6 4 0

2 5 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 168

(169)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R Y

9 6 4 0

2 5 6 1 7 3

(170)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M O R Y

9 6 4 0

2 5 6 8 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 170

(171)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M

9 1 7 3

(172)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O

0 9 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 172

(173)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O R

4 0 9 1 7 3

(174)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O R Y

5 4 0 9 1 7 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 174

(175)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O R Y

6 5 4 0 9 1 7 3

(176)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O R Y

6 5 4 0 9 1

7

N

8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 176

(177)

Search Tree: Many Solutions

S

0 1

E N D M O R Y

5 6 3 0 7

M O R Y

7 6 3 0 9 1 8 2

E N D M

O R Y

9 6 4 0

2 5 6 8

M O R Y

6 5 4 0 9 1

7

N D

2 8 3

(178)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M 1 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 178

(179)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O 0 1 2 8 3

(180)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R 4 0 1 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 180

(181)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 6 4 0 1 2 8 3

(182)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0 1 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 182

(183)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 2 8 3

(184)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 184

(185)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 2 8 3

(186)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M 9 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 186

(187)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O 0 9 2 8 3

(188)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O R 4 0 9 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 188

(189)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O R Y 5 4 0 9 2 8 3

(190)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O R Y 7 5 4 0 9 2 8 3

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 190

(191)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O R Y 7 5 4 0 9 2 8 3

E 4

(192)

Search Tree: Many Solutions

S 0 1 E N D M O R Y 5 6 3 0 7

M O R Y 7 6 3 0 9 1 8

2

E N D M O R Y 9 6 4 0

2 5 6 8 M O R Y 6 5 4 0 9 1

7

N D M O R Y 9 6 4 0

1 5 6 7 M O R Y 7 5 4 0 9 2 8 3

E 6 4

Back to Start Skip Animation

Helmut Simonis Basic Constraint Reasoning 192

Références

Documents relatifs

In this paper, we show how the popular generic variable ordering heuristic dom/wdeg can be made more robust by taking finer information at each conflict: the “current” arity of

However, we prove a surprising result that finding a simultaneous matching on a convex bipartite graph takes just polynomial time.. Based on this theoretical result, we pro- vide

Ce travail a pour objet d’étudier les causes et les difficultés de la concrétisation des crédits d’équipements destinés au laboratoires de recherche de l’Université

Introduction (You are here) Video iPhone Slides Handout First Steps - Hello World Video iPhone Slides Handout Application Overview Video iPhone Slides Handout Basic Constraint

In the sequel the word constraint will be used in two meanings: a type of constraints, such as propositional clause, Boolean cardinality constraint, ALLDIFF..., and a

Dans cet article, nous proposons deux nouvelles s´e- mantiques de violation pour la contrainte globale All- Different permettant de prendre en compte les pr´ef´e- rences formul´ees

Mots-clefs— Constraint Programming, Game theory, Nash Equilibrium, Search

This has motivated the introduction of com- pact representations like Graphical Games [Kearns et al., 2001], Boolean Games [Harrenstein et al., 2001], Action- Graph Games [Jiang et