Foundations of Constraint Processing

Slides:



Advertisements
Similar presentations
Foundations of Constraint Processing Temporal Constraints Networks 1Topic Foundations of Constraint Processing CSCE421/821, Spring
Advertisements

Interactive Configuration
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Foundations of Constraint Processing, Fall 2005 October 21, 2005CSPs and Relational DBs1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Constraint Reasoning Florida Institute of Technology Computer Science.
Themes of Presentations Rule-based systems/expert systems (Catie) Software Engineering (Khansiri) Fuzzy Logic (Mark) Configuration Systems (Sudhan) *
Combinatorial Algorithms Unate Covering Binate Covering Graph Coloring Maximum Clique.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Foundations of Constraint Processing, Spring 2008 Jan 14, 2008 Overview 11 Foundations of Constraint Processing CSCE421/821, Spring 2008:
Solving Constraint Satisfaction Problems (CSPs) using Search CPSC 322 – CSP 2 Textbook § January 31, 2011.
Solving Constraint Satisfaction Problems (CSPs) using Search
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Foundations of Constraint Processing, CSCE421/821 Overview 11 CSCE421/821, Fall Questions: Piazza Berthe Y.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
G51IAI Introduction to Artificial Intelligence
28.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Problem Solving with Constraints CSPs and Relational DBs1 Problem Solving with Constraints CSCE496/896, Fall
Foundations of Constraint Processing, CSCE421/821 Overview 11 CSCE421/821, Fall Questions: Piazza Berthe Y.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Modelling and Solving Configuration Problems on Business
Constraint Satisfaction Problems (CSPs) Introduction
P & NP.
Chapter 10 NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
Consistency Methods for Temporal Reasoning
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Richard Anderson Lecture 26 NP-Completeness
Constraint Satisfaction Problems (CSPs) Introduction
Constraint Satisfaction 101
Berthe Y. Choueiry (Shu-we-ri)
Rationale & Strategies Foundations of Constraint Processing
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Berthe Y. Choueiry (Shu-we-ri)
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
CSPs and Relational DBs
Electrical and Computer Engineering Department
Problem Solving with Constraints
Chapter 8 NP and Computational Intractability
Rationale & Strategies Foundations of Constraint Processing
NP-Complete Problems.
Berthe Y. Choueiry (Shu-we-ri)
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
Rationale & Strategies Foundations of Constraint Processing
Odds and Ends Modeling Examples & Graphical Representations
Problem Solving with Constraints
Problem Solving with Constraints
Foundations of Constraint Processing
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Our old list of problems
Constraint Satisfaction Problems
Consistency algorithms
Presentation transcript:

Foundations of Constraint Processing CSCE421/821, Fall 2003: www.cse.unl.edu/~choueiry/F03-421-821/ Berthe Y. Choueiry (Shu-we-ri) Ferguson Hall, Room 104 choueiry@cse.unl.edu Tel: +1(402)472-5444 12/3/2018 Lecture slides 1

Constraint Satisfaction 101 Motivating example, application areas Application examples Definition, representation, & formal characterization Solving techniques Issues & research directions 12/3/2018 Lecture slides 1

What is this about? 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 Unary: Courses have prerequisites you have/don't have Courses/instructors you like/dislike Binary: Courses are scheduled at the same time n-ary: In CE: 4 courses from 5 tracks such as at least 3 tracks are covered You have choices, but are restricted by constraints Make the right decisions!! 12/3/2018 Lecture slides 1

Practical Applications Adapted from E.C. Freuder Radio resource management (RRM) Databases (computing joins, view updates) Temporal and spatial reasoning Planning, scheduling, resource allocation Design and configuration Graphics, visualization, interfaces Hardware verification and software engineering HC Interaction and decision support Molecular biology Robotics, machine vision and computational linguistics Transportation Qualitative and diagnostic reasoning 12/3/2018 Lecture slides 1

Constraint Satisfaction Given A set of variables: 4 courses at UNL For each variable, a set of choices (values) 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 two or more solutions differ? How to change specific choices without perturbing the solution? If there is no solution, what are the sources of conflicts? Which constraints should be retracted? etc. 12/3/2018 Lecture slides 1

Constraint Processing is about ... Solving a decision problem ….. …. while allowing the user to state arbitrary constraints in an expressive way and Providing concise and high-level feedback about alternatives and conflicts Power of Constraints Processing Flexibility & expressiveness of representations Interactivity, users can constraints Related areas: AI, OR, Algorithmic, DB, TCS, Prog. Languages, etc. relax reinforce 12/3/2018 Lecture slides 1

CSP: Definition Given P = (V, D, C ) V is a set of variables, D is a set f variable domains (domain values) C is a set of constraints, Query: can we find one value for each variable such that all constraints are satisfied? In general, a CSP is NP-complete 12/3/2018 Lecture slides 1

Representation I Given P = (V, D, C ), where Find a consistent assignment for variables Constraint Graph Variable   node (vertex) Domain  node label Constraint  arc (edge) between nodes 12/3/2018 Lecture slides 1

Representation II Given P = (V, D, C ), where Example I: Define C ? {1, 2, 3, 4} { 3, 5, 7 } { 3, 4, 9 } { 3, 6, 7 } v2 > v4 V4 V2 v1+v3 < 9 V3 V1 v2 < v3 v1 < v2 12/3/2018 Lecture slides 1

Example II: Temporal reasoning Give one solution: ……. Satisfaction, yes/no: decision problem 12/3/2018 Lecture slides 1

Constraint Arity (I) Given P = (V, D, C ) , where {1, 2, 3, 4} { 3, 5, 7 } { 3, 4, 9 } { 3, 6, 7 } v2 > v4 V4 V2 v1+v3 < 9 V3 V1 v2 < v3 v1 < v2 How to represent the constraint V1 + V2 + V4 < 10 ? 12/3/2018 Lecture slides 1

Constraint Arity (II) Given P = (V, D, C ) , where Constraints: universal, unary, binary, ternary, … , global. A Constraint Network: 12/3/2018 Lecture slides 1

Example III: Map coloring Using 3 colors (R, G, & B), color the US map such that no two adjacent states have the same color Variables? Domains? Constraints? 12/3/2018 Lecture slides 1

Example III: Map coloring Using 3 colors (R, G, & B), color the US map such that no two adjacent states have the same color 12/3/2018 Lecture slides 1

Example IV: Resource Allocation What is the CSP formulation? { a, b, c } { a, b } { a, c, d } { b, c, d } 12/3/2018 Lecture slides 1

Example IV: Resource Allocation { a, b, c } { a, b } { a, c, d } { b, c, d } T1 Constraint Graph T4 { R1, R3 } T3 { R2, R4 } T6 T7 T5 { R1, R2, R3 }  Interval Order { R1, R3 } T1 { R1, R3 } T2 { R1, R3 } { R1, R3, R4 } T3 T4 T2 { R1, R2, R3 } T5 { R2, R4 } T6 { R2, R4 } T7 12/3/2018 Lecture slides 1

Example V: Puzzle Given: Four musicians: Fred, Ike, Mike, and Sal, play bass, drums, guitar and keyboard, not necessarily in that order. They have 4 successful songs, ‘Blue Sky,’ ‘Happy Song,’ ‘Gentle Rhythm,’ and ‘Nice Melody.’ Ike and Mike are, in one order or the other, the composer of ‘Nice Melody’ and the keyboardist. etc ... Query: Who plays which instrument and who composed which song? 12/3/2018 Lecture slides 1

Example V: Puzzle Formulation 1: Formulation 2: Variables: Bass, Drums, Guitar, Keyboard, Blue Sky, Happy Song Gentle Rhythm and Nice Melody. Domains: Fred, Ike, Mike, Sal Constraints: … Formulation 2: Variables: Fred's-instrument, Ike's-instrument, …, Fred's-song, Ikes's-song, Mike’s-song, …, etc. Domains: { bass, drums, guitar, keyboard } { Blue Sky, Happy Song, Gentle Rhythm, Nice Melody} 12/3/2018 Lecture slides 1

Example VI: Product Configuration Train, elevator, car, etc. Given: Components and their attributes (variables) Domain covered by each characteristic (values) Relations among the components (constraints) A set of required functionalities (more constraints) Find: a product configuration i.e., an acceptable combination of components that realizes the required functionalities 12/3/2018 Lecture slides 1

Constraint Types Example I: algebraic constraints Example II: of bounded difference Example III & IV: coloring, mutual exclusion, difference constraints Example V & VI: elements of C must be made explicit {1, 2, 3, 4} { 3, 5, 7 } { 3, 4, 9 } { 3, 6, 7 } v2 > v4 V4 V2 v1+v3 < 9 V3 V1 v2 < v3 v1 < v2 T1 Constraint Graph T4 { R1, R3 } T3 { R2, R4 } T6 T7 T5 { R1, R2, R3 }  12/3/2018 Lecture slides 1

Constraint Types (cont.) Example VII: Databases Join operation in relational DB is a CSP View materialization is a CSP Example VIII: Interactive systems Data-flow constraints Spreadsheets Graphical layout systems and animation Graphical user interfaces Example IX: Molecular biology (bioinformatics) Threading, etc. Advantages: Flexible, expressive, compact representation Related areas: AI, OR, Algorithmic, DB, Prog. Languages 12/3/2018 Lecture slides 1

Domain Types P = (V, D, C ) where Domains: Finite (discrete), enumeration works Continuous, sophisticated algebraic techniques are needed 12/3/2018 Lecture slides 1

Terminology Given: P = (V, D, C ) Query: Constraints: Find a solution Find all solutions Find number of solutions Can you extend a partial solution, etc. Constraints: Arity: universal, unary, binary, ternary, …, global Scope: set of variables to which the constraint applies Definition: intension, extension Implementation: predicate, set of tuples, binary matrix, etc. 12/3/2018 Lecture slides 1

Representation Macrostructure G(P): Micro-structure  (P): a, b a, c - constraint graph for binary constraints - constraint network for non-binary constraints Micro-structure  (P): Co-microstructure co-(P): a, b a, c b, c  V1 V2 (V1, a ) (V1, b) (V2, a ) (V2, c) (V3, b ) (V3, c) (V1, a ) (V1, b) (V2, a ) (V2, c) (V3, b ) (V3, c) no goods 12/3/2018 Lecture slides 1

Complexity of CSP Characterization: Proving NP-completeness: Decision problem In general, NP-complete by reduction from 3SAT. Proving NP-completeness: Given a problem 1 in NP, show that an known NP-complete problem 2 can be efficiently reduced to 1 Steps for proving NP-completeness: Show that 1 is in NP Select a known NP-complete problem 2 Construct a transformation f from 2 to 1 Prove that f is a polynomial transformation (check Chapter 3 of Garey & Johnson) What is SAT? 12/3/2018 Lecture slides 1

SAT? Given a sentence: Sentence: conjunction of clauses Clause: disjunction of literals Literal: a term or its negation Term: Boolean variable Question: Find an assignment of truth values to the Boolean variables such the sentence is satisfied. 12/3/2018 Lecture slides 1

Problem reduction Example: CSP into SAT (proves nothing, just an exercise) Notation: variable-value pair = vvp vvp  term V1 = {a, b, c, d} yields x1 = (V1, a), x2 = (V1, b), x3 = (V1, c), x4 = (V1, d), V2 = {a, b, c} yields x5 = (V2, a), x6 = (V2, b), x7 = (V2,c). The vvp’s of a variable  disjunction of terms V1 = {a, b, c, d} yields (Optional) At most one VVP per variable 12/3/2018 Lecture slides 1

CSP into SAT (cont.) Constraint: Way 1: Each inconsistent tuple  one disjunctive clause For example: how many? Way 2: Consistent tuple  conjunction of terms Each constraint  disjunction of these conjunctions  transform into conjunctive normal form (CNF) Question: find a truth assignment of the Boolean variables such that the sentence is satisfied 12/3/2018 Lecture slides 1