Cost function optimization & local consistency Thomas Schiex INRA – Toulouse France
Mars 2006Math CSP Workshop Oxford2 Overview Introduction and definitions What is it ? How do we solve it ? Local consistency Fundamental operations on soft CN How are fair valuation structures ? Equivalence preserving operations Local consistencies Max flow as a local consistency ? Conclusion
Mars 2006Math CSP Workshop Oxford3 Why soft constraints? CSP framework: for decision problems Many problems are overconstrained or optimization problems Economics (combinatorial auctions) Given a set G of goods and a set B of bids… Bid (B i,V i ), B i requested goods, V i value … find the best subset of compatible bids Best = maximize revenue (sum)
Mars 2006Math CSP Workshop Oxford4 Why soft constraints? Satellite scheduling Spot 5 is an earth observation satellite It has 3 on-board cameras Given a set of requested pictures (of different importance)… Resources, data-bus bandwidth, setup-times, orbiting …select a subset of compatible pictures with max. importance (sum)
Mars 2006Math CSP Workshop Oxford5 Why soft constraints? Probabilistic inference (bayesian nets) Given a probability distribution defined by a DAG of conditional probability tables And some evidence …find the most probable explanation for the evidence (product) Haplotyping
Mars 2006Math CSP Workshop Oxford6 Why soft constraints? Ressource allocation (frequency assignment) Given a telecommunication network …find the best frequency for each communication link avoiding interferences Best can be: Minimize the maximum frequency (max) Minimize the global interference (sum) w/o mentionning MaxCut/Clique, Vertex cover…
Mars 2006Math CSP Workshop Oxford7 Soft constraint network (CN) (X,D,C)(X,D,C) X={x 1,..., x n } variables D={D 1,..., D n } finite domains C={f,...} e cost functions f S, f ij, f i f ∅ scope S,{x i,x j },{x i }, ∅ f S (t): E (ordered by ≼, ≼ T ) Obj. Function: F(X)= f S (X[S]) Solution: F(t) T Soft CN: find minimum cost solution identity annihilator commutative associative monotonic
Mars 2006Math CSP Workshop Oxford8 Specific frameworks Lexicographic CN, probabilistic CN… Instance E ≼T≼T Classic CN {t,f}{t,f} and t ≼ f Possibilistic [0,1] max 0≼10≼1 Fuzzy CN [0,1] usual min 1≼01≼0 Weighted CN (bounded or not) [0,k]+ 0≼k0≼k Bayes net [0,1] × 1≼01≼0
Basic operations - combination/join - projection
Mars 2006Math CSP Workshop Oxford10 Cost function implication f P implied by g Q ( f P ≼g Q, g Q tighter than f P ) iff for all t∊ℓ(P∪Q), f P (t[P])≼g Q (t[Q]) xixi xjxj g(x i,x j ) bb2 bg3 br2 gb4 gg5 gr4 rbT=6 rg rr xixi f(x i ) b1 g2 r3 xixi g[x i ] b2 g4 rT=6 impliesor T=1 : classic CSP case
Mars 2006Math CSP Workshop Oxford11 Combination (join with , + here ) xixi xjxj f(x i,x j ) bb6 bg0 gb0 gg6 xjxj xkxk g(x j,x k ) bb6 bg0 gb0 gg6 xixi xjxj xkxk h(x i,x j,x k ) bbb12 bbg6 bgb0 bgg6 gbb6 gbg0 ggb6 ggg = 0 6
Mars 2006Math CSP Workshop Oxford12 Projection (elimination) xixi xjxj f(x i,x j ) bb4 bg6 br0 gb2 gg6 gr3 rb1 rg0 rr6 f[x i ] xixi g(x i ) b g r g[ ] hh 0 Min
Systematic search Branch and bound(s)
Mars 2006Math CSP Workshop Oxford14 Systematic search (LB) Lower Bound (UB) Upper Bound If UB then prune variables under estimation of the best solution in the sub-tree = best solution so far Each node is a soft constraint subproblem LB ff = f = T
Mars 2006Math CSP Workshop Oxford15 Local consistency Very useful in classical CSP Node consistency (1-consistency) Arc consistency…(2-consistency in binary CSP) Related to tractable classes (AC: tree, 2SAT) Produces an equivalent more explicit problem: Preserves solutions (costs), may detect unfeasibility (gives a better f ∅ )
Mars 2006Math CSP Workshop Oxford16 Classical arc consistency (binary CSP) for any x i and c ij c=(c ij ⋈ c j )[x i ] brings no new information on x i w v v w ij T T xixi xjxj c ij vv0 vw0 wvT wwT xixi c(x i ) v0 wT c ij ⋈ c j T (c ij ⋈ c j )[-x j ]
Mars 2006Math CSP Workshop Oxford17 Arc consistency and soft constraints w v v w ij 2 1 xixi xjxj f ij vv0 vw0 wv2 ww1 XiXi f(x i ) v0 w1 f ij f j 1 Always equivalent iff idempotent [Rosenfeld 76, Bistarelli et al. 95] for any x i and f ij f=(f ij f j )[x i ] brings no new information on x i (f ij f j )[x i ]
Mars 2006Math CSP Workshop Oxford18 Combination+Extraction: equivalence preserving transformation [S,CS] Requires the existence of a pseudo difference (a b) b = a: fair valued CN. Extraction of implied constraints 2 w v v w ij xixi xjxj f ij vv0 vw0 wv2 ww1 xixi f(x i ) v0 w1 f ij f j f ij f j [x i ] xixi xjxj f ij vv0 vw0 wv1 ww0
Mars 2006Math CSP Workshop Oxford19 Fair valuation structures Totally characterized [CS,C] Slices that interact together idempotently Each slice (discrete case) is isomorphic to S = (N U { }, +) infinite top S k = ([0,k], + k )finite top This means only 3 types of structures to consider. Tractability only known for finite costs+infinite T (idempotent case should be … easy)
Mars 2006Math CSP Workshop Oxford20 (K,Y) equivalence preserving inference For a set K of constraints and a scope Y Replace K by ( K) Add ( K)[Y] to the CN (implied by K) Extract ( K)[Y] from ( K) Yields an equivalent network All implicit information on Y in K is explicit Repeat for a class of (K,Y) until fixpoint
Mars 2006Math CSP Workshop Oxford21 Node Consistency (NC * ): (f i, ) EPI For any variable X i a, f + f i (a)<T a, f i (a)= 0 Complexity: O(nd) w v v v w w C =C = T = x y z
Mars 2006Math CSP Workshop Oxford Full AC (FAC * ): ({f ij,f j },x i ) EPI NC * For all f ij a b f ij (a,b) + f j (b) = 0 (full support) w v v w C =0 T= x z 1 1 That’s our starting point! No termination !!!
Mars 2006Math CSP Workshop Oxford23 0 Arc Consistency (AC * ): ({f ij },x i ) EPI NC * For all f ij a b f ij (a,b)= 0 b is a support complexity: O(n 2 d 3 ) w v v w w C =C = T= x y z
Mars 2006Math CSP Workshop Oxford24 Confluence is lost Finding an AC closure that maximizes the lb is an NP- hard problem [CS]
Mars 2006Math CSP Workshop Oxford25 Directional AC (DAC * ): ({f ij,f j },x i ) i<j EPI NC * For all f ij (i<j) a b f ij (a,b) + f j (b) = 0 b is a full-support complexity: O(ed 2 ) and it solves trees.
Mars 2006Math CSP Workshop Oxford26 Simultaneous AC operations ap. Use rationals for costs. Infinite T. Value a, variable i, cost function f ij. w iaj = cost sent from f i (a) to f ij - from f ij to f i (a). w i = amount sent from f i to f ∅. Max ∑ w i For all (a,i) f i (a) - ∑ j w iaj – w i ≥ 0 For all f ij,a,b f ij (a,b)+ w iaj + w jbi ≥ 0 Solved in pol. time by LP for bounded arities
Mars 2006Math CSP Workshop Oxford27 Extra properties More powerful than any seq. of AC preserving transformation (infinite T) No better equivalent problem with the same scopes (finite costs, infinite T) Quite expensive in practice. Pb nvar/ncostEDACcpu"LPbcpu" ub CELAR06 100/ * CELAR07 200/
Mars 2006Math CSP Workshop Oxford28 Max-Flow as local consistency ? If d=2 (Max-2SAT), the LP is a max-flow problem What if d > 2 ? What if finite T ? Current only tractable language of MaxCSP 2 Monotone (maxSAT) Submodular (maxCSP): solved by a max-flow algorithm Any connection ?
Mars 2006Math CSP Workshop Oxford29 References Tutorial slides on cost function optimization (soft constraints) are available here: An introduction with references is available here.here Rosenfeld, A., Hummel, R., and Zucker, S. (1976). ``Scene labeling by relaxation operations''. IEEE Transactions on Systems, Man and Cybernetics, 6: Valued Constraint Satisfaction Problems: hard and easy problemsT. Schiex, H. Fargier et G. Verfaillie Proc. of the International joint Conference in AI, Montreal, Canada, August Valued Constraint Satisfaction Problems: hard and easy problems Semiring-based CSPs and Valued CSPs: Basic Properties and Comparison. S. Bistarelli, H. Fargier, U. Montanari, F. Rossi, T. Schiex, et G. Verfaillie (LNCS 1106, Selected papers from the Workshop on Over-Constrained Systems at CP'95, reprints and background papers), pages Springer, Semiring-based CSPs and Valued CSPs: Basic Properties and Comparison. Arc consistency for Soft Constraints T. Schiex Proc. of CP'2000. Singapour, September Arc consistency for Soft Constraints Arc consistency for soft constraints, Martin Cooper, Thomas Schiex Artificial Intelligence, Volume 154 (1-2), Avril 2004, Arc consistency for soft constraints High-order consistency in valued constraint satisfaction, M. Cooper. Constraints. 10: , 2005