CompSci 275, C ONSTRAINT Networks Rina Dechter, Fall 2020 Introduction, the constraint network model Chapters 1-2 Fall 2020 1
Class information • Instructor: Rina Dechter • Lectures: Monday & Wednesday • Time: 3:30 ‐ 4:50 pm • Class page: https://www.ics.uci.edu/~dechter/courses/ics ‐ 275/fall ‐ 2020/ Fall 2020 2
Text book (required ) Rina Dechter, Constraint Processing , Morgan Kaufmann Fall 2020 3
Outline Motivation, applications, history CSP: Definition, and simple modeling examples Mathematical concepts (relations, graphs) Representing constraints Constraint graphs The binary Constraint Networks properties Fall 2020 4
Outline Motivation, applications, history CSP: Definition, representation and simple modeling examples Mathematical concepts (relations, graphs) Representing constraints Constraint graphs The binary Constraint Networks properties Fall 2020 5
Combinatorial problems Graphical Models Combinatorial Problems Those problems that can be expressed as: MO Optimization A set of variables Optimization Each variable takes its values from a Graphical Decision finite set of domain values Models A set of local functions Main advantage: They provide unifying algorithms: o Search o Complete Inference o Incomplete Inference Fall 2020 6
Combinatorial problems Many Examples Combinatorial Problems MO Optimization Optimization Graphical Decision Models Bayesian Networks EOS Scheduling x 1 x 2 x 3 x 4 Graph Coloring Timetabling … and many others. Fall 2020 7
Example: student course selection • Context : You are a senior in college • Problem : You need to register in 4 courses for the Spring semester • Possibilities : Many courses offered in Math, CSE, EE, CBA, etc. • Constraints : restrict the choices you can make – Courses have prerequisites you have/don't have Courses/instructors you like/dislike – Courses are scheduled at the same time – In CE: 4 courses from 5 tracks such that at least 3 tracks are covered • You have choices, but are restricted by constraints – Make the right decisions!! – ICS Graduate program Fall 2020 8
Student course selection (continued) • Given – A set of variables: 4 courses at your college – For each variable, a set of choices (values): the available classes. – A set of constraints that restrict the combinations of values the variables can take at the same time • Questions – Does a solution exist? (classical decision problem) – How many solutions exists? (counting) – How two or more solutions differ? – Which solution is preferable? – etc. Fall 2020 9
The field of constraint programming • How did it start: – Artificial Intelligence (vision) – Programming Languages (Logic Programming), – Databases (deductive, relational) – Logic ‐ based languages (propositional logic) – SATisfiability • Related areas: – Hardware and software verification – Operation Research (Integer Programming) – Answer set programming • Graphical Models; deterministic Fall 2020 10
Scene labeling constraint network Fall 2020 11
Scene labeling constraint network Fall 2020 12
3-dimentional interpretation of 2-dimentional drawings Fall 2020 13
The field of constraint programming • How did it start: – Artificial Intelligence (vision) – Programming Languages (Logic Programming), – Databases (deductive, relational) – Logic ‐ based languages (propositional logic) – SATisfiability • Related areas: – Hardware and software verification – Operations Research (Integer Programming) – Answer set programming • Graphical Models; deterministic Fall 2020 14
Applications Bayesian Networks • Radio resource management (RRM) EOS Scheduling • Databases (computing joins, view updates) x 1 • Temporal and spatial reasoning x 2 • Planning, scheduling, resource allocation x 3 x 4 • Design and configuration Graph Coloring Timetabling • Graphics, visualization, interfaces … and many others. • Hardware verification and software engineering • HC Interaction and decision support • Molecular biology • Robotics, machine vision and computational linguistics • Transportation • Qualitative and diagnostic reasoning Fall 2020 15
Outline Motivation, applications, history CSP: Definitions and simple modeling examples Mathematical concepts (relations, graphs) Representing constraints Constraint graphs The binary Constraint Networks properties Fall 2020 16
Constraint networks 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 green red D B F green yellow F B yellow green G yellow red C G C Fall 2020 17
Constraint satisfaction tasks Example: map coloring A B C D E… Variables - countries (A,B,C,etc.) Values - colors (e.g., red, green, yellow) red green red green blue Constraints: A B, A D, D E , etc. red blue green green blue … … … … green Are the constraints consistent? … … … … red Find a solution, find all solutions red blue red green red Count all solutions Find a good solution Fall 2020 18
Information as constraints • I have to finish my class in 50 minutes • 180 degrees in a triangle • Memory in our computer is limited • The four nucleotides that makes up a DNA only combine in a particular sequence • Sentences in English must obey the rules of syntax • Susan cannot be married to both John and Bill • Alexander the Great died in 333 B.C. Fall 2020 19
Constraint network; definition • A constraint network is: R = (X,D,C) – X variables X { X ,..., X } 1 n – D domain D { D ,..., D }, D { v ,... v } 1 n i 1 k – C constraints C { C ,... C }, , , C ( S , R ) 1 t 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 Fall 2020 20
The N-queens problem The network has four variables, all with domains 𝑬 𝒋 = {1, 2, 3, 4}. (a) The labeled chess board. (b) The constraints between variables. Fall 2020 21
A solution and a partial consistent tuple (configuration) 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). Fall 2020 22
Example: 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} Fall 2020 23
Example: Sudoku (constraint propagation) • Variables: 81 slots • Domains = {1,2,3,4,5,6,7,8,9} • Constraints: • 27 not-equal Constraint propagation 2 3 2 4 6 Each row, column and major block must be alldifferent “Well posed” if it has unique solution: 27 constraints Fall 2020 26
Sudoku (inference) Each row, column and major block must be alldifferent “Well posed” if it has unique solution Fall 2020 27
Outline Motivation, applications, history CSP: Definition, representation and simple modeling examples Mathematical concepts (relations, graphs) Representing constraints Constraint graphs The binary Constraint Networks properties Fall 2020 28
Mathematical background • Sets, domains, tuples • Relations • Operations on relations • Graphs • Complexity Fall 2020 29
Two Representations of a relation: R = {(black, coffee), (black, tea), (green, tea)}. Variables: Drink, color Fall 2020 30
Two Representations of a relation: R = {(black, coffee), (black, tea), (green, tea)}. Variables: Drink, color Fall 2020 31
Examples Fall 2020 32
Operations with relations • Intersection • Union • Difference • Selection • Projection • Join • Composition Fall 2020 33
Relations are local functions • Relations are special case of a Local function f : D A i x Y i where scope( f ) = Y X : scope of function f A : is a set of valuations • In constraint networks: functions are boolean f x 1 x 2 x 1 x 2 relation a a true a a a b false b b b a false b b true Fall 2020 34
Set operations: intersection, union, difference on relations. Fall 2020 35
Selection, projection, join Fall 2020 36
The join and the logical “and” • 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 Fall 2020 37
Recommend
More recommend