constraint reasoning part 1 - univ-artois.fr reasoning part 1 christophe lecoutre ... the problem...

178
Constraint Reasoning Part 1 Christophe Lecoutre [email protected] CRIL-CNRS UMR 8188 Universite d’Artois Lens, France ECAI Tutorial – Montpellier – August 28th, 2012 1

Upload: phamminh

Post on 13-Jul-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Constraint ReasoningPart 1

Christophe [email protected]

CRIL-CNRS UMR 8188Universite d’Artois

Lens, France

ECAI Tutorial – Montpellier – August 28th, 2012

1

Page 2: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

2

Page 3: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

3

Page 4: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Ubiquity of Constraints

A number of human activities requires dealing with the concept of constraints. Aconstraint limits the field of possibilities in a certain universe/context.

Example

When a school timetable must be set at the beginning of the school year, theperson in charge of this task has to take into account many kinds of constraints.

4

Page 5: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Timetabling Problem

10:00−12:00

14:00−16:00

16:00−18:00

Monday Tuesday Wednesday Thirsday Friday

Philosophy

Lessons Rooms Teachers

R1 Mr SmithBiology R2 Mrs Doe

08:00−10:00

. . .. . .. . .

5

Page 6: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Constraint Programming

Constraint programming (CP) is a general framework whose objective is topropose simple, general and efficient algorithmic solutions to constraint problems.

They are then two main issues that need to be addressed when this framework isused to deal with a combinatorial problem:

1 In a first modelling stage, the problem must be represented by introducingvariables, constraints, and potentially objective functions.

2 In a second solving stage, the problem modelled by the user must be tackledby a software tool in order to automatically obtain one solution, all solutionsor an optimal solution.

6

Page 7: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Constraint Satisfaction

The constraint satisfaction problem (CSP) resides at the core of constraintprogramming. An instance of this problem is represented by a constraintnetwork (CN).

CSP SAT

Note that SAT is closely related to CSP:

variables are Boolean

constraints are clauses (disjunctions of variables and their negations)

RemarkSAT and CSP are NP-complete problems

Warning

We shall only deal with discrete variables

7

Page 8: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Variables and Constraints

Definition (Variable)

A variable (with name) x is an unknown entity that must be given a value from aset called the current domain of x and denoted by dom(x).

Definition (Constraint)

A constraint (with name) c is defined over a (totally ordered) set of variables,called scope of c and denoted by scp(c), by a mathematical relation thatdescribes the set of tuples allowed by c for the variables of its scope.

Remark

The arity of a constraint c is the number of variables involved in c , i.e. |scp(c)|.

8

Page 9: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Representation of Constraints

Formally, a constraint is defined a mathematical relation. In practice there arethree different ways of representing a constraint:

in intension, by using a Boolean formula (predicate),

implicitly by referring to a so-called global constraint,

in extension, by listing tuples.

9

Page 10: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Intensional Constraints

Definition (Intensional Constraint)

A constraint c is intensional (or defined in intension) iff it is described by aBoolean formula (predicate) that represents a function that is defined fromΠx∈scp(c)dom(x) to {false, true}.

Example

A binary constraint:

cvw : v ≤ w + 2

A ternary constraint:

cxyz : x 6= y ∧ x 6= z ∧ y 6= z

10

Page 11: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Global Constraints

Definition (Global Constraint)

A global constraint is a constraint pattern that captures a precise relationalsemantics and that can be applied over an arbitrary number of variables.

For example, the semantics of AllDifferent is that all variables must take adifferent value.

Example

Our previous ternary constraint can be defined by:

cxyz : AllDifferent(x , y , z)

11

Page 12: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Extensional Constraints

Definition (Extensional Constraint)

A constraint c is extensional (or defined in extension) iff it is explicitly described,either positively by listing the tuples allowed by c or negatively by listing thetuples disallowed by c .

Example

If dom(x)× dom(y)× dom(z) = {0, 1, 2}3 , then our ternary constraint can bedefined positively by:

cxyz :

{ (0, 1, 2),

(0, 2, 1),

(1, 0, 2),

(1, 2, 0)

(2, 1, 0),

(2, 0, 1)

}

12

Page 13: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Constraint Networks

Definition

A Constraint Network (CN) P is composed of:

a finite set of variables, denoted by vars(P),

a finite set of constraints, denoted by cons(P).

Warning

We will call a pair (x , a) with x ∈ vars(P) and a ∈ dom(x) a value of P.

13

Page 14: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Sudoku as a CN

2

6

5

6

5

1 7

9

3

7

3

2

4 1 8

7

4

35 9

1

1

74

6

8

8

6

2

6

14

Page 15: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Sudoku as a CN

We can simply define a CN P such that:

vars(P) =

{x1,1, x1,2, . . . , x1,9,x2,1, x2,2, . . . , x2,9,. . .} with dom(xi,j) = {0, 1, . . . , 9},∀i , j ∈ 1..9

cons(P) =

{AllDifferent(x1,1, x1,2, . . . , x1,9),AllDifferent(x2,1, x2,2, . . . , x2,9),. . .}

RemarkFor each hint, add unary constraints

15

Page 16: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A Solution to the Sudoku Instance

7

5

13

2

6

7 2

4 1

7

8

4

5 3 9

1 5

8

67

6

4

8

6 3

9

2

1 6

2 8 5 7 6 9 3 1

27

8 4

84

9 376

1 5

1823

59

3 8

4 9

2

7

4

31

7 2

459 1 2

9

6 4

5

8 6

9 5

3

16

Page 17: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

17

Page 18: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

RLFAP (CELAR, project CALMA, Cabon et al. 1999)

Problem: assigning frequencies to radio-links while avoiding interferences

Model:

a set of variables to represent unidirectional radio linksa set of binary constraints of the form

I |xi − xj | = dijI |xi − xj | > dij

several criteria to optimize (minimum span, minimum cardinality, etc.)

18

Page 19: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

Structure of CSP instances: scen11, scen11-f12, scen11-f6, scen11-f1680 variables, 4,103 binary constraints

19

Page 20: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Solving Problem Instances with Backtrack Search

Complete search

Depth-first exploration

Backtracking mechanism

Interleaving ofI decisions (e.g. variable assignments)I constraint propagation

root

solution

decisions

leaves

dead−ends

⊥ ⊥

δ1

δ2

δ3 δ4

δ5

δ7 δ9

δ13

δ14

δ18

δ16node v, parent of v′

node v′, child of v

δ11δ6

δk

⊥ ⊥

δ19

δ15

δ8 δ17

δ12

δ10

20

Page 21: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Backtrack Search (using Binary Branching)

Algorithm 1: backtrackSearch(P: CN): Boolean

P ← φ(P)if ∃x ∈ vars(P), dom(x) = ∅ then

return falseif ∀x ∈ vars(P), |dom(x)| = 1 then

return true

select a value (x , a) of P such that |dom(x)| > 1return backtrackSearch(P|x=a) ∨ backtrackSearch(P|x 6=a)

Remarkφ denotes the process of constraint propagation

21

Page 22: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (1) – MAC

Instances nodes CPU

scen11 > 10,000

scen11-f12 > 10,000

scen11-f8 > 10,000

scen11-f8 > 10,000

scen11-f4 > 10,000

scen11-f2 > 10,000

scen11-f1 > 10,000

22

Page 23: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Using Heuristics to Guide Search

General principles:

It is better to start assigning those variables that belong to the most difficultpart(s) of the problem instance: “to succeed, try first where you are mostlikely to fail” (fail-first principle).

To find a solution quickly, it is better to select a value that belongs to themost promising subtree.

The initial variable/value choices are particularly important.

Some classical variable ordering heuristics :

dom

dom/deg

dom+deg

23

Page 24: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (2) – MAC-dom/deg

Instances nodes CPU (2) CPU (1)

scen11 31,816 5.42 > 10,000

scen11-f12 > 10,000 > 10,000

scen11-f8 > 10,000 > 10,000

scen11-f6 > 10,000 > 10,000

scen11-f4 > 10,000 > 10,000

scen11-f2 > 10,000 > 10,000

scen11-f1 > 10,000 > 10,000

24

Page 25: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Adaptive Variable Ordering Heuristics

The heuristic dom/wdeg is a generic state-of-the-art variable ordering heuristic.

The principle is the following:

a weight is associated with each constraint,

everytime a conflict occurs while filtering through a constraint c, the weightassociated with c is incremented,

the weight of a variable is the sum of the weights of all its involvingconstraints.

The interest is that this heuristic is adaptive, with the expectation to focus onthe hard part(s) of the instance.

25

Page 26: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (3) – MAC-dom/wdeg

Instances nodes CPU (3) CPU (2)

scen11 912 1.47 5.42

scen11-f12 699 1.49 > 10,000

scen11-f8 14,077 2.8 > 10,000

scen11-f6 252,557 25.2 > 10,000

scen11-f4 3,477,514 292 > 10,000

scen11-f2 38,263,495 3,158 > 10,000

scen11-f1 96,066,349 7,805 > 10,000

26

Page 27: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of Constraint Weighting with scen11-f6

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

27

Page 28: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of Constraint Weighting with scen11-f6

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

27

Page 29: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of Constraint Weighting with scen11-f6

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

27

Page 30: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of Constraint Weighting with scen11-f6

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

V0

V664V665

V666V667

V1

V2V3

V4

V5

V303

V6

V370V371

V412V413

V7

V8

V9

V10

V11

V12V13

V14

V15

V16

V614V615

V17

V286

V18

V636V637

V19V20

V648V649

V660

V661

V21

V22V23

V24

V612V613V646

V647

V25

V26V27

V28 V29

V30V31

V569

V32

V33

V34

V426V427

V532V533V35

V36V37

V38

V306V307

V308

V309

V474

V475

V634V635

V39

V40

V41

V42

V52V53

V628

V43

V44V45

V46

V305

V47

V304

V48

V49

V50V51

V54V80

V81

V110

V111

V264

V265

V268

V291

V376 V377

V432V433

V604

V605

V55

V82V83

V290

V56V57

V554

V555

V58

V428V429

V431

V59

V60V61

V62

V567

V63

V64

V65

V66

V454V455V456

V457

V67

V68V388V389 V69

V70V71V72V73

V74

V216V217

V318

V75

V537

V76 V77

V78V79

V84

V232V233

V240V241

V269

V316V317

V85

V596

V86V87

V88V89V90

V238V239

V91

V92

V93

V94

V324

V325

V95

V96

V97V98V99

V100

V101

V102V103

V104V105

V106

V107

V108

V218V219

V222

V226

V229

V230

V548

V109

V223

V227V231

V549

V112

V590V591

V592

V593

V113

V114V490

V491

V115

V116V117V118

V119

V120V121

V122

V123

V254V255

V124

V525

V125

V524

V126V282

V283V127

V417

V128V528V529

V129

V130V372

V373

V416

V458

V459 V131

V132

V133

V134V368V369

V396V397

V421

V442V443

V566V135

V136V137

V138

V420

V139

V140

V141

V142

V143

V144

V560

V145

V146V147V148

V149

V150

V334V335

V151

V152V419

V153V418

V154

V155

V156V157

V158 V159

V160V161

V162

V163

V164

V472V473

V165V166V167

V168V169

V170V171

V172V173

V174V175

V176V177V178V179

V180

V181V182

V183

V184

V407

V444

V185V186

V187

V188

V189

V228V190

V191

V192V214V215

V404

V405

V446V447

V193V379

V414

V448

V194

V243

V514V516

V195

V196

V197

V198

V678

V679

V199

V200 V267V201

V266

V202

V203

V204V205

V206V207

V208V209

V210

V211

V212V213

V220

V221

V224

V225

V234

V597

V235V236V237

V242

V244V245

V246

V247

V248V249

V250

V251

V252

V258V259

V253

V256V257

V260V320

V321V562

V563V261

V262

V263

V270 V271

V272V273

V274V275

V276V277

V278V279

V280V281

V284V285

V287

V288V289

V292V534

V535V293

V294V319

V515V517 V295

V296V297

V298V299

V300V301

V302

V310

V311

V312V313

V314V315

V322

V323

V326V327

V328V329

V330

V331

V332

V333

V336V337

V338V339

V340V341 V342

V343

V344V345

V346V347V348

V349

V350V351

V352V353

V354

V387

V355

V356V357

V358V359

V540

V360

V518

V519

V361

V362

V363

V364V365

V366V367

V374V375

V378

V380V381

V382V383

V384V385

V386

V390 V434V435

V580

V581

V391

V392

V438V439

V579

V393 V394

V436

V437

V452V453

V395

V398V530

V531V399V400

V401

V402

V408V409

V430

V403

V406V410V411

V415

V422

V424V425

V441

V583

V423

V440

V445

V449V450V451

V460

V461

V462

V463

V464

V465

V466

V467V468V469

V470

V471

V476

V477 V478

V479

V480

V481

V482

V483

V484

V485

V486

V487V488

V489

V492

V598V599

V493

V494

V495

V496 V497

V498V499

V500V501

V502

V503V504V505

V506

V507

V508

V509

V510V511

V512

V513

V520V521

V522V523

V526

V527

V536

V538

V539

V541

V542

V543

V544

V545

V546 V547

V550

V551

V552

V570V571

V572

V573V574

V578

V553

V568

V577

V556V557

V558

V559

V561

V564

V565

V575

V576

V582

V584V585

V586V587

V588V589

V594

V595

V600

V601

V602V603

V606

V607

V608

V609

V610

V611

V616V617

V618V619

V620

V621

V622

V623

V624 V625

V626

V627

V629

V630

V668

V669 V631

V632

V650

V651

V633

V638V639

V640V641

V642

V643

V644V645 V652

V653

V654V655

V656V657

V658

V659

V662 V663

V670V671

V672

V673

V674

V675

V676V677

27

Page 31: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Restarts

Restarting search may help the constraint solver to find far quicker a solutionbecause :

it permits diversification of search

it avoids being stuck in a large unsatisfiable subtree after some bad initialchoices

it can be combined with nogood recording

28

Page 32: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (4) – MAC-dom/wdeg -nrr

Instances nodes CPU (4) CPU (3)

scen11 882 1.48 1.47

scen11-f12 353 1.39 1.49

scen11-f8 1,264 1.56 2.80

scen11-f6 33,542 4.45 25.20

scen11-f4 421,097 37.2 292.0

scen11-f2 4,310,576 356 3,158

scen11-f1 11,096,549 921 7,805

29

Page 33: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Symmetry Breaking

Definition

Let P be a CN with vars(P) = {x1, . . . , xn}. A variable symmetry σ of P is abijection on vars(P) such that {x1 = a1, . . . , xn = an} is a solution of P iff{σ(x1) = a1, . . . , σ(xn) = an} is a solution of P.

First step to break symmetries automatically: construction of a colored graph.

C0 C2

X0

C1 C3

X1

X2X3

30

Page 34: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Symmetry Breaking

Second step to break symmetries automatically: execution of a a software toolsuch as Nauty or Saucy to compute an automorphism group.

Third step to break symmetries automatically: post a constraint lex for everygenerator of the group.

Definition

A laxicographic constraint lex is defined on two vectors−→X and

−→Y of variables.

We have:−→X = 〈x1, x2, . . . , xr 〉 ≤lex

−→Y = 〈y1, y2, . . . , yr 〉

iff−→X =

−→Y = 〈〉 (both vectors are empty)

or x1 < y1or x1 = y1 and 〈x2, . . . , xr 〉 ≤lex 〈y2, . . . , yr 〉

31

Page 35: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (5) – MAC-dom/wdeg -nrr-sb

Instances nodes CPU (5) CPU (4)

scen11 1,103 1.59 1.48

scen11-f12 571 1.51 1.39

scen11-f8 654 1.56 1.56

scen11-f6 1,388 1.69 4.45

scen11-f4 2,071 1.86 37.20

scen11-f2 12,027 2.96 356.00

scen11-f1 13,125 3.03 921.00

32

Page 36: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Last-conflict based Reasoning

The principle is thefollowing: after eachconflict (dead-end), keepselecting the last assignedvariable as long as noconsistent value can befound.

This looks like a lazy formof intelligent backtracking

xi

xi

x i−1=a i−

1

xi−1 6=

ai−1

x i=a i

x j=a j

xj 6=

aj

xi

LC1

priority = xi

xi 6=

ai

33

Page 37: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (6) – MAC-dom/wdeg -nrr-sb-lc

Instances nodes CPU (6) CPU (5)

scen11 1,173 1.57 1.59

scen11-f12 187 1.48 1.51

scen11-f8 191 1.48 1.56

scen11-f6 273 1.51 1.69

scen11-f4 957 1.82 1.86

scen11-f2 5,101 2.19 2.96

scen11-f1 11,305 2.84 3.03

34

Page 38: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Strong Preprocessing

Before search, one can try to make the CN more explicit.

For example, this can be achieved by enforcing some properties that identifyinconsistent pairs of values.

Here, strong Conservative Dual Consistency (sCDC) combined with symmetrybreaking is enough to solve instances scen11-fx without any search.

35

Page 39: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Results (7) – sCDC-MAC-sb

Instances nodes CPU (7) CPU (6)

scen11 680 (83435) 7.82 1.57

scen11-f12 0 (1474) 1.59 1.48

scen11-f8 0 (3793) 1.86 1.48

scen11-f6 0 (4391) 1.96 1.51

scen11-f4 0 (16207) 2.88 1.82

scen11-f2 0 (29044) 3.78 2.19

scen11-f1 0 (43808) 4.95 2.84

36

Page 40: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

37

Page 41: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Filtering Domains through Constraints

Every constraint represents a “sub-problem” from which some inconsistent valuescan be eliminated, i.e., some values that belong to no solutions (of the constraint).

Several levels of filtering can be defined:

AC (Arc Consistency): all inconsistent values are identified and eliminated

BC (Bounds Consistency): only inconsistent values corresponding to boundsof domains are identified and eliminated

. . .

38

Page 42: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

Constraint cxy : x < y with

dom(x) = [10..20]

dom(y) = [0..15]

After filtering (either AC or BC), we get:

dom(x) = [10..14]

dom(y) = [11..15]

Example

Constraint cwz : w + 3 = z with

dom(w) = {1, 3, 4, 5}dom(z) = {4, 5, 8}

After filtering (AC), we get:

dom(w) = {1, 5}dom(z) = {4, 8}

39

Page 43: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

GAC for the Constraint AllDifferent

Warning

For non-binary constraints, AC is often referred to as GAC.

Proposition

A constraint AllDifferent(X) is GAC iff

∀X ′ ⊆ X , |dom(X ′)| = |X ′| ⇒ ∀x ∈ X \X ′, dom(x) = dom(x)\dom(X ′)

where X denotes the scope of the constraint and dom(X ′) = ∪x′∈X ′dom(x ′)

See (Regin, 1994)

40

Page 44: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}dom(y) = {2, 5}

dom(x) = {2, 5}

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}

dom(x) = {2, 5}

dom(y) = {2, 5}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {9}

41

Page 45: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}dom(y) = {2, 5}

dom(x) = {2, 5}

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}

dom(x) = {2, 5}

dom(y) = {2, 5}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {9}

41

Page 46: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}dom(y) = {2, 5}

dom(x) = {2, 5}3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}

dom(x) = {2, 5}

dom(y) = {2, 5}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {9}

41

Page 47: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}dom(y) = {2, 5}

dom(x) = {2, 5}3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}

dom(x) = {2, 5}

dom(y) = {2, 5}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {9}

41

Page 48: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}dom(y) = {2, 5}

dom(x) = {2, 5}3

41

8

6w

x y

z

dom(w) = {2, 5, 7}

dom(z) = {2, 5, 7, 9}

dom(x) = {2, 5}

dom(y) = {2, 5}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {7, 9}

3

41

8

6w

x y

z

dom(x) = {2, 5}

dom(y) = {2, 5}

dom(w) = {7}

dom(z) = {9}

41

Page 49: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Constraint Propagation

When a constraint filters out one or several inconsistent values, this may triggerthe possibility for some other constraints to filter too (and again). This process ofiterative filtering operations, led constraint per constraint, is called constraintpropagation.

Algorithm 2: runConstraintPropagationOn(P: CN): Boolean

Q ← cons(P)while Q 6= ∅ do

pick and delete c from QXevt ← c .filter() // Xevt denotes the set of variables with reduced

domains (after filtering by means of c)if ∃x ∈ Xevt such that dom(x) = ∅ then

return false // global inconsistency detected

foreach c ′ ∈ cons(P) such that c ′ 6= c and Xevt ∩ scp(c ′) 6= ∅ doadd c ′ to Q

return true

42

Page 50: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 51: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 52: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 53: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 54: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 55: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 56: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 57: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 58: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 59: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 60: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 61: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example : domino-6-6

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

x5

x4x3x2x1

x0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

43

Page 62: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 63: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 64: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 65: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 66: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 67: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 68: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 69: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Generalized Arc Consistency (GAC)

DefinitionLet P be a CN.

A constraint c of P is GAC iff ∀x ∈ scp(c), ∀a ∈ dom(x), there exists asupport for (x , a) on c .

P is GAC iff every constraint of P is GAC.

If there is a constraint c involving a variable x such that there is no supportfor (x , a) on c , then (x , a) is not GAC.

A GAC algorithm is an algorithm that removes all values from a CN P thatare not GAC.

A GAC algorithm computes the so-called GAC-closure of P by propagatingconstraints until a fixed-point is reached.

A GAC algorithm is generic iff it can be applied to any CN (set ofconstraints).

44

Page 70: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

(G)AC Algorithms

Algorithm Time Space Grain Author(s)

AC 3 O(ed3) − gros (Mackworth, 1977)

AC 4 O(ed2) O(ed2) fin (Mohr & Henderson, 1986)

AC 6 O(ed2) O(ed) fin (Bessiere, 1994)

AC 7 O(ed2) O(ed) fin (Bessiere et al. , 1999)

AC 3d O(ed3) O(e + nd) gros (van Dongen, 2002)

AC 2001/3.1 O(ed2) O(ed) gros (Bessiere et al. , 2005)

AC 3.2/3.3 O(ed2) O(ed) gros (Lecoutre et al. , 2003)

AC 3rm O(ed2/ed3) O(ed) gros (Lecoutre & Hemery, 2007)

AC 3bit(+rm) O(ed3) − gros (Lecoutre & Vion, 2008)

Complexities for binary CNs(e: number of constraints, d : greatest domain size, n: number of variables)

45

Page 71: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Establishing Arc Consistency on Domino instances

Instances AC2001 AC3 AC3rm AC3bit AC3bit+rm

800-800 CPU 48.4 2, 437 34.5 13.4 8.7

mem 49M 33M 41M 33M 33M

1000-1000 CPU 89.5 5, 911 62.4 25.1 14.3

mem 66M 42M 54M 42M 46M

2000-2000 CPU 678 > 5h 443 289 91

mem 210M 156M 117M 132M

3000-3000 CPU 2, 349 > 5h 1, 564 1, 274 278

mem 454M 322M 240M 275M

Results on instances domino-n-d(n variables, domain size d).

46

Page 72: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

47

Page 73: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

GAC Algorithms for Table Constraints

A table constraint is a a constraint defined in extension. Is is said to be:

positive if allowed tuples are given

negative if forbidden tuples are given

Many schemes/algorithms proposed in the literature:

GAC-valid: iterating the list of valid tuples

GAC-allowed: iterating the list of allowed tuples (Bessiere & Regin, 1997)

GAC-valid+allowed: visiting both lists (Lecoutre & Szymanek, 2006)

NextIn Indexing (Lhomme & Regin, 2005)

NextDiff Indexing (Gent et al. , 2007)

Tries (Gent et al. , 2007)

Compressed Tables (Katsirelos & Walsh, 2007)

MDDs (Cheng & Yap, 2010)

STR (Ullmann, 2007; Lecoutre, 2008)

48

Page 74: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

GAC Algorithms for Table Constraints

A table constraint is a a constraint defined in extension. Is is said to be:

positive if allowed tuples are given

negative if forbidden tuples are given

Many schemes/algorithms proposed in the literature:

GAC-valid: iterating the list of valid tuples

GAC-allowed: iterating the list of allowed tuples (Bessiere & Regin, 1997)

GAC-valid+allowed: visiting both lists (Lecoutre & Szymanek, 2006)

NextIn Indexing (Lhomme & Regin, 2005)

NextDiff Indexing (Gent et al. , 2007)

Tries (Gent et al. , 2007)

Compressed Tables (Katsirelos & Walsh, 2007)

MDDs (Cheng & Yap, 2010)

STR (Ullmann, 2007; Lecoutre, 2008)

48

Page 75: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

An Illustrative Table Constraint

A constraint c such that:

scp(c) = {x1, x2, x3, x4, x5}c is positive

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

49

Page 76: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 77: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 78: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 79: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 80: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 81: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 82: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0) X

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 83: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0) X

(0,0,0,1,1) X

(0,0,1,0,0) X

(0,0,1,0,1) X

(0,0,1,1,0) X

(0,0,1,1,1) X

(0,1,0,0,0) X

(0,1,0,0,1) X

(0,1,0,1,0) X

(0,1,0,1,1) X

(0,1,1,0,0) X

(0,1,1,0,1) X

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 84: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0) X

(0,0,0,1,1) X

(0,0,1,0,0) X

(0,0,1,0,1) X

(0,0,1,1,0) X

(0,0,1,1,1) X

(0,1,0,0,0) X

(0,1,0,0,1) X

(0,1,0,1,0) X

(0,1,0,1,1) X

(0,1,1,0,0) X

(0,1,1,0,1) X

(0,1,1,1,0)

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 validity checks50

Page 85: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-allowed

Allowed Tuples

(0,0,0,0,0) X

(0,0,0,0,1) X

(0,0,0,1,0) X

(0,0,0,1,1) X

(0,0,1,0,0) X

(0,0,1,0,1) X

(0,0,1,1,0) X

(0,0,1,1,1) X

(0,1,0,0,0) X

(0,1,0,0,1) X

(0,1,0,1,0) X

(0,1,0,1,1) X

(0,1,1,0,0) X

(0,1,1,0,1) X

(0,1,1,1,0) X

(2,2,2,2,2)

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

⇒ 2r − 1 operations (validity checks)50

Page 86: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 87: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 88: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 89: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 90: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 91: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

(0,1,1,2,1)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 92: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

(0,1,1,2,1) X

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 93: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

(0,1,1,2,1) X

(0,1,1,2,2) X

(0,1,2,1,1) X

(0,1,2,1,2) X

(0,1,2,2,1) X

(0,1,2,2,2) X

(0,2,1,1,1) X

(0,2,1,1,2) X

(0,2,1,2,1) X

(0,2,1,2,2) X

(0,2,2,1,1) X

(0,2,2,1,2) X

(0,2,2,2,1) X

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 94: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

(0,1,1,2,1) X

(0,1,1,2,2) X

(0,1,2,1,1) X

(0,1,2,1,2) X

(0,1,2,2,1) X

(0,1,2,2,2) X

(0,2,1,1,1) X

(0,2,1,1,2) X

(0,2,1,2,1) X

(0,2,1,2,2) X

(0,2,2,1,1) X

(0,2,2,1,2) X

(0,2,2,2,1) X

(0,2,2,2,2)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r constraint checks51

Page 95: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

Is there a support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1) X

(0,1,1,1,2) X

(0,1,1,2,1) X

(0,1,1,2,2) X

(0,1,2,1,1) X

(0,1,2,1,2) X

(0,1,2,2,1) X

(0,1,2,2,2) X

(0,2,1,1,1) X

(0,2,1,1,2) X

(0,2,1,2,1) X

(0,2,1,2,2) X

(0,2,2,1,1) X

(0,2,2,1,2) X

(0,2,2,2,1) X

(0,2,2,2,2) X

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

(2,2,2,2,2)

⇒ 2r operations (constraint checks)51

Page 96: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

GAC-valid+allowed (Algorithm)

At the heart of the algorithm, we have the procedure:

Algorithm 3: seekSupportGACva(c : Constraint, x : Variable, a: Value) : Tuple

τ ← setFirstValidTuple(c , x , a)while τ 6= > do

τ ′ ← binarySearch(allowedTuples(c , x , a), τ)if τ ′ = > then return >j ← seekInvalidPosition(c , τ ′)if j = NO then return τ ′

τ ← setNextValid(c , x , a, τ ′, j)

return >

52

Page 97: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

Valid Tuples Allowed Tuples

. . .

. . .

. . .

. . .

τ2. . .

. . .

. . .

. . .

. . .

. . .

τ4√

. . .

. . .

. . .

. . .

53

Page 98: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

Valid Tuples

τ1

Allowed Tuples

. . .

. . .

. . .

. . .

τ2. . .

. . .

. . .

. . .

. . .

. . .

τ4√

. . .

. . .

. . .

. . .

53

Page 99: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

Valid Tuples

τ1

Allowed Tuples

. . .

. . .

. . .

. . .

τ2. . .

. . .

. . .

. . .

. . .

. . .

τ4√

. . .

. . .

. . .

. . .

53

Page 100: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

Valid Tuples

τ1. . .

. . .

. . .

. . .

. . .

. . .

. . .

τ3

Allowed Tuples

. . .

. . .

. . .

. . .

τ2. . .

. . .

. . .

. . .

. . .

. . .

τ4√

. . .

. . .

. . .

. . .

53

Page 101: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

Valid Tuples

τ1. . .

. . .

. . .

. . .

. . .

. . .

. . .

τ3

Allowed Tuples

. . .

. . .

. . .

. . .

τ2. . .

. . .

. . .

. . .

. . .

. . .

τ4√

. . .

. . .

. . .

. . .

53

Page 102: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

A support for (x1, 0) on c?

Valid Tuples Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

nil

⇒ 1 constraint check54

Page 103: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

A support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

nil

⇒ 1 constraint check54

Page 104: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration of GAC-valid+allowed

The current domains:

dom(x1) = {0}dom(x2) = {1, 2}dom(x3) = {1, 2}dom(x4) = {1, 2}dom(x5) = {1, 2}

A support for (x1, 0) on c?

Valid Tuples

(0,1,1,1,1)

Allowed Tuples

(0,0,0,0,0)

(0,0,0,0,1)

(0,0,0,1,0)

(0,0,0,1,1)

(0,0,1,0,0)

(0,0,1,0,1)

(0,0,1,1,0)

(0,0,1,1,1)

(0,1,0,0,0)

(0,1,0,0,1)

(0,1,0,1,0)

(0,1,0,1,1)

(0,1,1,0,0)

(0,1,1,0,1)

(0,1,1,1,0)

nil

⇒ 1 operation (constraint check)54

Page 105: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Observations

There exist r -ary positive table constraints such that, for some current domains ofvariables,

applying GAC3v is O(2r−1).

applying GAC3a is O(2r−1).

applying GAC3va is O(r2)

However, the previous schemes proceed gradually: a support is sought for eachvalue in turn: (x1, 0), (x2, 1), (x2, 2), . . .

Other (more recent) schemes proceed globally: GAC is enforced by traversing(once) the structure of the constraint. For example :

STR

MDD

55

Page 106: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Simple Tabular Reduction

Simple tabular reduction (STR)

original approach introduced by J. Ullmann

principle: to dynamically maintain tables (only keeping supports)

efficiency obtained by using a sparse set data structure

Versions of STR:

STR(1) (Ullmann, 2007)

STR2 (Lecoutre, 2008)

STR3 (Lecoutre et al. , 2012)

56

Page 107: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithm 4: STR(c : constraint): set of variables

Output: the set of variables in scp(c) with reduced domain

foreach variable x ∈ scp(c) dogacValues[x ]← ∅

foreach tuple τ ∈ table[c] doif isValid(c , τ) then

foreach variable x ∈ scp(c) doif τ [x ] /∈ gacValues[x ] then

add τ [x ] to gacValues[x ]

elseremoveTuple(c , τ)

// domains are now updated and Xevt computed

Xevt ← ∅foreach variable x ∈ scp(c) do

if gacValues[x ] ⊂ dom(x) thendom(x)← gacValues[x ]Xevt ← Xevt ∪ {x}

return Xevt57

Page 108: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 109: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 110: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 111: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 112: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 113: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 114: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 115: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 116: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 117: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 118: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with STR

table[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {}gacV alues[y] = {}gacV alues[z] = {}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a}gacV alues[z] = {c}

(a, ,b)

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√( , , )

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

a

b

a

b

a

btable[cxyz]

x y z

(a,a, )

(b,a,a)

(b,b, )

( ,a,b)

gacV alues[x] = {a, c}

( , , )

gacV alues[y] = {a, c}gacV alues[z] = {b, c}

(a, ,b)√

dom(x)

dom(y)

dom(z)

(a,b,a)

√√

58

Page 119: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A Table Constraint as a MDD Constraint

(a,a,b)2

(a,b,b)3

(b,a,a)4

(b,a,b)5

(b,b, )6

(b, ,a)7

( ,a,a)8

( ,b,a)9

( , ,a)10

x y z

(a,a,a)1

table[cxyz]

(a) A table

t

mdd(cxyz)

a

a

b

b

b a

b a

ba

b a

1

2

3

4

level

y

z

x

(b) A MDD

59

Page 120: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithm 5: enforceGAC-mdd(c : constraint): set of variables

Output: the set of variables in scp(c) with reduced domain

Σtrue ← ∅Σfalse ← ∅foreach variable x ∈ scp(c) do

gacValues[x ]← ∅exploreMDD(mdd(c)) // gacValues is updated during exploration

// domains are now updated and Xevt computed

Xevt ← ∅foreach variable x ∈ scp(c) do

if gacValues[x ] ⊂ dom(x) thendom(x)← gacValues[x ]Xevt ← Xevt ∪ {x}

return Xevt

60

Page 121: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithm 6: exploreMDD(node: Node): Boolean

Output: true iff node is supported

if node = t thenreturn true // since we are at a leaf

if node ∈ Σtrue thenreturn true // since already proved to be supported

if node ∈ Σfalse thenreturn false // since already proved to be unsupported

x ← node.variable ; supported ← falseforeach arc ∈ node.outs do

if arc .value ∈ dom(x) thenif exploreMDD(arc .destination) then

supported ← truegacValues[x ]← gacValues[x ] ∪ {arc .value}

if supported = true then Σtrue ← Σtrue ∪ {node}else Σfalse ← Σfalse ∪ {node}return supported

61

Page 122: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Illustration with MDD

Event: z = b

Domains before filtering:dom(x)← {a, b, c}dom(y)← {a, b, c}dom(z)← {b}

Collected values:gacValues[x ]← {a, b}gacValues[y ]← {a, b}gacValues[z ]← {b}

Domains after filtering:dom(x)← {a, b}dom(y)← {a, b}dom(z)← {b}

t

1

2

3

4

level

a

a

c

b

bc

bca

b c a

ba

b a

mdd(cxyz)

y

z

x

62

Page 123: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

The Regular Constraint

The general form of a regular constraint (Pesant, 2004) is regular(X ,A) where:

X denotes the scope of the constraint (an ordered set of variables)

A denotes a deterministic finite automata

An instantiation I of X satisfies the constraint iff the word formed by thesequence of values in I is recognized by the automata A.

RemarkThe constraint regular is a generalization of the stretch constraint.

63

Page 124: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

The Stretch Constraint

The general form of a stretch constraint (Pesant, 2001) is stretch(X , L,U,P)where:

X denotes the scope of the constraint (an ordered set of variables)

L and U are mappings from ∪x∈Xdom(x) to NP is a set of pairs of distinct values chosen in ∪x∈Xdom(x)

An instantiation I of X satisfies the constraint iff

1 every stretch in I , with value v , has a length comprised between L(v) andU(v),

2 every two consecutive stretches in I form a pair of values contained in P.

RemarkA stretch is a a maximal sequence of consecutive variables that take the samevalue.

64

Page 125: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

We have a set X of variables for representing the successive shifts of an employee:

∀x ∈ X , dom(x) = {d , o, n} // working d(ay), o(ff), n(ight)

∀v ∈ {d , o, n}, L(v) = 2 and U(v) = 3

P = {(d , o), (o, d), (o, n), (n, o)}

Monday Tuesday Wednesday Thirsday FridaySunday Saturday

n(ight)

d(ay)

is not satisfying the stretch constraint

Monday Tuesday Wednesday Thirsday FridaySunday Saturday

n(ight)

d(ay)

is satisfying the stretch constraint

65

Page 126: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

Here is the automata for the stretch constraint introduced previously :

d

d d

n n

d

nn

d

n

o

oo

o

oo⇒

66

Page 127: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A Regular constraint as a MDD Constraint

Here is the MDD developed from the automata over a scope of 7 variables :

d

d

d

o

o

o

n

o

d

o

d

n

n

d

d

n

n

n

on

67

Page 128: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Converting the Stretch constraint into a MDD or Table constraint:

Scope MDD Table

7 variables 15 nodes 12 tuples

14 variables 58 nodes 176 tuples

28 variables 170 nodes 72,800 tuples

42 variables 282 nodes ? tuples

68

Page 129: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Regular for Nonogram Puzzles

2 2 2 2 2 2 2

3 3 2 2 2 2 2 3 3

2 2

4 4

1 3 1

2 1 2

1 1

2 2

2 2

3

1

Table: Nonogram Puzzle to be solved (see Chapter 14 in Gecode Documentation)

69

Page 130: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Regular for Nonogram Puzzles

2 2 2 2 2 2 2

3 3 2 2 2 2 2 3 3

2 2 � � � �

4 4 � � � � � � � �

1 3 1 � � � � �

2 1 2 � � � � �

1 1 � �

2 2 � � � �

2 2 � � � �

3 � � �

1 �

Table: Solution to the Nonogram Puzzle

70

Page 131: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Regular for Nonogram Puzzles

Each hint corresponds to a regular expression.

Example

The hint 2 1 corresponds to0∗120+10∗

0

1 1 0

0

1

0

When considering the instances of the benchmarks proposed by G. Pesant,

tables are very large (over 1,000,000 tuples for some of them)

MDDs are rather compact (a few hundreds of nodes, at most)

71

Page 132: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Table for Kakuro Puzzles

7 21 29 17 29 23

64

167

1416

46

339

2822

24

310

3 20

119

10 104

24 16

710

93

2316

64

42

21 21

4 3 16

Table: Kakuro puzzle to be solved (see Chapter 18 in Gecode Documentation)

72

Page 133: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Table for Kakuro Puzzles

7 21 29 17 29 23

64 1 3

167 8 9

1416 7 9

46 3 2 1

339 9 7 8 4 5 6

28 3 1 4 6 2 7 522

24 7 9 8

3 1 210

3 2 1 20 9 1 2 8

119 4 5

10 104 3 1

24 16

710 2 1 4 3

93 1 2

2316 7 9

6 2 1 34

42 4 3 9 5 6 8 7

21 4 5 2 3 1 6 21 4 8 9

4 1 3 3 1 2 16 7 9

Table: Solution to the Kakuro Puzzle

73

Page 134: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Table for Kakuro Puzzles

For a maximal sequence of variables X , we can post two distinct constraints:

allDifferent(X)

sum(X) = v (i.e., Σx∈X = v) where v is the value of the hint

and we can benefit from sophisticated filtering algorithms for these constraints.

However, we deal with separate constraints sharing the same scope.

One solution (Simonis, 2008) is to build table constraints by computing solutionsto pairs of constraints “allDifferent-sum”. In the worst-case, 362, 880 tuples (butfar less, most of the time)

74

Page 135: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Summary

Table constraints:

universal representation (but space complexity to be considered)

simple solution to end-users of CP systems

MDD constraints:

compact representation

can be derived from automata

What about decomposition approaches of automata-based constraints (Beldiceanuet al. , 2005)?

75

Page 136: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Outline

1 Modelling Constraint Problems

2 Solving Constraint Satisfaction Problems

3 Constraint Propagation

4 Filtering Algorithms for Table, MDD and Regular Constraints

5 Strong Inference

76

Page 137: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Filtering through Consistencies

A consistency is a property defined on CNs. Typically, it reveals some nogoods.

A first-order consistency (or domain-filtering consistency) allows us to identifyinconsistent values (nogoods of size 1). For example:

Generalized Arc Consistency (GAC)

Path Inverse Consistency (PIC)

Singleton Arc Consistency (SAC)

A second-order consistency allows us to identify inconsistent pairs of values(nogoods of size 2). For example:

Path Consistency (PC)

Dual Consistency (DC)

Conservative variants of PC and DC

77

Page 138: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Filtering through Consistencies

A consistency is a property defined on CNs. Typically, it reveals some nogoods.

A first-order consistency (or domain-filtering consistency) allows us to identifyinconsistent values (nogoods of size 1). For example:

Generalized Arc Consistency (GAC)

Path Inverse Consistency (PIC)

Singleton Arc Consistency (SAC)

A second-order consistency allows us to identify inconsistent pairs of values(nogoods of size 2). For example:

Path Consistency (PC)

Dual Consistency (DC)

Conservative variants of PC and DC

77

Page 139: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Filtering through Consistencies

A consistency is a property defined on CNs. Typically, it reveals some nogoods.

A first-order consistency (or domain-filtering consistency) allows us to identifyinconsistent values (nogoods of size 1). For example:

Generalized Arc Consistency (GAC)

Path Inverse Consistency (PIC)

Singleton Arc Consistency (SAC)

A second-order consistency allows us to identify inconsistent pairs of values(nogoods of size 2). For example:

Path Consistency (PC)

Dual Consistency (DC)

Conservative variants of PC and DC

77

Page 140: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Relationships between first-order Consistencies

means

φ is stri tly stronger than ψ

φ ψ

IwC

rPIC

GAC

MaxRPWC

SAC

sPWC

PIC

AC

MaxRPC

SAC

rNICsPC

NIC

Binary Networks Non-binary Networks

78

Page 141: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Relationships between 2-order Consistencies (binary CNs)

2SAC s2SAC sC2SAC

C2SAC 3C=DC=PC s3C=sDC=sPC BiSAC

CDC sCDC=SAC+CDC SAC

PPC sPPC MaxRPC

C3C sCPC=sC3C AC=2C

CPC

strictly stronger incomparable = equivalent

79

Page 142: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Relationships between 2-order Consistencies (non-binary)

2SAC s2SAC

C2SAC 3C DC sDC SAC+CDC

PC CDC sCDC sPC SAC

C3C PPC sPPC GAC

CPC sCPC

strictly stronger incomparable = equivalent

80

Page 143: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 144: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 145: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 146: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 147: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 148: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on SAC

Definition (Singleton Arc Consistency)

Let P be a CN.

A value (x , a) of P is singleton arc-consistent (SAC) iff AC (P|x=a) 6= ⊥.

A variable x of P is SAC iff ∀a ∈ dom(x), (x , a) is SAC.

P is SAC iff any variable of P is SAC.

Remark

SAC is stronger than (G)AC

81

Page 149: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithm SAC-1

AC ACAC AC AC

ACP

AC

. . .

x1=

a

x1=

c

xn=

a

x1=

b

xn=

b

xn=

c

*

xn 6= b

82

Page 150: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Exploiting Incrementality of GAC Algorithms

AC ACAC AC AC AC

. . .

x1=

a

x1=

c

xn=

a

x1=

b

xn=

b

xn=

c

P

The complexity of enforcing AC on anode is O(ed2).

The complexity ofenforcing AC on thebranch is O(ed2).

AC

AC

AC

AC

P

. . .

x1=

a1

x2=

a2

x3=

a3

83

Page 151: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithms SAC-opt and SAC-SDS

AC ACAC AC AC

ACP

AC

AC

. . .

x1=

a

x1=

c

xn=

a

x1=

b

xn=

b

xn=

c

xn 6= bxn6=

b ⊥

84

Page 152: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Algorithms SAC-3

ACAC AC

ACP

AC

AC

AC

AC

xn=

a

Solution found

xn=

b

x2=

c

x2=

ax2=

c ⊥

xn 6= b

. . .

. . . . . .

. . .

xn=

b

. . .

85

Page 153: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

(Worst-case) Complexities

Algorithm Time Space Author(s)

SAC-1 O(en2d4) O(ed) (Debruyne & Bessiere, 1997)

SAC-2 O(en2d4) O(n2d2) (Bartak & Erben, 2004)

SAC-Opt O(end3) O(end2) (Bessiere & Debruyne, 2004)

SAC-SDS O(end4) O(n2d2) (Bessiere & Debruyne, 2005)

SAC-3 O(bed2) O(ed) (Lecoutre & Cardon, 2005)

SAC-3+ O(bed2) O(bmaxnd + ed) (Lecoutre & Cardon, 2005)

86

Page 154: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Some Experimental Results

SAC-1 SAC-SDS SAC-3 SAC-3+

cc-20-3 CPU 23 22 7 7

(#×=0) #scks 1, 200 1, 200 1, 200 1, 200

gr -34-9 CPU 111 31 91 32

(#×=513) #scks 8, 474 4, 720 11, 017 2, 013

qa-6 CPU 27 14 8.4 4.3

(#×=48) #scks 2, 523 1, 702 2, 855 1, 448

scen05 CPU 11 20 1.5 (1) 1.8

(#×=13814) #scks 6, 513 4, 865 4, 241 2, 389

graph03 CPU 215 136 74 39

(#×=1274) #scks 20, 075 17, 069 22, 279 8, 406

87

Page 155: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on DC

Definition (Dual Consistency - DC)

Let P be a constraint network.

A pair of values {(x , a), (y , b)} on P is DC-consistent iff (y , b) ∈ AC (P|x=a)and (x , a) ∈ AC (P|y=b).

P is DC-consistent iff every pair of values {(x , a), (y , b)} on P isDC-consistent.

Remark

CDC (Conservative DC) is DC restricted on existing binary constraints.

88

Page 156: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on DC

Definition (Dual Consistency - DC)

Let P be a constraint network.

A pair of values {(x , a), (y , b)} on P is DC-consistent iff (y , b) ∈ AC (P|x=a)and (x , a) ∈ AC (P|y=b).

P is DC-consistent iff every pair of values {(x , a), (y , b)} on P isDC-consistent.

Remark

CDC (Conservative DC) is DC restricted on existing binary constraints.

88

Page 157: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on DC

Definition (Dual Consistency - DC)

Let P be a constraint network.

A pair of values {(x , a), (y , b)} on P is DC-consistent iff (y , b) ∈ AC (P|x=a)and (x , a) ∈ AC (P|y=b).

P is DC-consistent iff every pair of values {(x , a), (y , b)} on P isDC-consistent.

Remark

CDC (Conservative DC) is DC restricted on existing binary constraints.

88

Page 158: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on DC

Definition (Dual Consistency - DC)

Let P be a constraint network.

A pair of values {(x , a), (y , b)} on P is DC-consistent iff (y , b) ∈ AC (P|x=a)and (x , a) ∈ AC (P|y=b).

P is DC-consistent iff every pair of values {(x , a), (y , b)} on P isDC-consistent.

Remark

CDC (Conservative DC) is DC restricted on existing binary constraints.

88

Page 159: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

A focus on DC

Definition (Dual Consistency - DC)

Let P be a constraint network.

A pair of values {(x , a), (y , b)} on P is DC-consistent iff (y , b) ∈ AC (P|x=a)and (x , a) ∈ AC (P|y=b).

P is DC-consistent iff every pair of values {(x , a), (y , b)} on P isDC-consistent.

Remark

CDC (Conservative DC) is DC restricted on existing binary constraints.

88

Page 160: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Properties

Proposition

DC is strictly stronger than PC

On binary CNS, DC is equivalent to PC

Proposition

For any constraint network P, we have:

GAC ◦ DC (P) = sDC (P)

GAC ◦ CDC (P) = sCDC (P)

But

AC ◦ CPC (P) 6= sCPC (P)

AC ◦ PPC (P) 6= sPPC (P).

sφ is φ+ (G )AC

89

Page 161: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

sCDC1

Algorithm 7: sCDC1

P ← GAC (P) // GAC is initially enforced

finished ← falserepeat

finished ← trueforeach x ∈ vars(P) do

if revise-sCDC 1(x) thenP ← GAC (P) // GAC is maintained

finished ← false

until finished

90

Page 162: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

sCDC1

Algorithm 8: revise-sCDC1(var x : variable): Boolean

modified ← falseforeach value a ∈ dom(x) do

P ′ ← GAC (P|x=a) // Singleton check on (x , a)if P ′ = ⊥ then

remove a from dom(x) // SAC-inconsistent value

modified ← true

elseforeach constraint cxy ∈ cons(P) do

foreach value b ∈ dom(y) do

if b /∈ domP′(y) thenremove (a, b) from rel(cxy ) // CDC-inconsistent values

modified ← true

return modified

91

Page 163: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 164: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 165: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 166: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 167: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 168: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 169: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 170: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Example

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z with wiped-out domain

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

0

0 1

1

2

2

2

1

1

1 2

2

0

0

v w

x

y

z

0

2

0 1

1

0

2

2

1

0

0 1

1

2

2

92

Page 171: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Impact for Search

Instance MAC sCDC1-MAC

scen11-f8CPU 8.0 14.3

nodes 14, 068 4, 946

scen11-f6CPU 68.4 58.2

nodes 302K 145K

scen11-f4CPU 582 559

nodes 2, 826K 1, 834K

scen11-f3CPU 2, 338 1, 725

nodes 12M 5, 863K

scen11-f2CPU 7, 521 5, 872

nodes 37M 21M

scen11-f1CPU 17, 409 13, 136

nodes 93M 55M

93

Page 172: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

SAC and DC as Decision-based Consistencies

Sφ∆Bφ

∆Sφ∆+Dφ

Dφ∆

Sφ∆+Eφ

∆ Eφ∆

φ

Figure: Relationships between general classes of consistencies.

SACsDC

DC

BiSAC

1 -AC EAC∆=

BoundSAC AC

Figure: Relationships when φ = AC and ∆ = ∆=.94

Page 173: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Bartak, R., & Erben, R. 2004.A new algorithm for singleton arc consistency.Pages 257–262 of: Proceedings of FLAIRS’04.

Beldiceanu, N., Carlsson, M., Debruyne, R., & Petit, T. 2005.Reformulation of Global Constraints Based on Constraint Checkers.Constraints, 10(4), 339–362.

Bessiere, C. 1994.Arc consistency and arc consistency again.Artificial Intelligence, 65, 179–190.

Bessiere, C., & Debruyne, R. 2004.Theoretical analysis of singleton arc consistency.Pages 20–29 of: Proceedings of ECAI’04 workshop on modelling and solvingproblems with constraints.

Bessiere, C., & Debruyne, R. 2005.Optimal and suboptimal singleton arc consistency algorithms.Pages 54–59 of: Proceedings of IJCAI’05.

95

Page 174: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Bessiere, C., & Regin, J. 1997.Arc consistency for general constraint networks: preliminary results.Pages 398–404 of: Proceedings of IJCAI’97.

Bessiere, C., Freuder, E.C., & Regin, J. 1999.Using constraint metaknowledge to reduce arc consistency computation.Artificial Intelligence, 107, 125–148.

Bessiere, C., Regin, J.C., Yap, R., & Zhang, Y. 2005.An optimal coarse-grained arc consistency algorithm.Artificial Intelligence, 165(2), 165–185.

Cheng, K., & Yap, R. 2010.An MDD-based Generalized Arc Consistency Algorithm for Positive andNegative Table Constraints and Some Global Constraints.Constraints, 15(2), 265–304.

Debruyne, R., & Bessiere, C. 1997.Some practical filtering techniques for the constraint satisfaction problem.Pages 412–417 of: Proceedings of IJCAI’97.

96

Page 175: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Gent, I.P., Jefferson, C., Miguel, I., & Nightingale, P. 2007.Data Structures for Generalised Arc Consistency for Extensional Constraints.Pages 191–197 of: Proceedings of AAAI’07.

Katsirelos, G., & Walsh, T. 2007.A compression algorithm for large arity extensional constraints.Pages 379–393 of: Proceedings of CP’07.

Lecoutre, C. 2008.Optimization of Simple Tabular Reduction for Table Constraints.Pages 128–143 of: Proceedings of CP’08.

Lecoutre, C., & Cardon, S. 2005.A greedy approach to establish singleton arc consistency.Pages 199–204 of: Proceedings of IJCAI’05.

Lecoutre, C., & Hemery, F. 2007.A study of residual supports in Arc Consistency.Pages 125–130 of: Proceedings of IJCAI’07.

97

Page 176: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Lecoutre, C., & Szymanek, R. 2006.Generalized Arc Consistency for Positive Table Constraints.Pages 284–298 of: Proceedings of CP’06.

Lecoutre, C., & Vion, J. 2008.Enforcing Arc Consistency using Bitwise Operations.Constraint Programming Letters, 2, 21–35.

Lecoutre, C., Boussemart, F., & Hemery, F. 2003.Exploiting multidirectionality in coarse-grained arc consistency algorithms.Pages 480–494 of: Proceedings of CP’03.

Lecoutre, C., Likitvivatanavong, C., & Yap, R. 2012.A path-optimal GAC algorithm for table constraints.Page to appear of: Proceedings of ECAI’12.

Lhomme, O., & Regin, J.C. 2005.A fast arc consistency algorithm for n-ary constraints.Pages 405–410 of: Proceedings of AAAI’05.

98

Page 177: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Mackworth, A.K. 1977.Consistency in networks of relations.Artificial Intelligence, 8(1), 99–118.

Mohr, R., & Henderson, T.C. 1986.Arc and path consistency revisited.Artificial Intelligence, 28, 225–233.

Pesant, G. 2001.A Filtering Algorithm for the Stretch Constraint.Pages 183–195 of: Proceedings of CP’01.

Pesant, G. 2004.A Regular Language Membership Constraint for Finite Sequences ofVariables.Pages 482–495 of: Proceedings of CP’04.

Regin, J.C. 1994.A filtering algorithm for constraints of difference in CSPs.Pages 362–367 of: Proceedings of AAAI’94.

99

Page 178: Constraint Reasoning Part 1 - univ-artois.fr Reasoning Part 1 Christophe Lecoutre ... the problem modelled by the user must be tackled ... Using Heuristics to Guide Search

Simonis, H. 2008.Kakuro as a constraint problem.In: Proceedings of the workshop on modelling and reformulating constraintsatisfaction problems held with CP’08.

Ullmann, J.R. 2007.Partition search for non-binary constraint satisfaction.Information Science, 177, 3639–3678.

van Dongen, M.R.C. 2002.AC3d an efficient arc consistency algorithm with a low space complexity.Pages 755–760 of: Proceedings of CP’02.

100