1 / 34

Constraint Satisfaction Problems and Consistency Restoration

Constraint Satisfaction Problems and Consistency Restoration. Florent Launay Undergraduate student at FIT. Summary. Focused interest in time point-sequencing problem. What are CSP’s ? Crossword Problem. Dealing with consistency. 1. Finding and storing consistent relations

asher
Download Presentation

Constraint Satisfaction Problems and Consistency Restoration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

  5. What are CSP’s ? • 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’, …}

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

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

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

  9. Dealing with consistency • 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.

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

  11. A simple example P2>P1 • P3<P1 and P3>P2 Valid region P1 P2 No valid region can be found for P3 !!!

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

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

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

  15. Inconsistent relations • FIND MULTIPLE EQUALITY If Pnew = P3 And Pnew = P6 The system is inconsistent since P3<>P6 P1 P2 P3 P4 P5 P6 Pnew Pnew

  16. Inconsistent relations • VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY If Pnew = P3 And Pnew < P2 The system is inconsistent P1 P2 P3 P4 P5 P6 Pnew

  17. Inconsistent relations • FIND THE BOX: PRE-PROCESSING 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 P1 P2 P3 P4 P5 P6

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

  19. Inconsistent relations End of the first algorithm…

  20. 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

  21. 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”.

  22. Degree of inconsistency Here, if we want to add a new point Pnew such that: Pnew < P1, Pnew > P5 Pnew < P2, Pnew > P6 Pnew < P3, Pnew < P4, P1 P2 P3 P4 P5 P6

  23. Degree of inconsistency From here, we can see that : Pnew < P1 conflicts with Pnew > P5 Pnew < P3 conflicts with Pnew > P5 Pnew < P1 conflicts with Pnew > P6 Pnew < P3 conflicts with Pnew > P6 Pnew < P2 conflicts with Pnew > P5 Pnew < P4 conflicts with Pnew > P5 Pnew < P2 conflicts with Pnew > P6 Pnew < P4 conflicts with Pnew > P6 P1 P2 P3 P4 P5 P6

  24. Questions before we move to the Algorithm ?

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

  26. Algorithm • Initialize I to be empty; While (nS != 0) { * Find the relation R with highest inconsistent degree m; * nS = nS – mR; * 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; }

  27. Example • Let us consider the last example. Here are the variables of the algorithm. S 2 Pinc < P1 * Pinc > P5 4 S= {P1,P2, P3, P4, P5, P6} 2Pinc < P1 * Pinc > P6 4 mR = 0 2Pinc < P2 * Pinc > P5 4 R = {} 2Pinc < P2 * Pinc > P6 4 nS relations nS = 8 2 Pinc < P3 * Pinc > P5 4 I = {} 2 Pinc < P3 * Pinc > P6 4 2 Pinc < P4 * Pinc > P5 4 2 Pinc < P4 * Pinc > P6 4 Degree of inconsistency

  28. Example • One relation with highest inconsistency degree is : Pinc > P5. S 2 Pinc < P1 * Pinc > P5 4 1 S= {P1,P2, P3, P4, P5, P6} 2Pinc < P1 * Pinc > P6 4 1 mR = 0 4 2Pinc < P2 * Pinc > P5 4 1 {Pinc>P5} R = {} 2Pinc < P2 * Pinc > P6 4 1 nS = 8 8 – 4 = 4 2 Pinc < P3 * Pinc > P5 4 1 I = {} {Pinc>P5} 2 Pinc < P3 * Pinc > P6 4 1 2 Pinc < P4 * Pinc > P5 4 1 2 Pinc < P4 * Pinc > P6 4 1 Remove 1 from every inconsistent degree from every relation conflicting with R Remove every inconsistent relation conflicting with R from S Find the relation R with highest inconsistency degree Remove R from S Record R in I nS = nS – mR

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

  30. Linking the algorithms

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

  32. ”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

  33. Questions, comments ?

  34. The Program…

More Related