Constraint Satisfaction Problems and Consistency Restoration Florent Launay Undergraduate student at FIT.

Slides:



Advertisements
Similar presentations
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Parts of Chapter 5 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
The Management Science Approach
Protein – Protein Interactions Lisa Chargualaf Simon Kanaan Keefe Roedersheimer Others: Dr. Izaguirre, Dr. Chen, Dr. Wuchty, ChengBang Huang.
Clustering Categorical Data The Case of Quran Verses
Constraint Satisfaction problems (CSP)
CompSci 102 Discrete Math for Computer Science April 19, 2012 Prof. Rodger Lecture adapted from Bruce Maggs/Lecture developed at Carnegie Mellon, primarily.
The Simplex Method: Standard Maximization Problems
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) February, 6, 2009.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
NP-Complete Problems Problems in Computer Science are classified into
Complexity (Running Time)
Chapter 5 Outline Formal definition of CSP CSP Examples
Sebastian Bitzer Seminar Constraint Logic Programming University of Osnabrueck November 11 th 2002 The Simplex Algorithm.
1 The Greedy Method CSC401 – Analysis of Algorithms Lecture Notes 10 The Greedy Method Objectives Introduce the Greedy Method Use the greedy method to.
Constraint Satisfaction Not all problems are solved by a sequential series of steps. How do we solve other types of problems?
Mental Math Computation. Multiply Mentally 84 × 25 What strategy did you use? Why did we choose 84 × 25 instead of 85 × 25?
Solving a System of Equations using Multiplication
Create a Crossword. You should have 24 personal vocabulary words from your reading of Chew on This. You will use at least 20 of them to make a crossword.
Types of Graphs Creating a Graph With Microsoft Excel.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Duality Theory LI Xiaolei.
This presentation shows how the tableau method is used to solve a simple linear programming problem in two variables: Maximising subject to two  constraints.
Topic III The Simplex Method Setting up the Method Tabular Form Chapter(s): 4.
1. Definition and General Structure 2. Small Example 1 3. Simplified Structure 4. Short Additional Examples 5. Full Example 2 6. Common Error The for loop.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Systems of Equations and Inequalities Systems of Linear Equations: Substitution and Elimination Matrices Determinants Systems of Non-linear Equations Systems.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Linear Programming Solving Systems of Equations with 3 Variables Inverses & Determinants of Matrices Cramer’s Rule.
Integers M7N1a, M7N1c Mrs. Sims’ World. What are Integers? We have learned to count by using the numbers 0, 1, 2, 3, 4, 5….. These are called whole numbers.
1.5 Solving Inequalities Remember the rules of solving inequalities.
Data Structures & Algorithms
Chapter 5 Constraint Satisfaction Problems
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves.
Chapter 5 Linked List by Before you learn Linked List 3 rd level of Data Structures Intermediate Level of Understanding for C++ Please.
Arc Consistency and Domain Splitting in CSPs CPSC 322 – CSP 3 Textbook Poole and Mackworth: § 4.5 and 4.6 Lecturer: Alan Mackworth October 3, 2012.
Great Theoretical Ideas in Computer Science for Some.
CS 171: Intro to AI Discussion Week 2 Jan 15 th 2016.
Introduction to Algebra. What do you think of when you hear “algebra”?
1 Chapter 3, Section 2 Solving Systems of Equations Algebraically.
 Problem Analysis  Coding  Debugging  Testing.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Chap 10. Sensitivity Analysis
ALGORITHMS part-1.
Containers and Lists CIS 40 – Introduction to Programming in Python
Python Programming: An Introduction to Computer Science
GC211Data Structure Lecture2 Sara Alhajjam.
Excel Solver.
Computer Science cpsc322, Lecture 14
Introduction to the C Language
Well, just how many basic
Algorithm Discovery and Design
Introduction to Algorithms and Programming
How would you use your calculator to solve 52?
at Glasgow (and Strathclyde till mid April)
How would you use your calculator to solve 52?
Discrete Mathematics for Computer Science
you get to solve puzzles!
Implementation of Learning Systems
Problem Solving With Simultaneous Equations
Presentation transcript:

Constraint Satisfaction Problems and Consistency Restoration Florent Launay Undergraduate student at FIT

Summary Focused interest in time point-sequencing problem. Focused interest in time point-sequencing problem. What are CSP’s ? What are CSP’s ? Crossword Problem. Crossword Problem. Dealing with consistency. Dealing with consistency. 1. Finding and storing consistent relations 1. Finding and storing consistent relations 2. Finding a “minimal set to remove inconsistency” 2. Finding a “minimal set to remove inconsistency” Linking the algorithms Linking the algorithms Questions, comments. Questions, comments. The Program The Program

Focus interest Relation from {, =, <>, =, } P1P2P3 Here, we can see that some constraints between the set of points {P1, P2, P3} exist : P1 < P2 P2 < P3

What are CSP’s ? Constraints Constraints X >= 5X <> 9X < 12

What are CSP’s ? Example : Example : Common names from English vocabulary beginning with a ‘c’, ending with a ‘t’, but that doesn’t contain any ‘e’… Valid set : {‘count’, ‘cart’, ‘chat’, ‘court’, …}

What are CSP’s ? Valid regions and ‘Box’ Valid regions and ‘Box’ 5912 X >= 5X <> 9X < 12 Valid regions = {[5,5], [5,9], [9,12]} X < 15X > 3 153

What are CSP’s ? Inconsistencies Inconsistencies 5912 X >= 5X <> 9X < 12X > No valid region => The system is inconsistent

The crossword problem Constraints Valid Set Inconsistency Definition, Size of the world, across or down, eventual existing letters. Definition 13 : Part of the human body, beginning with an ‘H’ (ambiguous) E A D ?A N D ?A I RH O W Definition 14 : Negation {[HEAD], [HAND], [HAIR]} NOTNOT A N D

Dealing with consistency Within a set of relations, some relation can conflict with other relations in a system, making the whole system inconsistent. Within a set of relations, some relation can conflict with other relations in a system, making the whole system inconsistent. Let’s have a look to the following example.

A simple example Let s consider a point P1 on a time line basis :

A simple example Valid region P2 P2>P1 P3 P2 P1 No valid region can be found for P3 !!!

Dealing with consistency With that kind of inconsistency, two interesting questions arise: With that kind of inconsistency, two interesting questions arise: Which are the relations that make the system inconsistent ? Which are the relations that make the system inconsistent ? What would be a minimal set to remove to make the system consistent ? What would be a minimal set to remove to make the system consistent ?

1. Finding and storing inconsistent relations System of relations Consistent YES NO Finish Store inconsistent relations Finish (Call the 2nd algorithm)

Inconsistent relations FIND MULTIPLE EQUALITY FIND MULTIPLE EQUALITY =>Store inconsistent relations VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY =>Store inconsistent relations FIND THE BOX: PRE-PROCESSING FIND THE BOX: PRE-PROCESSING =>Store inconsistent relations FIND VALID REGIONS FIND VALID REGIONS =>If no inconsistency has been found

Inconsistent relations FIND MULTIPLE EQUALITY FIND MULTIPLE EQUALITY P2P1P3P4P5P6 If Pnew = P3 Pnew And Pnew = P6 The system is inconsistent since P3<>P6

Inconsistent relations VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY P2P1P3P4P5P6 Pnew If Pnew = P3 And Pnew < P2 The system is inconsistent

Inconsistent relations FIND THE BOX: PRE-PROCESSING FIND THE BOX: PRE-PROCESSING P2P1P3P4P5P6 If If we found that a valid region for Pnew was {[P3,P4], [P4,P5]} Then, no other relation should forbid that : ex Pnew > P6, Or the system becomes inconsistent

Inconsistent relations FIND VALID REGIONS FIND VALID REGIONS =>If no inconsistency has been found P2P1P3P4P5P6 A valid region region could be : {[P2,P3], [P3,P3], [P3,P4], [P4,P5], [P5,P5], [P5,P6]} {[P2,P3], [P3,P3], [P3,P4], [P4,P5], [P5,P5], [P5,P6]}

Inconsistent relations End of the first algorithm…

2. Finding a minimal set to remove to make the system consistent SET OF RELATIONS MAKING THE SYSTEM INCONSISTENT Algorithm MINIMUM SET OF RELATIONS MAKING THE SYSTEM INCONSISTENT MAXIXMUM SET OF CONSISTENT RELATIONS

2. Finding a minimal set to remove to make the system consistent This short algorithm finds a minimal set. We will illustrate this with an other example. But first, we have to introduce the notion of “degree of inconsistency”.

Degree of inconsistency Here, if we want to add a new point Pnew such that: Pnew P5 Pnew P6 Pnew < P3, Pnew < P4, P2P1P3P4P5P6

Degree of inconsistency From here, we can see that : Pnew P5 Pnew P5 Pnew P6Pnew P6 Pnew P5Pnew P5 Pnew P6Pnew P6 P2P1P3P4P5P6

Questions before we move to the Algorithm ? Questions before we move to the Algorithm ?

Algorithm Var: Var: S = set of all relations making the system inconsistent n S = number of relations in S R = Temporary relation with highest degree of inconsistency in S m R = degree of inconsistency of R I = a set of minimal relation to remove in order to make the system consistent

Algorithm Initialize I to be empty; Initialize I to be empty; While (n S != 0) { * Find the relation R with highest inconsistent degree m; * n S = n S – m R ; * Remove 1 from every inconsistent degree from every relation conflicting with R; * Record R in I; * Remove every inconsistent relation conflicting with R from S; * Remove R from S; }

Example Let us consider the last example. Here are the variables of the algorithm. Let us consider the last example. Here are the variables of the algorithm. S= {P1,P2, P3, P4, P5, P6} 2 Pinc P5 4 2 Pinc P5 4 2Pinc P6 4 2 Pinc P6 4 2Pinc P5 4 2 Pinc P5 4 2Pinc P6 4 2 Pinc P6 4 2 Pinc P5 4 2 Pinc P5 4 2 Pinc P6 4 2 Pinc P6 4 n S = 8 R = {} m R = 0 I = {} S S n S relations Degree of inconsistency

Example One relation with highest inconsistency degree is : One relation with highest inconsistency degree is : Pinc > P5. S= {P1,P2, P3, P4, P5, P6} 2 Pinc P5 4 2 Pinc P5 4 2Pinc P6 4 2 Pinc P6 4 2Pinc P5 4 2 Pinc P5 4 2Pinc P6 4 2 Pinc P6 4 2 Pinc P5 4 2 Pinc P5 4 2 Pinc P6 4 2 Pinc P6 4 n S = 8 R = {} m R = 0 I = {} S 8 – 4 = 4 {Pinc>P5} 4 {Pinc>P5} Find the relation R with highest inconsistency degreen S = n S – m R Remove 1 from every inconsistent degree from every relation conflicting with R Record R in IRemove every inconsistent relation conflicting with R from SRemove R from S

Example The variables are now : The variables are now : S= {P1,P2, P3, P4, P6} 1Pinc P6 4 1 Pinc P6 4 n S = 4 R = {Pinc>P5} m R = 4 I = {Pinc>P5} S The relation with highest inconsistency degree is now Pinc>P6. 4 {Pinc>P6} 4 – 4 = 0 {Pinc>P5, Pinc>P6} n = 0, the system is now consistent, and a minimal set to remove is found : I = {Pinc>P5, Pinc>P6} is found : I = {Pinc>P5, Pinc>P6} Find the relation R with highest inconsistency degree n S = n S – m R Remove 1 from every inconsistent degree from every relation conflicting with R Record R in IRemove every inconsistent relation conflicting with R from SRemove R from S

Linking the algorithms

Consistent ? Store Input Yes No Find Set of inconsistent relations Find minimal set to remove to make the system consistent Set constraints Choose input S I Perform algorithm

”Constraint programming represents one of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it.” ”Constraint programming represents one of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it.” Eugene C. Freuder, CONSTRAINTS, April 1997 CONSTRAINTS

Questions, comments ? Questions, comments ?

The Program… The Program…