Outline 1 The topic 2 Decision support systems 3 Modeling 3.4 - - PowerPoint PPT Presentation

outline
SMART_READER_LITE
LIVE PREVIEW

Outline 1 The topic 2 Decision support systems 3 Modeling 3.4 - - PowerPoint PPT Presentation

Outline 1 The topic 2 Decision support systems 3 Modeling 3.4 Constraints Computing with relations Finite domains Solution algorithms Complexity vs. completeness Model-Based Systems & Qualitative Reasoning WS 11/12 EMDS 3


slide-1
SLIDE 1

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  163

1 The topic 2 Decision support systems 3 Modeling 3.4 Constraints

Outline

 Computing with relations  Finite domains  Solution algorithms  Complexity vs. completeness

slide-2
SLIDE 2

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  164

Example: A Crossword Puzzle

1 2 3 4 5 6 7 8

Instructions  fill in words from the list List of Words  Aft  Ale  Eel  Hike  Hoses  Keel  Knot  Laser  Lee  Line  Sails  Sheet  Steer  Tie

slide-3
SLIDE 3

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  165

Definitions

Variables and Domains  variables V = {v1, v2, ..., vn}  domains D = {DOM(v1), DOM(v2), ..., DOM(vn)} Constraints C  relations Ri  DOM(vk1)  DOM(vk2)  ...  DOM(vkj) Constraint Satisfaction Problem (CSP)  Given (V, D, C)  determine tuples in DOM(v1)  DOM(v2)  ...  DOM(vn) that satisfy given set of constraints C = {R1, R2, ..., Rc}

 165

slide-4
SLIDE 4

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  166

Example: CSP for the Crossword Puzzle

Variables  V = {1 across, 4 across, 2 down, ... } Domains  For all i DOMi = {Aft, Ale, Eel, Hike, ...} Constraints  For each variable vi: Equal(LengthWord(vi), NumberPositions(vi))  For two variables vi, vj sharing positions pik, pjl: Equal(Character(pik),Character(pjl))

slide-5
SLIDE 5

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  167

Graphical Representations of CSPs

Primal Constraint Graph  nodes represent variables  hyperarcs represent constraints Dual Constraint Graph  nodes represent constraints  multiarcs represent variables C1 C2 v2 C3 v2 v3 v2 v4 v1 v2 v3 v4 C1 C2 C3

slide-6
SLIDE 6

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3

Example: Primal Constraint Graph for the Crossword Puzzle

1 across 4 across 7 across 8 across 2 down 3 down 5 down 6 down

Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ... Aft Ale Eel Hike ...

 168

slide-7
SLIDE 7

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  169

Solving CSPs

Basic Search Methods  general search strategies – generate and test – chronological backtracking: backtracking to the last choice  “gather information while searching” strategies – dependency-directed backtracking: (ddp) backtracking to a choice that caused the inconsistency – truth maintenance systems: record dependencies and avoid choices leading to discovered inconsistencies (see ch. 4.3)

slide-8
SLIDE 8

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  170

Problem Reduction

Removing Domain Values through Constraint Filtering  remove values for nodes (1-consistency, “node consistency”)  remove values for arcs (2-consistency, “arc consistency”)  ...  remove values for paths of length k-1 (k-consistency) Basic Idea  reduce size of CSP without ruling out solutions

slide-9
SLIDE 9

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  171

Algorithm for Node Consistency

Procedure NC (V, D, C) For each vi  V For each Rj  C with Rj  DOM(vi) For each val  DOM(vi) If val  Rj Then DOM(vi)  DOM(vi) \ {val} Return (V, D, C)

slide-10
SLIDE 10

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  172

Crossword Puzzle: After Applying Node Consistency

1 across 4 across 7 across 8 across 2 down 3 down 5 down 6 down

Hoses Laser Sails Sheet Steer Hike Keel Knot Line Aft Ale Eel Lee Tie Hoses Laser Sails Sheet Steer Hoses Laser Sails Sheet Steer Hoses Laser Sails Sheet Steer Hike Keel Knot Line Aft Ale Eel Lee Tie

slide-11
SLIDE 11

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

 173

Definition: (Classical) Arc-Consistency (2-Consistency)

Constraint network R = ( V, D, C)  Binary constraints Rik  C  Variable vi is arc-consistent relative to vk iff for every value ai  DOM(vi) there exists ak  DOM(vk) such that (ai, ak)  Rik  Arc (vi, vk) is arc-consistent iff vi is arc-consistent relative to vk and vk is arc-consistent relative to vi  ( V, D, C) is arc-consistent iff all arcs are arc-consistent  compute by closure over DOM(vi)  DOM(vi)  i (Rik  DOM(vk) )

WS 11/12 EMDS 3

slide-12
SLIDE 12

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  174

Algorithm for Arc Consistency

Procedure REVISE_DOMAIN (vi,vk) deleted  False; For each vali  DOM(vi) If Not exists valk  DOM(vk) such that (vali,valk)  Ri,k Then DOM(vi)  DOM(vi) \ {vali}; deleted  True return(deleted)  compute by closure over DOM(vi)  DOM(vi)  i (Rik  DOM(vk) )

slide-13
SLIDE 13

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  175

AC-1: A Simple Algorithm for Arc Consistency

Procedure AC-1 (V, D, C) agenda  {(vi,vk)  i,k  n, i  k}; Repeat changed  False; For each (vi,vk)  agenda changed  REVISE_DOMAIN(vi,vk) or changed Until Not changed; return(V,D,C)  compute by closure over DOM(vi)  DOM(vi)  i (Rik  DOM(vk) )

slide-14
SLIDE 14

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

 176

AC-3: An Improved Algorithm for Arc Consistency

Procedure AC-3 (V, D, C) agenda  {(vi,vk)  i,k  n, i  k}; While agenda  { } choose (vi,vk)  agenda; agenda  agenda \ (vi,vk); If REVISE_DOMAIN(vi,vk) Then agenda  agenda  {(vm,vi)  m  n, m  k,i} Wend; return(V,D,C)  compute by closure over DOM(vi)  DOM(vi)  i (Rik  DOM(vk) )

WS 11/12 EMDS 3

slide-15
SLIDE 15

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  177

Example: Crossword Puzzle: Applying Arc Consistency

1 across 4 across 7 across 8 across 2 down 3 down 5 down 6 down

Hoses Laser Sails Sheet Steer Hike Keel Knot Line Aft Ale Eel Lee Tie Hoses Laser Sails Sheet Steer Hoses Laser Sails Sheet Steer Hoses Laser Sails Sheet Steer Hike Keel Knot Line Aft Ale Eel Lee Tie

slide-16
SLIDE 16

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  178

Example: Crossword Puzzle: Solution

1 2 3 4 5 6 7 8

H K O S E S T E I A H A L E E R E S A L E L

slide-17
SLIDE 17

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  179

Definition: Classical Path-Consistency (3-Consistency)

Constraint network R = ( V, D, C)  { vi, vj } is path-consistent relative to vk iff for every consistent assignment (vi = ai, vj = aj) there is a value ak  DOM(vk) such that the assignments (vi=ai, vk=ak) and (vk=ak,vj=aj) are consistent  A binary constraint Rij is path-consistent relative to vk iff for every tuple (ai,aj)  Rij there is ak  DOM(vk) such that (ai,ak)  Rik and (ak,aj)  Rkj  A constraint network is path-consistent iff every Rij is path-consistent relative to vk for every k  i, j  compute by closure over Rij  Rij  ij (Rik  DOM(vk)  Rkj)

slide-18
SLIDE 18

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  180

Complexity of Constraint Filtering (Binary CSPs)

Polynomial Algorithms  n: number of variables  c: number of constraints  d: (maximal) domain size Time Space 2-consistency 3-consistency O(cd3) O(c+nd) O(cd2) O(cd2) O(n3d3) O(n3d3)

slide-19
SLIDE 19

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  181

Example: Centigrade - Fahrenheit: 9C = 5(F-32)

Evaluation of Constraints  no built-in “direction”  compare this to statement in programming language like C++ u=Mult(C,w) 9 5 32 y x C F v w u u=Mult(v,x) F=Add(v,y)

slide-20
SLIDE 20

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  182

Completeness of Consistency Filtering

Theoretical Results  [Freuder 78]: k-consistency does in general not guarantee existence of solutions  [Dechter-Pearl 88]: arc consistency sufficient for tree-structured constraint graphs ADD ADD y x z x = 1 z = 5 y = ?

slide-21
SLIDE 21

Model-Based Systems & Qualitative Reasoning Group of the Technical University of Munich

WS 11/12 EMDS 3  183

References

 [Dechter 03] “Constraint Processing”, Morgan Kaufmann, 2003

  • http://www.aispace.org/index.shtml