1 / 57

Consistency algorithms

Consistency algorithms. Chapter 3. Consistency methods. Approximation of inference: Arc, path and i-consistecy Methods that transform the original network into a tighter and tighter representations. Arc-consistency. X. Y. . 1,. 2,. 3. 1,. 2,. 3. 1  X, Y, Z, T  3 X  Y Y = Z

lazaro
Download Presentation

Consistency algorithms

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. 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 ICS 275A - Constraint Networks

  3. Arc-consistency X Y  1, 2, 3 1, 2, 3 1  X, Y, Z, T  3 X  Y Y = Z T  Z X  T  = 1, 2, 3 1, 2, 3  T Z ICS 275A - Constraint Networks

  4. 1 3 2 3 Arc-consistency X Y  1  X, Y, Z, T  3 X  Y Y = Z T  Z X  T  =  T Z ICS 275A - Constraint Networks

  5. Arc-consistency ICS 275A - Constraint Networks

  6. Revise for arc-consistency ICS 275A - Constraint Networks

  7. Figure 3.3: (a) Matching diagram describing a network of constraints that is not arc-consistent (b) An arc-consistent equivalent network. ICS 275A - Constraint Networks

  8. AC-1 • Complexity (Mackworth and Freuder, 1986): • e = number of arcs, n variables,k values • (ek^2, each loop, nk number of loops), best-case = ek, • Arc-consistency is: ICS 275A - Constraint Networks

  9. AC-3 • Complexity: • Best case O(ek), since each arc may be processed in O(2k) ICS 275A - Constraint Networks

  10. Example: A three variable network, with two constraints: z divides x and z divides y (a) before and (b) after AC-3 is applied. ICS 275A - Constraint Networks

  11. 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) ICS 275A - Constraint Networks

  12. Example applying AC-4 ICS 275A - Constraint Networks

  13. 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 ICS 275A - Constraint Networks

  14. Exercise: make the following network arc-consistent • Draw the network’s primal and dual constraint graph • Network = • Domains {1,2,3,4} • Constraints: y < x, z < y, t < z, f<t, x<=t+1, Y<f+2 ICS 275A - Constraint Networks

  15. 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, e=#constraints, k=domain size) • Mackworth and Freuder (1977,1983), Mohr and Anderson, (1985)… ICS 275A - Constraint Networks

  16. 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. ICS 275A - Constraint Networks

  17. Path-consistency ICS 275A - Constraint Networks

  18. Path-consistency ICS 275A - Constraint Networks

  19. Revise-3 • Complexity: O(k^3) • Best-case: O(t) • Worst-case O(tk) ICS 275A - Constraint Networks

  20. PC-1 • Complexity: • O(n^3) triplets, each take O(k^3) steps  O(n^3 k^3) • Max number of loops: O(n^2 k^2) . ICS 275A - Constraint Networks

  21. PC-2 • Complexity: • Optimal PC-4: • (each pair deleted may add: 2n-1 triplets, number of pairs: O(n^2 k^2)  size of Q is O(n^3 k^2), processing is O(k^3)) ICS 275A - Constraint Networks

  22. 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? ICS 275A - Constraint Networks

  23. Path-consistency Algorithms • Apply Revise-3 (O(k^3)) until no change • Path-consistency (3-consistency) adds binary constraints. • PC-1: • PC-2: • PC-4 optimal: ICS 275A - Constraint Networks

  24. I-consistency ICS 275A - Constraint Networks

  25. Higher levels of consistency, global-consistency ICS 275A - Constraint Networks

  26. Revise-i • Complexity: for binary constraints • For arbitrary constraints: ICS 275A - Constraint Networks

  27. 4-queen example ICS 275A - Constraint Networks

  28. I-consistency ICS 275A - Constraint Networks

  29. Arc-consistency for non-binary constraints:Generalized arc-consistency Complexity: O(t k), t bounds number of tuples. Relational arc-consistency: ICS 275A - Constraint Networks

  30. Examples of generalized arc-consistency • x+y+z <= 15 and z >= 13 implies x<=2, y<=2 • Example of relational arc-consistency ICS 275A - Constraint Networks

  31. 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 ICS 275A - Constraint Networks

  32. 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 kn^1.5 • (Lopez-Ortiz, et. Al, IJCAI-03 pp 245 (A fast and simple algorithm for bounds consistency of alldifferent constraint) ICS 275A - Constraint Networks

  33. 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) ICS 275A - Constraint Networks

  34. Bounds consistency ICS 275A - Constraint Networks

  35. Bounds consistency for Alldifferent constraints ICS 275A - Constraint Networks

  36. 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 ICS 275A - Constraint Networks

  37. 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? ICS 275A - Constraint Networks

  38. Gausian and Boolean propagation • Linear inequalities • Boolean constraint propagation ICS 275A - Constraint Networks

  39. Constraint propagation for Boolean constraints: Unit propagation ICS 275A - Constraint Networks

  40. Consistency for numeric constraints ICS 275A - Constraint Networks

  41. Tractable classes ICS 275A - Constraint Networks

  42. Changes in the network graph as a result of arc-consistency, path-consistency and 4-consistency. ICS 275A - Constraint Networks

  43. 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: ICS 275A - Constraint Networks

  44. Distributed Arc-Consistency • Arc-consistency can be formulated as a distributed algorithm: A B C D F G a Constraint network ICS 275A - Constraint Networks

  45. 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 ICS 275A - Constraint Networks

  46. 1 A A 3 A 2 AB AC B A C B 5 4 ABD BCF 6 F D DFG DRAC on the dual join-graph ICS 275A - Constraint Networks

  47. Distributed Relational Arc-Consistency • DRAC can be applied to the dual problem of any constraint network: ICS 275A - Constraint Networks

  48. A A A 1 1 1 2 3 2 3 3 B A A B A 1 2 1 1 1 1 3 2 3 3 C A A A 2 1 3 2 1 1 1 2 3 2 2 2 3 1 3 3 3 3 2 C B F B D B A A B A 2 1 1 1 1 2 1 1 1 1 2 2 1 3 2 3 3 3 2 2 1 3 3 3 2 3 3 1 3 2 F D 1 1 2 3 3 Iteration 1 Node 2 sends messages Node 1 sends messages Node 3 sends messages Node 4 sends messages Node 5 sends messages Node 6 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 ICS 275A - Constraint Networks

  49. 1 A A 3 A 2 AB AC B A C B 5 4 ABD BCF 6 F D DFG Iteration 1 ICS 275A - Constraint Networks

  50. B 1 1 A 3 A 3 A 2 AB AC B A C B 5 4 ABD BCF 6 F D DFG Iteration 2 ICS 275A - Constraint Networks

More Related