Algorithms for Reasoning with graphical models Class2: Constraint Networks Rina Dechter Dbook: chapter 2-3, Constraint book: chapters 2 and 4 class2 276 2018
Text Books class2 276 2018
Road Map Graphical models Constraint networks Model Inference Variable elimination for Constraints Variable elimination for CNFs Variable elimination for Linear Inequalities Constraint propagation Search Probabilistic Networks class2 276 2018
Road Map Graphical models Constraint networks Model Inference Variable elimination for Constraints Variable elimination for CNFs Variable elimination for Linear Inequalities Constraint propagation Search Probabilistic Networks class2 276 2018
Road Map Graphical models Constraint networks Model Inference Variable elimination for Constraints Variable elimination for CNFs Variable elimination for Linear Inequalities Constraint propagation Search Probabilistic Networks class2 276 2018
Sudoku – Approximation: Constraint Propagation • Variables: empty slots • Constraint • Domains = • Propagation {1,2,3,4,5,6,7,8,9} • Constraints: • Inference • 27 all-different 2 3 2 4 6 Each row, column and major block must be alldifferent “Well posed” if it has unique solution: 27 constraints class2 276 2018
Sudoku Each row, column and major block must be alldifferent “Well posed” if it has unique solution class2 276 2018
Constraint Const aint Netw Networ orks ks A Example: map coloring Variables - countries (A,B,C,etc.) Values - colors (red, green, blue) Constraints: , A B, A D, D E etc. Constraint graph A E A B A E red green D red yellow D green red B F B green yellow F yellow green G yellow red C G C class2 276 2018
Constraint Satisfaction Tasks Example: map coloring E… A B C D Variables - countries (A,B,C,etc.) Values - colors (e.g., red, green, yellow) green green blue red red Constraints: , A B, A D, D E etc. green blue green blue red … … … … green Are the constraints consistent? … … … … red Find a solution, find all solutions green red blue red red Count all solutions Find a good (optimal) solution class2 276 2018
Constraint Network A constraint network is: R= (X,D,C) X variables X { ,..., } X X 1 n { ,..., }, { ,... } D domain D D D D v v 1 1 n i k C constraints { ,... } C C C 1 t ( , ) C S R i i i R expresses allowed tuples over scopes A solution is an assignment to all variables that satisfies all constraints (join of all relations). Tasks: consistency?, one or all solutions, counting, optimization class2 276 2018
Crossword Puzzle Variables: x 1 , …, x 13 Domains: letters Constraints: words from {HOSES, LASER, SHEET, SNAIL, STEER, ALSO, EARN, HIKE, IRON, SAME, EAT, LET, RUN, SUN, TEN, YES, BE, IT, NO, US} class2 276 2018
Crossword Puzzle I class2 276 2018
The Queen Problem The network has four variables, all with domains D i = {1, 2, 3, 4} . (a) The labeled chess board. (b) The constraints between variables. class2 276 2018
The Queen Problem The network has four variables, all with domains D i = {1, 2, 3, 4} . (a) The labeled chess board. (b) The constraints between variables. class2 276 2018
Varieties of Constraints Unary constraints involve a single variable, e.g., SA ≠ green Binary constraints involve pairs of variables, e.g., SA ≠ WA Higher-order constraints involve 3 or more variables, e.g., cryptarithmetic column constraints class2 276 2018
Constraint’s Representations X Y Z Relation: allowed tuples 1 3 2 2 1 3 Algebraic expression: 2 10 , X Y X Y ) Propositional formula: ( a b c Semantics: by a relation class2 276 2018
Partial Solutions Not all consistent instantiations are part of a solution: (a) A consistent instantiation that is not part of a solution. (b) The placement of the queens corresponding to the solution (2, 4, 1, 3). (c) The placement of the queens corresponding to the solution (3, 1, 4, 2). class2 276 2018
Constraint Graphs: Primal, dual and hypergraphs When variables are squares: A (primal) constraint graph: a node per variable arcs connect constrained variables. A dual constraint graph : a node per constraint’s scope, an arc connect nodes sharing variables =hypergraph class2 276 2018
Graph Concepts class2 276 2018
Propositional Satisfiability = {(¬C), (A v B v C), (¬A v B v E), (¬B v C v D)}. class2 276 2018
Example: Radio Link Assignment cost f f i j Given a telecommunication network (where each communication link has various antenas) , assign a frequency to each antenna in such a way that all antennas may operate together without noticeable interference. Encoding? Variables: one for each antenna Domains: the set of available frequencies Constraints: the ones referring to the antennas in the same communication link class2 276 2018
Constraint graphs of 3 instances of the Radio frequency assignment problem in CELAR’s benchmark class2 276 2018
Operations With Relations Intersection Union Difference Selection Projection Join Composition class2 276 2018
Local Functions f Combination g Join : x 1 x 2 x 2 x 3 x 1 x 2 x 3 a a a a a a a a a b b b a b b b a b a f g Logical AND: x 1 x 2 x 3 h true a a a f g x 1 x 2 x 2 x 3 true a a b a a true a a true false a b a a b false a b true false a b b b a false b a true false b a a false b a b b b true b b false true b b a false b b b class2 276 2018
Example of Selection, Projection and Join class2 276 2018
Global View of the Problem C 1 C 2 Global View x 1 x 2 x 2 x 3 x 1 x 2 x 3 a a a a a a a a a b b b a b b b a b a What about counting? x 1 x 2 x 3 h x 1 x 2 x 3 h true 1 a a a a a a TASK true 1 a a b a a b false 0 a b a a b a false 0 a b b a b b true is 1 false 0 b a a b a a false is 0 false 0 b a b b a b logical AND? true 1 b b a b b a false 0 b b b b b b class2 276 2018 Number of true tuples Sum over all the tuples
The minimal network, An extreme case of re-parameterization class2 276 2018
The N-queens Constraint Network The network has four variables, all with domains Di = {1, 2, 3, 4}. (a) The labeled chess board. (b) The constraints between variables. Solutions are: (2,4,1,3) (3,1,4,2) class2 276 2018
Figure 2.11: The 4-queens constraint network: (a) The constraint graph. (b) The minimal binary constraints. (c) The minimal unary constraints (the domains). Solutions are: (2,4,1,3) (3,1,4,2) class2 276 2018
The Minimal Network The minimal network is perfectly explicit for binary and unary constraints: Every pair of values permitted by the minimal constraint is in a solution. class2 276 2018
Road Map Graphical models Constraint networks Model Inference Variable elimination for Constraints Variable elimination for CNFs Variable elimination for Linear Inequalities Constraint propagation Search Probabilistic Networks class2 276 2018
Bucket Elimination Adaptive Consistency (Dechter & Pearl, 1987) = = Bucket E: E D, E C Bucket D: D A D = C Bucket C: C B A C Bucket B: B A B = A Bucket A: contradiction * O(n exp(w )) Complexity : * w - induced width class2 276 2018
The Idea of Elimination { 1 , 2 } E { 1 , 2 , 3 } { 1 , 2 } D C B A { 1 , 2 } { 1 , 2 } eliminating E C R DBC D 3 value assignment B R R R R DBC ED EB EC DBC Eliminate variable E join and project class2 276 2018
Bucket-Elimination E ( ) : E D, E C, E B Bucket E D { 1 , 2 } || R DCB ( ) : D A Bucket D E C || R ACB ( ) : C B Bucket C { 1 , 2 , 3 } { 1 , 2 } || R AB ( ) : B A Bucket B D C B R A ( ) : Bucket A A B A ( ) : A D, A B Bucket A A { 1 , 2 } { 1 , 2 } || R DB ( ) : D E Bucket D D ( ) : C B , C E Bucket C || R D R C BE , C ( ) : B E Bucket B BE || R E ( ) : Bucket E B E * O(n exp(w (d))) , Complexity : * w (d) - induced width along ordering d class2 276 2018
The Induced-Width Width along d , w(d): max # of previous parents Induced width w*(d): The width in the ordered induced graph Induced-width w*: Smallest induced-width over all orderings Finding w* NP-complete (Arnborg, 1985) but greedy heuristics (min-fill). class2 276 2018
Recommend
More recommend