Constraint Satisfaction Problems and Consistency Restoration - PowerPoint PPT Presentation

About This Presentation
Title:

Constraint Satisfaction Problems and Consistency Restoration

Description:

Constraint Satisfaction Problems and Consistency Restoration. Florent Launay ... 1. Finding and storing consistent relations. 2. Finding a 'minimal set to ... – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 35
Provided by: Flo142
Learn more at: https://cs.fit.edu
Category:

less

Transcript and Presenter's Notes

Title: Constraint Satisfaction Problems and Consistency Restoration


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

2
Summary
  • Focused interest in time point-sequencing
    problem.
  • What are CSPs ?
  • 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 lt, gt, , ltgt, lt, gt, ltgt
  • Here, we can see that some constraints between
    the set of points P1, P2, P3 exist
  • P1 lt P2
  • P2 lt P3

P1
P2
P3
4
What are CSPs ?
  • Constraints

X gt 5 X ltgt 9 X lt 12
5
What are CSPs ?
  • Example
  • Common names from English vocabulary beginning
    with a c, ending with a t, but that doesnt
    contain any e

Valid set count, cart, chat, court,
6
What are CSPs ?
  • Valid regions and Box

X gt 5
X ltgt 9
X lt 12
X lt 15
X gt 3
5
9
12
15
3
Valid regions 5,5, 5,9, 9,12
7
What are CSPs ?
  • Inconsistencies

X gt 5
X ltgt 9
X lt 12
X gt 13
5
9
12
13
No valid region gt 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
E A D ?
A N D ?
A I R
H
N O T
A N D
  • 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.

Lets 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
  • P2gtP1

P3ltP1 and P3gtP2
Valid region
P2
P1
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
  • gtStore inconsistent relations
  • VERIFY CONSISTENCY IN CASE OF UNIQUE EQUALITY
  • gtStore inconsistent relations
  • FIND THE BOX PRE-PROCESSING
  • gtStore inconsistent relations
  • FIND VALID REGIONS
  • gtIf no inconsistency has been found

15
Inconsistent relations
  • FIND MULTIPLE EQUALITY

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

If Pnew P3
And Pnew lt P2
The system is inconsistent
P2
P1
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 gt P6, Or the system becomes inconsistent
P2
P1
P3
P4
P5
P6
18
Inconsistent relations
  • FIND VALID REGIONS
  • gtIf no inconsistency has been found

A valid region region could be P2,P3,
P3,P3, P3,P4, P4,P5, P5,P5, P5,P6
P2
P1
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 lt P1, Pnew gt P5
  • Pnew lt P2, Pnew gt P6
  • Pnew lt P3,
  • Pnew lt P4,

P2
P1
P3
P4
P5
P6
23
Degree of inconsistency
  • From here, we can see that
  • Pnew lt P1 conflicts with Pnew gt P5 Pnew lt P3
    conflicts with Pnew gt P5
  • Pnew lt P1 conflicts with Pnew gt P6 Pnew lt P3
    conflicts with Pnew gt P6
  • Pnew lt P2 conflicts with Pnew gt P5 Pnew lt P4
    conflicts with Pnew gt P5
  • Pnew lt P2 conflicts with Pnew gt P6 Pnew lt P4
    conflicts with Pnew gt P6

P2
P1
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 lt P1 Pinc gt P5 4
S P1,P2, P3, P4, P5, P6
2 Pinc lt P1 Pinc gt P6 4
2 Pinc lt P2 Pinc gt P5 4
mR 0
2 Pinc lt P2 Pinc gt P6 4
R
nS relations
2 Pinc lt P3 Pinc gt P5 4
nS 8
2 Pinc lt P3 Pinc gt P6 4
I
2 Pinc lt P4 Pinc gt P5 4
2 Pinc lt P4 Pinc gt P6 4
Degree of inconsistency
28
Example
  • One relation with highest inconsistency degree is
  • Pinc gt P5.

S
2 Pinc lt P1 Pinc gt P5 4
1
S P1,P2, P3, P4, P5, P6
2 Pinc lt P1 Pinc gt P6 4
1
2 Pinc lt P2 Pinc gt P5 4
mR 0
4
1
PincgtP5
2 Pinc lt P2 Pinc gt P6 4
R
1
2 Pinc lt P3 Pinc gt P5 4
nS 8
8 4 4
1
2 Pinc lt P3 Pinc gt P6 4
I
PincgtP5
1
2 Pinc lt P4 Pinc gt P5 4
1
2 Pinc lt P4 Pinc gt P6 4
1
Remove 1 from every inconsistent degree from
every relation conflicting with R
Find the relation R with highest inconsistency
degree
nS nS mR
Record R in I
Remove every inconsistent relation conflicting
with R from S
Remove R from S
29
Example
  • The variables are now

The relation with highest inconsistency degree is
now PincgtP6.
S P1,P2, P3, P4, P6
S
mR 4
4
PincgtP6
R PincgtP5
1 Pinc lt P1 Pinc gt P6 4
0
nS 4
4 4 0
1 Pinc lt P2 Pinc gt P6 4
0
I PincgtP5
PincgtP5 , PincgtP6
1 Pinc lt P3 Pinc gt P6 4
0
1 Pinc lt P4 Pinc gt P6 4
0
n 0, the system is now consistent, and a
minimal set to remove is found I PincgtP5,
PincgtP6
Remove 1 from every inconsistent degree from
every relation conflicting with R
nS nS mR
Find the relation R with highest inconsistency
degree
Record R in I
Remove every inconsistent relation conflicting
with R from S
Remove R from S
30
Linking the algorithms
31
Linking the algorithms
Choose input
Set constraints
Perform algorithm
Consistent ?
Store Input
Yes
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
Write a Comment
User Comments (0)
About PowerShow.com