730 likes | 926 Views
An Overview of Soft Constraints . Presented by Tony Schneider Sources “Soft Constraints,” Meseguer , Rossi, & Schiex , CP Handbook , Chapter 9, 281—328, 2006
E N D
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.
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
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
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
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
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
Combining Fuzzy Constraints • Conjunctive Combination (RV⊗ RW) • Combines two relations into a new relation RV⋃W • Formally: where Tony Schneider--Soft Constraints
Conjunctive Combination: Example Tony Schneider--Soft Constraints
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
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
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
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
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
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
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
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
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
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
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
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
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
WCSP Arc Consistency Preliminary • Subtraction in WCSPs is defined by • And addition by Tony Schneider--Soft Constraints
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Operations on Soft Constraints • Combination / Join Example in Fuzzy CSPs (×s = min) ×s = Tony Schneider--Soft Constraints
Operations on Soft Constraints • Projection • Eliminates one or more variables from a constraint • Take some soft constraint fV and Tony Schneider--Soft Constraints
Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints
Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints
Operations on Soft Constraints • Projection Example in Fuzzy CSPs (+s = max), W= {x2, x3} R[W] or R[-x1] Tony Schneider--Soft Constraints
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