Consistency algorithms - PowerPoint PPT Presentation

About This Presentation
Title:

Consistency algorithms

Description:

Arc, path and i-consistecy. Methods that transform the original network into a tighter and tighter ... Alg: bipartite matching kn^1.5 ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 58
Provided by: marioes
Learn more at: https://ics.uci.edu
Category:

less

Transcript and Presenter's Notes

Title: Consistency algorithms


1
Consistency algorithms
  • Chapter 3

2
Consistency methods
  • Approximation of inference
  • Arc, path and i-consistecy
  • Methods that transform the original network into
    a tighter and tighter representations

3
Arc-consistency
X
Y
?
3
2,
1,
3
2,
1,
1 ? X, Y, Z, T ? 3 X ? Y Y Z T ? Z X ? T

?
3
2,
1,
3
2,
1,
?
T
Z
4
Arc-consistency
X
Y
?
1 ? X, Y, Z, T ? 3 X ? Y Y Z T ? Z X ? T

?
?
T
Z
5
Arc-consistency
6
Arc-consistency
Only domain constraints are recorded
Example
7
Revise for arc-consistency
8
Figure 3.3 (a) Matching diagram describing a
network of constraints that is not arc-consistent
(b) An arc-consistent equivalent network.
9
AC-1
  • Complexity (Mackworth and Freuder, 1986)
  • e number of arcs, n variables,k values
  • (ek2, each loop, nk number of loops), best-case
    ek,
  • Arc-consistency is

10
AC-3
  • Complexity
  • Best case O(ek), since each arc may be processed
    in O(2k)

11
Example A three variable network, with two
constraints z divides x and z divides y (a)
before and (b) after AC-3 is applied.
12
AC-4
  • Complexity
  • (Counter is the number of supports to ai in xi
    from xj. S_(xi,ai) is the set of pairs that
    (xi,ai) supports)

13
Example applying AC-4
14
Distributed arc-consistency(Constraint
propagation)
  • Implement AC-1 distributedly.
  • Node x_j sends the message to node x_i
  • Node x_i updates its domain
  • Messages can be sent asynchronously or scheduled
    in a topological order

15
Exercise make the following network
arc-consistent
  • Draw the networks primal and dual constraint
    graph
  • Network
  • Domains 1,2,3,4
  • Constraints y lt x, z lt y, t lt z, fltt, xltt1,
    Yltf2

16
Arc-consistency Algorithms
  • AC-1 brute-force, distributed
  • AC-3, queue-based
  • AC-4, context-based, optimal
  • AC-5,6,7,. Good in special cases
  • Important applied at every node of search
  • (n number of variables, econstraints, kdomain
    size)
  • Mackworth and Freuder (1977,1983), Mohr and
    Anderson, (1985)

17
Is arc-consistency enough?
  • Example a triangle graph-coloring with 2 values.
  • Is it arc-consistent?
  • Is it consistent?
  • It is not path, or 3-consistent.

18
Path-consistency
19
Path-consistency
20
Revise-3
  • Complexity O(k3)
  • Best-case O(t)
  • Worst-case O(tk)

21
PC-1
  • Complexity
  • O(n3) triplets, each take O(k3) steps ? O(n3
    k3)
  • Max number of loops O(n2 k2) .

22
PC-2
  • Complexity
  • Optimal PC-4
  • (each pair deleted may add 2n-1 triplets, number
    of pairs O(n2 k2) ? size of Q is O(n3 k2),
    processing is O(k3))

23
Example before and after path-consistency
  • PC-1 requires 2 processings of each arc while
    PC-2 may not
  • Can we do path-consistency distributedly?

24
Path-definition of path-consistency
25
Path-consistency Algorithms
  • Apply Revise-3 (O(k3)) until no change
  • Path-consistency (3-consistency) adds binary
    constraints.
  • PC-1
  • PC-2
  • PC-4 optimal

26
I-consistency
27
Higher levels of consistency, global-consistency
28
Revise-i
  • Complexity for binary constraints
  • For arbitrary constraints

29
4-queen example
30
I-consistency
31
Path-consistency vs 3-consistency
32
Arc-consistency for non-binary
constraintsGeneralized arc-consistency
  • Complexity O(t k), t bounds number of tuples.
  • Relational arc-consistency

33
Examples of generalized arc-consistency
  • xyz lt 15 and z gt 13 implies
  • xlt2, ylt2
  • Example of relational arc-consistency

34
More arc-based consistency
  • Global constraints e.g., all-different
    constraints
  • Special semantic constraints that appears often
    in practice and a specialized constraint
    propagation. Used in constraint programming.
  • Bounds-consistency pruning the boundaries of
    domains

35
Sudoku Constraint Satisfaction
  • Variables empty slots
  • Domains 1,2,3,4,5,6,7,8,9
  • Constraints
  • 27 all-different
  • Constraint
  • Propagation
  • Inference

2 34 6
2
Each row, column and major block must be
alldifferent Well posed if it has unique
solution 27 constraints
36
Global constraints
37
Example for alldiff
  • A 3,4,5,6
  • B 3,4
  • C 2,3,4,5
  • D 2,3,4
  • E 3,4
  • Alldiff (A,B,C,D,E
  • Arc-consistency does nothing
  • Apply GAC to sol(A,B,C,D,E)?
  • ? A 6, F 1.
  • Alg bipartite matching kn1.5
  • (Lopez-Ortiz, et. Al, IJCAI-03 pp 245 (A fast and
    simple algorithm for bounds consistency of
    alldifferent constraint)

38
Global constraints
  • Alldifferent
  • Sum constraint (variable equal the sum of others)
  • Global cardinality constraint (a value can be
    assigned a bounded number of times to a set of
    variables)
  • The cummulative constraint (related to scheduling
    tasks)

39
Bounds consistency
40
Bounds consistency for Alldifferent constraints
41
Boolean constraint propagation
  • (A V B) and (B)
  • B is arc-consistent relative to A but not
    vice-versa
  • Arc-consistency by resolution
  • res((A V B),B) A
  • Given also (B V C), path-consistency
  • Res((A V B),(B V C) (A V C)
  • What will generalized arc-consistency can do to
    cnfs?
  • Relational arc-consistency rule unit-resolution

42
Boolean constraint propagation
Example party problem
  • If Alex goes, then Becky goes
  • If Chris goes, then Alex goes
  • Query
  • Is it possible that Chris goes to the party
    but Becky does not?

43
Gausian and Boolean propagation
  • Linear inequalities
  • Boolean constraint propagation

44
Constraint propagation for Boolean constraints
Unit propagation
45
Arc-consistency for non-binary constraints
Generalized arc-consistency (reminder)
  • Complexity O(t k), t bounds number of tuples.
  • Relational arc-consistency

46
Algorithms for relational and generalized
arc-cnsistency
  • Think about the following
  • GAC-i apply AC-i to the dual problem when
    singleton variables are explicit the bi-partite
    representation.
  • What is the complexity?
  • Relational arc-consistency imitate unit
    propagation.
  • Apply AC-1 on the dual problemwhere each subset
    of a scope is presented.
  • Is unit propagation equivalent to AC-4?

47
Consistency for numeric constraints
48
Tractable classes
49
Changes in the network graph as a result of
arc-consistency, path-consistency and
4-consistency.
50
Distributed arc-consistency(Constraint
propagation)
  • Implement AC-1 distributedly.
  • Node x_j sends the message to node x_i
  • Node x_i updates its domain
  • Generalized arc-consistency can be implemented
    distributedly sending messages between
    constraints over the dual graph

51
Distributed Arc-Consistency
  • Arc-consistency can be formulated as a
    distributed algorithm

A
B
C
D
F
G
a Constraint network
52
Relational Arc-consistency
A
The message that R2 sends to R1 is R1 updates
its relation and domains and sends messages to
neighbors
B
C
D
F
G
53
DRAC on the dual join-graph
54
Distributed Relational Arc-Consistency
  • DRAC can be applied to the dual problem of any
    constraint network

55
DR-AC on the dual graph
1
A
A
3
A
2
AB
AC
A
A
A
C
AB
B
5
4
ABD
BCF
B
6
F
D
DFG
56
Iteration 1
Node 6 sends messages
Node 5 sends messages
Node 4 sends messages
Node 3 sends messages
Node 2 sends messages
Node 1 sends messages

1
A
A
3
A
2
AB
AC
A
A
A
C
AB
B
5
4
ABD
BCF
B
6
F
D
DFG
57
Iteration 1
B
1
3
58
Iteration 1
59
Iteration 2
60
Iteration 2
61
Iteration 3
62
Iteration 3
63
Iteration 4
64
Iteration 4
65
Iteration 5
66
Iteration 5
Write a Comment
User Comments (0)
About PowerShow.com