1 / 61

Soft constraint processing

Soft constraint processing. Thomas Schiex INRA – Toulouse France Pedro Meseguer CSIC – IIIA – Barcelona Spain. Special thanks to: Javier Larrosa UPC – Barcelona Spain. Overview. Introduction and definitions Why soft constraints and dedicated algorithms? Generic and specific models

pegeen
Download Presentation

Soft constraint processing

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. Soft constraint processing Thomas Schiex INRA – Toulouse France Pedro Meseguer CSIC – IIIA – Barcelona Spain Special thanks to: Javier Larrosa UPC – Barcelona Spain

  2. Overview • Introduction and definitions • Why soft constraints and dedicated algorithms? • Generic and specific models • Solving soft constraint problems • By search (systematic and local) • By complete inference… and search • By incomplete inference… and search • Existing implementations ECAI 2004 Tutorial: Constraint processing

  3. Why soft constraints? • CSP framework: for decision problems • Many problems are optimization problems • Economics (combinatorial auctions) • Given a set G of goods and a set B of bids… • Bid (Bi , Vi ), Bi requested goods, Vi value • … find the best subset of compatible bids • Best = maximize revenue (sum) ECAI 2004 Tutorial: Constraint processing

  4. 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) ECAI 2004 Tutorial: Constraint processing

  5. Why soft constraints • Multiple sequence alignment (DNA,AA) • Given k homologous sequences… • AATAATGTTATTGGTGGATCGATGA • ATGTTGTTCGCGAAGGATCGATAA • … find the best alignment (sum) • AATAATGTTATTGGTG---GATCGATGATTA • ----ATGTTGTTCGCGAAGGATCGATAA--- ECAI 2004 Tutorial: Constraint processing

  6. 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) ECAI 2004 Tutorial: Constraint processing

  7. Why soft constraints? • Ressource allocation (frequency assignment) • Given a telecommunication network • …find the best frequency for each communication link • Best can be: • Minimize the maximum frequency (max) • Minimize the global interference (sum) ECAI 2004 Tutorial: Constraint processing

  8. Why soft constraints • Even in decision problems, the user may have preferences among solutions. • It happens in most real problems. Experiment: give users a few solutions and they will find reasons to prefer some of them. ECAI 2004 Tutorial: Constraint processing

  9. Overview • Introduction and definitions • Why soft constraints and dedicated algorithms? • Generic and specific models • Solving soft constraint problems • By search (systematic and local) • By complete inference… and search • By incomplete inference… and search • Existing implementations ECAI 2004 Tutorial: Constraint processing

  10. Soft constraints • Two new difficulties: • How to express preferences in the model? • How to solve the resulting optimization problem? ECAI 2004 Tutorial: Constraint processing

  11. Solving soft constraints as a CSP • Using a global criteria constraint • New constraint Sk on all X • Sk(X) = criteria value must be more than k • Number of variables having value blue • Apply: n-ary constraint Inefficient!! k := n Repeat solve the original problem  Sk(X) k:=k-1; Until solution ECAI 2004 Tutorial: Constraint processing

  12. Combined local preferences • Constraints are local cost functions • Costs combine with a dedicated operator • max: priorities • +: additive costs • *: factorized probabilities… • Goal: find an assignment with the optimal combined cost  Fuzzy/min-max CSP Weighted CSP Probabilistic CSP, BN ECAI 2004 Tutorial: Constraint processing

  13. Soft constraint network • (X,D,C) • X={x1,..., xn} variables • D={D1,..., Dn} finite domains • C={c1,..., ce} cost functions • var(ci) scope • ci(t): E (ordered cost domain, T, ) • Obj. Function: F(X)= ci (X) • Solution: F(t)  T • Soft CN: find minimal cost solution annihilator identity • commutative • associative • monotonic ECAI 2004 Tutorial: Constraint processing

  14. Valued CSP and Semiring CSP Semiring CSP Valued CSP (total order) ECAI 2004 Tutorial: Constraint processing

  15. Specific frameworks • E = {t,f}  = and classical CSP • E = [0,1]  = max  fuzzy CSP • E = N   = + weighted CSP • E = [0,1]  = * bayesian net Lexicographic CSP, probabilistic CSP… ECAI 2004 Tutorial: Constraint processing

  16. Weighted CSP example ( = +) For each vertex x3 x1 x2 x4 For each edge: x5 F(X): number of non blue vertices ECAI 2004 Tutorial: Constraint processing

  17. Fuzzy constraint network (=max) For each vertex x3 x1 x2 x4 Connected vertices must have different colors x5 F(X): highest color used (b<g<r<y) ECAI 2004 Tutorial: Constraint processing

  18. Some insight in unusual items • T = maximum violation. • Can be set to a bounded max. violation k • Solution: F(t) < k = Top • Empty scope soft constraint c (a constant) • Gives an obvious lower bound on the optimum • If you do not like it: c =  Additional expression power ECAI 2004 Tutorial: Constraint processing

  19. Weighted CSP example ( = +) For each vertex T=6 T=3 x3 c = 0 x1 x2 x4 For each edge: x5 F(X): number of non blue vertices Optimal coloration with less than 3 non-blue ECAI 2004 Tutorial: Constraint processing

  20. Microstructural graph b g r x3 0 1 1 6 6 6 x1 x4 0 1 1 0 1 1 0 1 1 x2 T=6 c=0 x5 0 1 1 ECAI 2004 Tutorial: Constraint processing

  21. Basic operations on cost functions • Assignment (conditioning) • Combination (join) • Projection (elimination) ECAI 2004 Tutorial: Constraint processing

  22. Assignment (conditioning) Assign(c,xi,b) f(xj) Assign(f,xj,g) h ECAI 2004 Tutorial: Constraint processing

  23. Combination (join with )  = 0  6 ECAI 2004 Tutorial: Constraint processing

  24. Projection (elimination) Min Elim(c,xj) Elim(f,xi) 0 0 2 0 ECAI 2004 Tutorial: Constraint processing

  25. Overview • Introduction and definitions • Why soft constraints and dedicated algorithms? • Generic and specific models • Solving soft constraint problems • By search (systematic and local) • By complete inference… and search • By incomplete inference… and search • Existing implementations ECAI 2004 Tutorial: Constraint processing

  26. Systematic search Each node is a soft constraint subproblem variables (LB) Lower Bound = c under estimation of the best solution in the sub-tree c If  UB then prune LB = T (UB) Upper Bound = best solution so far ECAI 2004 Tutorial: Constraint processing

  27. Assigning x3 x3 x1 x2 x4 x5 x1 x2 x4 x1 x2 x4 x1 x2 x4 x5 x5 x5 ECAI 2004 Tutorial: Constraint processing

  28. Assign g to X 4 3 g b r x3 0 1 1 6 6 g b r 6 x1 x4 0 T 1 1 0 T 1 1 x2 0 1 1 T T=6 T 1 0 c= Backtrack x5 0 1 1 ECAI 2004 Tutorial: Constraint processing

  29. Depth First Search (DFS) BT(X,D,C) if (X=) then Top :=c else xj := selectVar(X) forallaDjdo cC s.t. xjvar(c)c:=Assign(c, xj ,a) c:= cC s.t. var(c)= c if (LB<Top) then BT(X-{xj},D-{Dj},C) Heuristics Improve LB Good UB ASAP ECAI 2004 Tutorial: Constraint processing

  30. Improving the LB • Assigned constraints (c) • Original constraints Solve Optimal cost  c • Gives a stronger LB • Can be solved beforehand ECAI 2004 Tutorial: Constraint processing

  31. Russian Doll Search • static variable ordering • solves increasingly large subproblems • uses previous LB recursively • May speedup search by several orders of magnitude X1 X2 X3 X4 X5 ECAI 2004 Tutorial: Constraint processing

  32. Local search Based on perturbation of solutions in a local neighborhood • Simulated annealing • Tabu search • Variable neighborhood search • Greedy rand. adapt. search (GRASP) • Evolutionary computation (GA) • Ant colony optimization… • See: Blum & Roli, ACM comp. surveys, 35(3), 2003 ECAI 2004 Tutorial: Constraint processing

  33. Boosting Systematic Search with Local Search • Do local search prior systematic search • Use best cost found as initial T • If optimal, we just prove optimality • In all cases, we may improve pruning Local search (X,D,C) Sub-optimal solution time limit ECAI 2004 Tutorial: Constraint processing

  34. Boosting Systematic Search with Local Search • Ex: Frequency assignment problem • Instance: CELAR6-sub4 • #var: 22 , #val: 44 , Optimum: 3230 • Solver: toolbar with default options • UB initialized to 100000  3 hours • UB initialized to 3230  1 hour • Local search can find the optimum in a few minutes ECAI 2004 Tutorial: Constraint processing

  35. Overview • Introduction and definitions • Why soft constraints and dedicated algorithms? • Generic and specific models • Solving soft constraint problems • By search (systematic and local) • By complete inference… and search • By incomplete inference… and search • Existing implementations ECAI 2004 Tutorial: Constraint processing

  36. Variable elimination (aka bucket elimination) • Solves the problem by a sequence of problem transformations • Each step yields an equivalent problem with one less variable • When all variables have been eliminated, the problem is solved • Optimal solutions of the original problem can be recomputed ECAI 2004 Tutorial: Constraint processing

  37. Variable elimination • Select a variable Xi • Compute the set Ki of constraints that involves this variable • Add Elim( ) • Remove variable and Ki • Time: (exp(degi+1)) • Space: (exp(degi)) X1 X5 C X4 X2 X3 ECAI 2004 Tutorial: Constraint processing

  38. Variable elimination • Time: exponential in the size of the largest combination performed (1+induced width) • Space: similar ! • Infeasible as a general method… ECAI 2004 Tutorial: Constraint processing

  39. Boosting search with variable elimination: BB-VE(k) • At each node • Select an unassigned variable Xi • If degi ≤ k then eliminate Xi • Else branch on the values of Xi • Properties • BE-VE(-1) is BB • BE-VE(w*) is VE • BE-VE(1) is like cycle-cutset ECAI 2004 Tutorial: Constraint processing

  40. Example BB-VE(2) ECAI 2004 Tutorial: Constraint processing

  41. Example BB-VE(2) c c c ECAI 2004 Tutorial: Constraint processing

  42. Boosting search with variable elimination • Ex: still-life (academic problem) • Instance: n=14 • #var:196 , #val:2 • Ilog Solver  5 days • Variable Elimination  1 day • BB-VE(18)  2 seconds ECAI 2004 Tutorial: Constraint processing

  43. Overview • Introduction and definitions • Why soft constraints and dedicated algorithms? • Generic and specific models • Solving soft constraint problems • By search (systematic and local) • By complete inference… and search • By incomplete inference… and search • Existing implementations ECAI 2004 Tutorial: Constraint processing

  44. Local consistency • Local property enforceable in polynomialtime yielding an equivalent and more explicit problem • Massive local (incomplete) inference • Very useful in classical CSP • Node consistency • Arc consistency… ECAI 2004 Tutorial: Constraint processing

  45. Classical arc consistency (binary CSP) • for any Xi and cij • f=Elim(cij ci cj,Xj) brings no new information on Xi cij ci cj v v T 0 0 Elim xj T 0 w w 0 T i j ECAI 2004 Tutorial: Constraint processing

  46. Arc consistency and soft constraints • for any Xi and cij • f=Elim(cij ci cj,Xj) brings no new information on Xi cij ci cj v v 2 0 0 Elim xj 1 0 w w 0 1 i j EQUIVALENCE LOST …unless idempotent (fuzzy CSP) ECAI 2004 Tutorial: Constraint processing

  47. A parenthesis…Why min-max (fuzzy) CSP is easy • A new operation on soft constraints: • The -cut of a soft constraint c is the hard constraint c that forbids t iff c(t) >  • Can be applied to a whole soft CN Cut(c, 0.4) ECAI 2004 Tutorial: Constraint processing

  48. Solving a min-max CSP by slicing • Let S be the set of all optimal solutions of a min-max CN • Let  be the maximum  s.t. the -cut is consistent. Then S is the set of solutions of the -cut. • A min-max (or fuzzy) CN can be solved in O(log(# different costs)) CSP. • Can be used to lift polynomial classes Binary search ECAI 2004 Tutorial: Constraint processing

  49. Back to Weighted CSP andArc consistency • for any Xi and cij • f=Elim(cij ci cj,Xj) brings no new information on Xi cij ci cj v v 2 0 0 Elim xj 1 0 w w 0 1 i j EQUIVALENCE LOST …unless idempotent (fuzzy CSP) ECAI 2004 Tutorial: Constraint processing

  50. A new operation on soft networks • Projection of cij on Xi with compensation • Equivalence preserving transformation • Can be reversed • Requires the existence of a pseudo difference (a b)  b = a v v 1 0 0 0 0 w w 1 i j ECAI 2004 Tutorial: Constraint processing

More Related