1 / 73

An Overview of Soft Constraints

An Overview of Soft Constraints . Presented by Tony Schneider Sources “Soft Constraints,” Meseguer , Rossi, & Schiex , CP Handbook , Chapter 9, 281—328, 2006

dawn
Download Presentation

An Overview of Soft Constraints

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. An Overview of Soft Constraints Presented by Tony Schneider Sources “Soft Constraints,” Meseguer, Rossi, & Schiex, CP Handbook, Chapter 9, 281—328, 2006 “Solving Weighted CSP by Maintaining Arc Consistency,” Larrosa & Schiex, Artificial Intelligence, Vol 159(1-2), pages 1—26, 2004.

  2. Motivation • Why Soft Constraints? • Find best answer as opposed to any answer • Systems where constraints existence is probabilistic • Over-constrained problems • Optimality • Requires exploration of entire search space (i.e., finding all-solutions) • Necessitates efficient pruning methods • At least as hard as classical CSPs Tony Schneider--Soft Constraints

  3. Outline • Background Information Section 9.1 • Specific Soft Constraint Frameworks Section 9.2 • Fuzzy& weighted • Local Consistency in Soft Constraints [Larrosa+ AI04] • Generic Soft Constraint Frameworks Section 9.3 • Semiring-based & valued • Systematic Search in Soft Constraints Section 9.5 • Wrap up Tony Schneider--Soft Constraints

  4. Notation • tVis a partial solution over V variables • Constraint • c∈Cis denoted ⟨R,V⟩ or RV • R=relation(c), V=scope(c) • For W⊆V,tv[W]= πW(tV) • For a constraint c: ⟨R,W⟩, Rw • W⊆V ⟺ c is completely assigned by tV • tv[W]∈Rw ⟺ tVsatisfies c • tv[W] ∉ RW⟺ tV violates c • tv is consistent ⟺ all constraints completely assigned by it are satisfied Tony Schneider--Soft Constraints

  5. Fuzzy Set • What is a fuzzy set? • Changes question of satisfaction from • “Does this value belong to this set?” to • “How much does this value belong to this set?” • Formally • μe(a) = 0 : Value a doesn’t belong to set e at all • μe(a) = 1 : Value a completely belongs to set e • Acceptance value ranges from [0,1] Tony Schneider--Soft Constraints

  6. Fuzzy Constraints • A fuzzy constraint: a relation RV and a function maps a membership degree to every possible tuple for the variables in V • A fuzzy CSP is a CSP with fuzzy constraints Tony Schneider--Soft Constraints

  7. Combining Fuzzy Constraints • Conjunctive Combination (RV⊗ RW) • Combines two relations into a new relation RV⋃W • Formally: where Tony Schneider--Soft Constraints

  8. Conjunctive Combination: Example Tony Schneider--Soft Constraints

  9. Solutions in Fuzzy CSPs • The satisfaction rate of a complete assignment is the value of the least satisfied constraint • A complete assignment with • non-zero satisfaction rate is a solution • the maximum satisfaction rate is an optimal solution Tony Schneider--Soft Constraints

  10. Advantages of Fuzzy CSPs • Good for applications where system is only as strong as its weakest link • Space Engineering • Medical Applications • Can easily represent classical constraints • Can use other operators besides minextensions Tony Schneider--Soft Constraints

  11. Disadvantages of Fuzzy CSPs • Consider two assignments t, t’ t: μR1(t) = .5μR2(t) = 1.0 t’: μR1(t’) = .5μR2(t’) = .5 • Each would be considered optimal solutions… • but… t is superior WRT μR2 • Solution? Fuzzy lexicographic constraints… • Sort μvalues in increasing order • Break ties in minimum preference with next lowest μ Tony Schneider--Soft Constraints

  12. Outline • Background InformationSection 9.1 • Specific Soft Constraint Frameworks Section 9.2 • Fuzzy& weighted • Local Consistency in Soft Constraints [Larrosa+ AI04] • Generic Soft Constraint Frameworks Section 9.3 • Semiring-based & valued • Systematic Search in Soft Constraints Section 9.5 • Wrap up Tony Schneider--Soft Constraints

  13. Weighted Constraints • Another soft constraint framework • Suitable for applications dealing with minimizing cost or penalties, e.g., • best price for some combination of items • minimizing travel costs Tony Schneider--Soft Constraints

  14. Solutions in Weighted Constraint Networks • Weighted CSP = CSP + a weighted constraint • Weighted constraints: ⟨c,w⟩ • w(c) ∈ N, Z, R is the cost of the constraint c • Cost (assignment) = ∑ of violated constraints • Optimal solution is a complete assignment with minimal cost • ∀c∈C, w(c) ≣ 1 ⇒ weighted CSP ≣ MaxCSP Tony Schneider--Soft Constraints

  15. k-Weighted Constraints • Refinement of weighted constraints • Defined by the tuple ⟨X,D,C,K⟩ where • C is a set of k-weighted constraints • kis an integer • k acts as an upper bound for acceptable costs • Weights are mapped to tuples in C Tony Schneider--Soft Constraints

  16. Outline • Background InformationSection 9.1 • Specific Soft Constraint FrameworksSection 9.2 • Fuzzy& weighted • Local Consistency in Soft Constraints[Larrosa+ AI04] • Generic Soft Constraint Frameworks Section 9.3 • Semiring-based & valued • Systematic Search in Soft Constraints Section 9.5 • Wrap up Tony Schneider--Soft Constraints

  17. Local Consistency in SCSPs • Concept similar to hard-CSPs • Used to reduce search space • Detect inconsistencies early • However • Requires consideration of constraint costs • Values can only be pruned when node inconsistent Tony Schneider--Soft Constraints

  18. Node Consistency in WCSPs • Every variable v has a unary constraint Cv • A value a ∈ v is node consistent (NC) if Cv(a) < ⟙ • A variable is NC if its values are NC • A problem is NC if its variables are NC Is x NC if ⟙ = 4? Yes! Is x NC if ⟙ = 3? No. Prune value c. Tony Schneider--Soft Constraints

  19. Arc Consistency in WCSPs • A value a in variable iis arc consistent (AC) with respect to Cij if • It is node consistent • It has at least one support b in Djs.t.Cij(a,b) = ⟘ • A variable is AC if its values are AC • A problem is AC if its variables are AC • However, arc inconsistent values cannot be removed as in hard-CSPs • Why? Tony Schneider--Soft Constraints

  20. Arc Consistency in WCSPs • Is value ‘b’ ∈ x arc consistent WRT variable y? • Is value ‘a’ ∈ x arc consistent WRT variable y? Yes No • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  21. Arc Consistency in WCSPs • So why bother with AC? • Use AC to push costs of binary constraints onto unary ones • To make value a ∈x arc consistent WRT Cxy • Find minimum cost of assigning a in Cxy • Add αa to unary constraint Cx(a) • Subtract αafrom cost of all constraints in Cxy Tony Schneider--Soft Constraints

  22. WCSP Arc Consistency Preliminary • Subtraction in WCSPs is defined by • And addition by Tony Schneider--Soft Constraints

  23. WCSP Arc Consistency Example • Goal: Make variable y arc consistent • Is a ∈ yAC? • Is b ∈ yAC? • Is c ∈ yAC? Yes Yes No • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  24. WCSP Arc Consistency Example • Find minimum cost of assigning a in Cxy • Add αato unary constraint Cy(a) • Subtract αafrom cost of constraints in Cxy αa = 1 • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  25. WCSP Arc Consistency Example Is variable y arc consistent? Is the problem arc consistent? No. Value c is not node consistent. No. Value a in x has no support. • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  26. WCSP Arc Consistency Example • Find minimum cost of assigning a in Cxy • Add αato unary constraint Cx(a) • Subtract αafrom cost of constraints in Cxy αa = 1 • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  27. WCSP Arc Consistency Example Why does this work? • A CSP where • X = {x, y} • D = {a, b, c} • C = {Cxy} • ⟙ = 3 Tony Schneider--Soft Constraints

  28. Weighted Arc Consistency Intuition • Force supports for arc inconsistent values • Arc inconsistent values can’t simply be removed • Cost of binary constraint is taken on by unary • Other tuples with the previously inconsistent value adjusted to compensate for the higher unary cost • Caveat: order of evaluation can produce different (but equal) structures Tony Schneider--Soft Constraints

  29. Equivalent WCSP Networks Same resultant network from previous example Resultant AC network if x was made AC first instead of (y,c) Tony Schneider--Soft Constraints

  30. W-AC3 and W-AC2001 • Operate in a similar fashion to their hard-CSP counterparts • Maintain a queue of revised variables • Make each adjacent variable of variables in the queue arc-consistent • Force support for arc inconsistent values (i.e., push binary constraints onto unary) • Prune node inconsistent values in the variable • If variable is pruned, add it to the queue • Time complexity: O(ed3) for each algorithm Tony Schneider--Soft Constraints

  31. Outline • Background InformationSection 9.1 • Specific Soft Constraint FrameworksSection 9.2 • Fuzzy& weighted • Local Consistency in Soft Constraints[Larrosa+ AI04] • Generic Soft Constraint Frameworks Section 9.3 • Semiring-based & valued • Systematic Search in Soft Constraints Section 9.5 • Wrap up Tony Schneider--Soft Constraints

  32. Generic Frameworks • Motivation • Generic algorithms & properties • One algorithm for many similar, specific frameworks • Allows easy comparison between frameworks • Two main generic frameworks • Semiring-Based Constraints • Valued constraints Tony Schneider--Soft Constraints

  33. Semiring: Preliminaries • Operator Properties • Commutative a +s b = b +s a • Associative (a +sb) +sc = (a +sb) +s c • Idempotent a +sa = a • Annihilators • A value b whose application to another value a destroys a • E.g., 0 is the annihilator for integer multiplication • Neutral Elements • A value b whose application to another value a results in the value a Tony Schneider--Soft Constraints

  34. c-Semirings • A c-semiring is a tuple ⟨E,+s,×s,0,1⟩ where • E is a set of satisfaction degrees where 0 ∈ E, 1∈E • Operator +s • is associative, commutative, and idempotent • is closed in E • has 0 as a neutral element and 1 as an annihilator • Operator ×s • is associativeand commutative • is closed in E • has 1 as a neutral element and 0 as an annihilator • ×s distributes over +s Tony Schneider--Soft Constraints

  35. c-Semiring Operators • ×s isused to combine preferences • Let • RCbe completely satisfied • RUbe completely unsatisfied • Rlhave satisfaction degree l • vals(R) be the preference level of relation R • Then • vals(RC) ×s vals(RU)= 0 • vals(RC) ×s vals(Rl) = l • vals(Rl)×s vals(Rl) = l Tony Schneider--Soft Constraints

  36. c-Semiring Operators • +s is used to order preference levels • Let a and b be two preference levels • a+sb= a b ≼s a • a+sb= b a ≼sb • a+sb= c and a ≠ c, b ≠ c Incomparable • +s Induces a partial ordering over preferences • Specifically a lattice where +sis the least upper bound (LUB) of {a,b} Tony Schneider--Soft Constraints

  37. Partial Orders in c-Semirings Satisfaction level ⟨s, c, t⟩ • Allow for more expressive modeling • Optimization of multiple criteria • Example • maximizing route scenery • minimizing cost & time • ⟨1.0, 0, 0⟩ • ⟨0.5, 40, 800⟩ • ⟨0.75, 50, 400⟩ • ⟨0.5, 50, ∞⟩ • ⟨0.4, 40, 900⟩ • ⟨0.0, ∞, ∞⟩ Tony Schneider--Soft Constraints

  38. Semiring Constraint Networks • A semiring constraint network is a tuple ⟨X,D,C,S⟩ where • X, D : same as in classical CSPs • C is a set of soft constraints • S = ⟨E,+s,×s,0,1⟩ is a c-semiring Tony Schneider--Soft Constraints

  39. Soft Constraints • A soft constraint: a function f on a set of variables V ⊆ X f maps a semiring value to every possible tuple for the variables in V • A soft constraint is a pair ⟨f,V⟩ denoted as fv Tony Schneider--Soft Constraints

  40. Outline • Background InformationSection 9.1 • Specific Soft Constraint FrameworksSection 9.2 • Fuzzy& weighted • Local Consistency in Soft Constraints[Larrosa+ AI04] • Generic Soft Constraint Frameworks Section 9.3 • Semiring-based & valued • Systematic Search in Soft Constraints Section 9.5 • Wrap up Tony Schneider--Soft Constraints

  41. Overview of Valued Constraints • An alternative to semiring-based constraints • Elements represent violation degrees • Totally ordered • Can represent any totally ordered semiring-based constraint • Uses a valuation structure instead of a semiring Tony Schneider--Soft Constraints

  42. Valuation Structure • A valuation structure is a tuple <E, ⊕, ≼v, ⟘,⟙> where • E is a set of values totally ordered by ≼v • ⟘is a minimum element in E • ⟙ is a maximum element in E • ⊕ is an operator which • is associative, commutative, and monotonic • is closed in E • Has ⟘ as a neutral element and ⟙ as an annihilator • Monotonicity • a ≼v b ⟶ ((a ⊕ c) ≼v (b ⊕ c)) Tony Schneider--Soft Constraints

  43. Valued Constraint Network • Same definition as semiring CN, but the valuation structure replaces the semiring • Valuation structures can always be represented as semirings: ⟘= 1 ⟙ = 0⊕v = ×sa ≼vbiffa +sb = a • When totally ordered, semiring CNs have corresponding valued CNs 1 = ⟘ 0 = ⟙ ×s = ⊕va +sb = min≼v{a, b} Tony Schneider--Soft Constraints

  44. Operations on Soft Constraints • Combination / Join • Combines two constraints without losing information • Take two soft constraints fV and f’V’ and Tony Schneider--Soft Constraints

  45. Operations on Soft Constraints • Combination / Join Example in Fuzzy CSPs (×s = min) ×s = Tony Schneider--Soft Constraints

  46. Operations on Soft Constraints • Projection • Eliminates one or more variables from a constraint • Take some soft constraint fV and Tony Schneider--Soft Constraints

  47. Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints

  48. Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints

  49. Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints

  50. Soft Constraint Solutions • ⨝f∈Cf is a soft constraint associates a consistency level with a complete assignment t • vals(t) is its preference level • ⨝f∈Cf[ø] is the network’s consistency level • A solution to a semiring SCSP is a complete assignment t such that ⨝f∈Cf[t] ≠ 0 • An optimal solution t is one s.t. no other assignment t’ satisfies vals(t) ≺svals(t’) Tony Schneider--Soft Constraints

More Related