Class2: Constraint Networks Rina Dechter

Similar documents
Class2: Constraint Networks Rina Dechter

CONSTRAINT Networks Chapters 1-2

Class 2 Constraint Networks

Recitation 3 Problems

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems

Today. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 5. Constraint Satisfaction Problems (CSP) CSP Definition

Constraint Satisfaction Problems. Constraint Satisfaction Problems. Constraint networks. 1 Constraint Networks. 1 Constraint Networks

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018

Constraint Satisfaction Problems (CSPs)

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

Constraint Networks. Constraint networks. Definition. Normalized. Constraint Networks. Deduction. Constraint. Networks and Graphs. Solving.

Lecture 1. Introduction

Module 4. Constraint satisfaction problems. Version 2 CSE IIT, Kharagpur

What is Search For? CS 188: Artificial Intelligence. Constraint Satisfaction Problems

Constraint Satisfaction

Discussion Section Week 1

Constraint (Logic) Programming

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint satisfaction search

CS 188: Artificial Intelligence Fall 2011

Constraint Satisfaction Problems

Introduction. Bernhard Nebel, Julien Hué, and Stefan Wölfl. April 23, 2012

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Constraint Satisfaction Problems

CS 343: Artificial Intelligence

CSP- and SAT-based Inference Techniques Applied to Gnomine

Week 8: Constraint Satisfaction Problems

Constraint satisfaction search. Combinatorial optimization search.

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm

Outline. Best-first search

CSE 473: Artificial Intelligence

Constraint Satisfaction. AI Slides (5e) c Lin

Artificial Intelligence Constraint Satisfaction Problems

Map Colouring. Constraint Satisfaction. Map Colouring. Constraint Satisfaction

Announcements. Homework 1: Search. Project 1: Search. Midterm date and time has been set:

Constraint Satisfaction Problems. Chapter 6

Announcements. CS 188: Artificial Intelligence Fall 2010

CONSTRAINT SATISFACTION

Constraint Satisfaction Problems. Chapter 6

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012

Constraint satisfaction problems. CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

Constraint Satisfaction Problems (Backtracking Search)

CS 4100 // artificial intelligence

1. (15 points) Consider the crossword puzzle

CONSTRAINT SATISFACTION

1 Inference for Boolean theories

CONSTRAINT SATISFACTION

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint Satisfaction Problems

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro

Outline. Best-first search

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search

Artificial Intelligence

Constraint Satisfaction Problems Part 2

Constraint Satisfaction Problems

Solving Problems by Searching: Constraint Satisfaction Problems

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

Constraint Satisfaction

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Constraint Satisfaction. CS 486/686: Introduction to Artificial Intelligence

Constraints. CSC 411: AI Fall NC State University 1 / 53. Constraints

Artificial Intelligence

Lecture 6: Constraint Satisfaction Problems (CSPs)

constraint propagation, answer set programming CS 4100/5100 Foundations of AI

Constraint Satisfaction Problems (CSP)

ARTIFICIAL INTELLIGENCE (CS 370D)

Constraint Satisfaction Problems (CSPs) Lecture 4 - Features and Constraints. CSPs as Graph searching problems. Example Domains. Dual Representations

Acyclic Network. Tree Based Clustering. Tree Decomposition Methods

Constraint Satisfaction Problems. Some material from: D Lin, J You, JC Latombe

Informed (heuristic) search (cont). Constraint-satisfaction search.

Chapter 6 Constraint Satisfaction Problems

Processing Probabilistic and Deterministic Graphical Models. Rina Dechter DRAFT

Integrating Probabilistic Reasoning with Constraint Satisfaction

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic.

Chapter 3: Finite Constraint Domains

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17

Constraint Satisfaction Problems

Summary. Acyclic Networks Join Tree Clustering. Tree Decomposition Methods. Acyclic Network. Tree Based Clustering. Tree Decomposition.

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability.

CS 188: Artificial Intelligence Fall 2008

Hack Your Language! CSE401 Winter 2016 Introduction to Compiler Construction

Constraint Satisfaction Problems (CSPs)

Moving to a different formalism... SEND + MORE MONEY

Unifying and extending hybrid tractable classes of CSPs

Example: Map coloring

Acyclic Network. Tree Based Clustering. Tree Decomposition Methods

Constraint Satisfaction Problems

CS W4701 Artificial Intelligence

{SETS} A LIGHTWEIGHT CONSTRAINT PROGRAMMING LANGUAGE BASED ON ROBDDS

Constraint Satisfaction Problems

Foundations of Artificial Intelligence

CS 188: Artificial Intelligence. Recap: Search

Transcription:

Algorithms for Reasoning with graphical models Class2: Constraint Networks Rina Dechter dechter1: chapters 2-3, Dechter2: Constraint book: chapters 2 and 4

Text Books

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

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

Text Book (not required) Rina Dechter, Constraint Processing, Morgan Kaufmann

Sudoku Approximation: Constraint Propagation Constraint Propagation Inference Variables: empty slots Domains = {1,2,3,4,5,6,7,8,9} Constraints: 27 all-different 2 3 42 6 Each row, column and major block must be alldifferent Well posed if it has unique solution: 27 constraints

Sudoku Alternative formulations: Variables? Domains? Constraints? Each row, column and major block must be alldifferent Well posed if it has unique solution

Constraint Networks Example: map coloring Variables - countries (A,B,C,etc.) Values - colors (red, green, blue) Constraints: A B, A D, D E, etc. A Constraint graph A red red green green yellow yellow B green yellow red yellow green red A B C D G E F B A D E G F C

Constraint Satisfaction Tasks Example: map coloring Variables - countries (A,B,C,etc.) Values - colors (e.g., red, green, yellow) Constraints: A B, A D, D E, etc. A B C D E red green red green blue red blue green green blue Are the constraints consistent? Find a solution, find all solutions Count all solutions green red red blue red green red Find a good (optimal) solution

Constraint Network A constraint network is: R=(X,D,C) X variables D domain C constraints X { X 1,..., X n } D { D1,..., Dn}, Di { v1,... vk} C { C 1,... C } C i ( S i, R ) i t 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

Crossword Puzzle Formulation? 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}

Crossword Puzzle

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.

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.

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

Constraint s Representations Relation: allowed tuples Algebraic expression: X X Y Z 1 3 2 2 1 3 2 Y 10, X Y Propositional formula: ( a b) c Semantics: by a relation

Partial Solutions Not all partial consistent instantiations are part of a solution: (a) A partial 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).

Constraint Graphs: Primal, dual and hypergraphs CSP: When defining variables as 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 9 1 3 12 2 4 5 6 7 11 8 10 1,2,3,4,5 3 3,6,9,12 5 9 5,7,11 11 8,9,10,11 12 10 12,13 13 10,13 Primal graph? Dual graph? 13 (a) (b)

Constraint Graphs (primal) When variables are words Queen problem

Graph Concepts

Graph Concepts Reviews: Hyper Graphs and Dual Graphs A hypergraph Primal graphs Dual graph Factor graphs 21

Propositional Satisfiability = {( C), (A v B v C), ( A v B v E), ( B v C v D)}.

Example: Radio Link Assignment cost fi f 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

Constraint graphs of 3 instances of the Radio frequency assignment problem in CELAR s benchmark

Operations With Relations Intersection Union Difference Selection Projection Join Composition

Combination Local Functions f g Join : x 1 x 2 a a b b x 2 x 3 a a a b b a x 1 x 2 x 3 a a a a a b b b a Logical AND: x 1 x 2 f a a true a b false b a false b b true f g x 2 x 3 g a a true a b true b a true b b false x 1 x 2 x 3 h a a a true a a b true a b a false a b b false b a a false b a b false b b a true b b b false

Global View of the Problem C 1 C 2 Global View x 1 x 2 a a b b x 2 x 3 a a a b b a x 1 x 2 x 3 a a a a a b b b a Does the problem a solution? The problem has a solution if the global view is not empty TASK x 1 x 2 x 3 h a a a true a a b true a b a false a b b false b a a false b a b false b b a true b b b false The problem has a solution if there is some true tuple in the global view, the universal relation

Example of Selection, Projection and Join

Global View of the Problem C 1 C 2 Global View x 1 x 2 a a b b x 2 x 3 a a a b b a x 1 x 2 x 3 a a a a a b b b a What about counting? TASK x 1 x 2 x 3 h a a a true a a b true a b a false a b b false b a a false b a b false b b a true b b b false Number of true tuples true is 1 false is 0 logical AND? x 1 x 2 x 3 h a a a 1 a a b 1 a b a 0 a b b 0 b a a 0 b a b 0 b b a 1 b b b 0 Sum over all the tuples

Numeric constraints Examples V1 {1, 2, 3, 4} v1+v3 < 9 V3 { 3, 4, 9 } v1 < v2 v2 < v3 { 3, 6, 7 } V2 v2 > v4 { 3, 5, 7 } V4 Can we specify numeric constraints as relations?

Numeric Constraints Given P = (V, D, C ), where V V 1, V2,, V n D D V, D, V, D 1 2 V n C C 1, C2,, C l Example I: V1 {1, 2, 3, 4} v1 < v2 { 3, 6, 7 } V2 v1+v3 < 9 v2 < v3 v2 > v4 Define C? V3 { 3, 4, 9 } { 3, 5, 7 } V4

The minimal network, An extreme case of re-parameterization Binary Constraint Networks

Properties of Binary Constraint Networks A graph to be colored by two colors, an equivalent representation having a newly inferred constraint between x1 and x3. Equivalence and deduction with constraints (composition) Winter 2016 33

Equivalence, Redundancy, Composition Equivalence: Two constraint networks are equivalent if they have the same set of solutions. Composition in relational operation R xz xz( Rxy Ryz ) Winter 2016 34

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)

The 4-queens constraint network 2 2 The minimal network The minimal domains Solutions are: (2,4,1,3) (3,1,4,2) Winter 2016 36

The 4-queen problem The constraint graph The minimal constraints The minimal domains Solutions are: (2,4,1,3) (3,1,4,2)

The 4-queens problem Solutions are: (2,4,1,3) (3,1,4,2)

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)

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.

The Projection Networks The projection network of a relation is obtained by projecting it onto each pair of its variables (yielding a binary network). Relation = {(1,1,2)(1,2,2)(1,2,1)} What is the projection network? What is the relationship between a relation and its projection network? {(1,1,2)(1,2,2)(2,1,3)(2,2,2)} are the solutions of its projection network? Winter 2016 41

Example: Sudoku What is the minimal network? The projection network? Variables: 81 slots Constraint propagation 2 3 42 6 Domains = {1,2,3,4,5,6,7,8,9} Constraints: 27 not-equal Each row, column and major block must be alldifferent Well posed if it has unique solution: 27 constraints Winter 2016 42

Algorithms for Reasoning with graphical models Class3 Rina Dechter