1 / 45

Acknowledgements

Towards theoretical frameworks for comparing constraint satisfaction models and algorithms Peter van Beek, University of Waterloo CP 2001 · Paphos, Cyprus November 2001. Acknowledgements. Joint work with: Fahiem Bacchus Xinguang Chen Grzegorz Kondrak Toby Walsh.

zayit
Download Presentation

Acknowledgements

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. Towards theoretical frameworks for comparing constraint satisfaction models and algorithmsPeter van Beek, University of WaterlooCP 2001 · Paphos, CyprusNovember 2001

  2. Acknowledgements • Joint work with: • Fahiem Bacchus • Xinguang Chen • Grzegorz Kondrak • Toby Walsh 2

  3. Constraint programming methodology • Model problem • specify in terms of constraints on acceptable solutions • define/choose constraint model: variables, domains, constraints • Solve model • define/choose algorithm • define/choose heuristics • Verify and analyze solution 3

  4. Previous work • Many models, algorithms, and heuristics proposed • Choice of model, algorithm, and heuristic can greatly influence efficiency • (e.g., Nadel, 1990; Ginsberg et al., 1990; Frost and Dechter, 1994; Tsang et al., 1995 Smith et al., 2000; Beacham et al., 2001) 4

  5. Empirical studies benchmark sets random problems Theoretical studies worst case average case (e.g. Brown & Purdom, 1981; Nadel, 1983; Wilf, 1984) pair-wise comparisons partial orders bounded worse Performance measures nodes visited constraint checks CPU time How to compare? 5

  6. Part I • Comparing backtracking algorithms 6

  7. Some backtracking algorithms • Chronological Backtracking (BT) • Backjumping (BJ) (Gaschnig, 1978) • Conflict-Directed Backjumping (CBJ) (Prosser, 1993) • Forward Checking (FC) (Haralick & Elliott, 1980; McGregor, 1979) • Maintaining arc consistency (MAC) (Haralick & Elliott, 1980; McGregor, 1979; Sabin & Freuder, 1994) 7

  8. x1 x2 x3 x4 1 2 3 4 Example: 4-queens xi xjand | xi - xj | | i- j| 8

  9. Search tree for 4-queens x1 1 2 3 4 x2 x3 x4 (1,1,1,1) (2,4,1,3) (3,1,4,2) (4,4,4,4) 9

  10. x1 x2 x3 x4 1 2 {x1  1} 3 {x1  1,x2  3 ,x4  2} 4 {x1  1,x2  3} Backjumping Q x1 Q x2 x1 Q x2 x3 10

  11. “New” algorithms: BJ1, …, BJn • BJk : • allowed to backjump at most k times from a leaf • after that it must chronologically backtrack • Special cases: • BJ1 equivalent to BJ • BJn equivalent to CBJ 11

  12. x1 x2 x3 x4 1 2 3 4 k-consistency • Given • any k-1 distinct variables, • any consistent assignment to those variables, • any additional variable x • there exists a consistent assignment to x 1-consistent ? Q yes 2-consistent ? yes 3-consistent ? Q no strongly 2-consistent 12

  13. Induced CSP Unary constraints x3 1, 3, 4 x4 1, 2, 4 x1 x2 x3 x4 1 Binary constraints x3 x4 |x3 - x4|  1 2 3 4 Maintaining consistency { x1  1,x2  4 } Q Q 13

  14. { x1  1,x2  4 } Unary constraints x3 1, 3, 4 x4 1, 2, 4 x1 x2 x3 x4 1 Binary constraints x3 x4 |x3 - x4|  1 2 3 4 Maintaining consistency FC: strong 1-consistency Q Q 14

  15. { x1  1,x2  4 } Unary constraints x3 1, 3, 4 x4 1, 2, 4 x1 x2 x3 x4 1 Binary constraints x3 x4 |x3 - x4|  1 2 3 4 Maintaining consistency MAC: strong 2-consistency Q Q Q Q 15

  16. “New” algorithms: MC1, …, MCn • MCk : • maintains strong k-consistency on induced CSP at each node in backtrack tree • Special cases: • MC1 equivalent to FC • MC2equivalent to MAC for binary CSPs 16

  17. Proposal: for all CSP models for all variable orderings algorithm a1 algorithm a2 Desirable features: still holds if use best possible CSP model for a2 still holds if use best possible variable ordering for a2 Comparing backtracking algorithms 17

  18. Theoretical methodology • Using local consistency concepts: • formulate necessary and sufficient conditions for a node to be visited by a backtracking algorithm • Using conditions: • construct partial orders of the algorithms 18

  19. x1 x2 x3 x4 1 {x1  1} 2 3 {x1  1,x2  4} ? 4 Example sufficient condition: FC • If a node is consistent and its parent is strongly 1-consistent, then FC visits the node Q Q 19

  20. x1 x2 x3 x4 1 {x1  1} 2 3 {x1  1,x2  4} ? 4 Example necessary condition: MAC-CBJ • If MAC-CBJ visits a node, then it is consistent and its parent is strongly 2-consistent Q 20

  21. Example conclusion: MAC-CBJ vs FC MAC-CBJ visits p  p is consistent and parent(p) strongly 2-consistent  p is consistent and parent(p) strongly 1-consistent  FC visits p 21

  22. MCk-CBJ MCk BJk BJk+1 MCk+1-CBJ MCk+1 BT MC1-CBJ MC1 BJ1 MCn-CBJ BJn MCn . . . . . . Partial order for nodes visited . . . . . . . . . . . . 22 less than or equal

  23. MCk-CBJ BJk MCk+1-CBJ MCk+1 MC1-CBJ MC1 BJ1 BT MCn-CBJ BJn MCn . . . . . . Partial order for nodes visited . . . . . . BJk+1 MCk . . . . . . 23 incomparable

  24. . . . . . . BJk+1 MCk+1 BJk MCk+1-CBJ MCk MCk-CBJ . . . . . . BT MC1-CBJ BJ1 MC1 MCn-CBJ BJn MCn . . . . . . Partial order for nodes visited 24 incomparable

  25. BJk MCk+1 BT BJ1 MC1 MCn BJn . . . . . . Partial order for nodes visited MCn-CBJ . . . . . . BJk+1 MCk+1-CBJ MCk MCk-CBJ . . . . . . MC1-CBJ 25 incomparable

  26. MCk-CBJ MCk+1-CBJ MCk+1 MC1-CBJ MC1 BT MCn-CBJ MCn CBJ . . . . . . Partial order for nodes visited . . . MCk . . . 26

  27. MAC-CBJ MAC BJ2 CBJ FC-CBJ FC BT Closer look: nodes visited, binary CSPs less than or equal BJ 27

  28. MAC-CBJ MAC BJ2 CBJ BJ FC-CBJ FC BT Closer look: constraint checks, binary CSPs less than or equal at most O(f) more O(n2d2) O(nd) O(nd) 28

  29. O(nd) MAC Path O(nd) O(nd) FC BT Experiments: lookahead 29

  30. x2 x1 xn Example: FC vs MAC variables: x1, …, xn, n odd Odd-even relation domains: {1, 2, 3, 4} ... FC: 2n+1 - 4 MAC: 4 Adapted from J. Ullman (1988); suggested by D. De Haan 30

  31. MC3 MC4 MC2 MC1 Increasing lookahead Time (sec.) to solve 6 x 6 puzzles 31

  32. FC-CBJ FC Experiments: lookback 32

  33. MAC-CBJ MAC O(nd) O(nd) FC-CBJ FC CBJ BT Experiments: lookahead vs lookback • Increasing the level of consistency decreases effectiveness of CBJ • Prosser (1993) • Bacchus & van Run (1995) • Bessiere & Regin (1996) • MAC muchbetter than FC-CBJ • MAC better than MAC-CBJ “CBJ becomes useless” • Jussien, Debruyne, Boizumault (2000) • MAC-DBT muchbetter than MAC (binary) • Chen & van Beek (2001) • MGAC-CBJ muchbetter than MAC (non-binary) 33

  34. BJk+1 MCk-CBJ BJk MCk+1-CBJ MCk+1 MCk Theory: lookahead vs lookback BJk+1 better only if there exists a (k+1)-level backjump that is not a chronological backtrack Number of (k+1)-level backjumps  number of k-level backjumps Therefore, as k increases, effectiveness of backjumping decreases 34

  35. Part II • Comparing CSP models 35

  36. Conversion to binary • Any non-binary CSP can be converted into one with only binary constraints • dual graph method • (Dechter & Pearl, 1989; Rossi et al. 1989) • hidden variable method • (Peirce, 1933; Rossi et al. 1989; Dechter 1990) 36

  37. Crossword puzzles 1 2 3 4 5 a aardvark aback abacus abaft abalone abandon ... Mona Lisa monarch monarchy monarda ... zymurgy zyrian zythum 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 37

  38. Non-binary model (original) • variables: one for each unknown letter (cell) • domains: ‘a’, …, ‘z’ • constraints: contiguous letters must form words in dictionary 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 38

  39. Dual model (binary) • variables: one for each unknown word across and down • domains: words from dictionary • constraints intersecting words must agree on common letter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 39

  40. Hidden model (binary) • variables: one for each unknown letter (cell) and one for each unknown word across and down • domains: letters, words • constraints: letter and word variable must agree 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 40

  41. One proposal: for all backtracking algorithms for all variable orderings model m1 model m2 Objections: effectiveness of a model is algorithm dependent models may contain different variables • Another proposal: given backtrack algorithm for all v2 for m2 there exists a v1 for m1 s. t. model m1 model m2 Comparing models • Desirable features: • meets objections • still holds if use best possible variable ordering for m2 41

  42. Theoretical methodology • Bound difference in number of nodes visited • compare pruning power of local consistencies of alternative models (e.g., Debruyne & Bessiere, 1997; Stergiou & Walsh, 1999; Prosser et al., 2000; Walsh, 2000) • establish correspondence between nodes • Bound difference in cost at each node: • local consistency • variable ordering 42

  43. Some relationships MGAC-hidden MGAC-orig MGAC-dual FC-hidden FC-orig FC-dual BT-hidden BT-orig BT-dual 43 polynomial not polynomial

  44. Part III • Comparing variable ordering heuristics Future work 44

  45. Conclusion • Technical: • comparing backtracking algorithms • partial order • comparing CSP models • bounded worse relation on algorithm-model combinations • Big picture: • theory can guide, inform experimentation 45

More Related