1 / 67

I am Patrick Prosser I am a senior lecturer at Glasgow I teach AF2 & CP4 I am a member of

(baby) Bio. I am Patrick Prosser I am a senior lecturer at Glasgow I teach AF2 & CP4 I am a member of the algorithms group the apes (distributed, not disbanded) I am a Glaswegian. This is all that I am allowed to tell you. 10 years of conflict-directed backjumping.

palmer
Download Presentation

I am Patrick Prosser I am a senior lecturer at Glasgow I teach AF2 & CP4 I am a member of

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. (baby) Bio • I am Patrick Prosser • I am a senior lecturer at Glasgow • I teach AF2 & CP4 • I am a member of • the algorithms group • the apes (distributed, not disbanded) • I am a Glaswegian This is all that I am allowed to tell you

  2. 10 years of conflict-directed backjumping

  3. Patrick Prosser CI 9(4)Hybrid Algorithms for the Constraint Satisfaction Problem • Still using that old greasy stuff? • Who cares? • So?

  4. Plan of the talk • What’s a csp? • The simplest algorithm (BT) and its behaviour • Some improvements (BJ, GBJ) • A better way (CBJ) • Improvements to CBJ • Strange things about CBJ • k-inconsistencies • the bridge and the long jump • value ordering and insolubility • So, what about CBJ? • some say its good • some say it’s a waste of time • who’s using it • who’s not using • Where’s it going • QBF?

  5. What’s a csp? <V,D,C> • a set of variables • each with a domain of values • a collection of constraints (I’m going to assume binary) • assign each variable a value from its domain to satisfy the constraint

  6. Example of a csp A B E C D H F G 3 colour me!

  7. Example of a csp A B E C D H F G

  8. A B E C D H F G Example of a csp Variables and Instantiation Order Checking back Va Vb Vc Vd Ve Vf Vg Vh 1 = red 2 = blue 3 = green

  9. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  10. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  11. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  12. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  13. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  14. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  15. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  16. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  17. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  18. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  19. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  20. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  21. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  22. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  23. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G Why did it do that? That was dumb! 1 = red 2 = blue 3 = green

  24. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  25. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  26. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  27. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  28. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  29. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  30. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  31. Example of a csp Variables and Instantiation Order Checking back A B Va Vb Vc Vd Ve Vf Vg Vh E C D H F G 1 = red 2 = blue 3 = green

  32. That was good old fashioned chronological backtracking • instantiate a variable • check current against past variables to see if okay • current? past? Future? • If not okay try another value • If no values left go back to previous variable

  33. Example of a csp What would have happened if we had the E* intermediate variables? i.e. it falls back on E4, then E3, towards E? A B E C D E1 H E2 F G E3 1 = red 2 = blue 3 = green E4

  34. It’s all just depth first search, right?

  35. BT Thrashes! past variable v[h] past conflict with v[h] current variable v[i] future future variable v[j]

  36. BT Assume that when we instantiate the current variable v[i] we check against all past variables from v[1] to v[i-1] to check if consistent consistent := false for x in domain[i] while not(consistent) // find a consistent value begin consistent := true v[i] := x for h in (1 .. i-1) while consistent // check backwards begin consistent := (check(v[i],v[h]) end if not(consistent) then delete(x,domain[i]) end // did we find a good value?

  37. John Gaschnig’s BJ Make a small modification to BT. Remember the last variable we check against consistent := false maxCheck[i] := 0 for x in domain[i] while not(consistent) // find a consistent value begin consistent := true v[i] := x for h in (1 .. i-1) while consistent // check backwards begin consistent := (check(v[i],v[h]) maxCheck := max(h,maxCheck[i]) end if not(consistent) then delete(x,domain[i]) end // did we find a good value? If the loop terminates with consistent false then jump back to v[h], where h := lastCheck[i] This is then the deepest variable we failed against

  38. John Gaschnig’s BJ consistent := false maxCheck[i] := 0 for x in domain[i] while not(consistent) // find a consistent value begin consistent := true v[i] := x for h in (1 .. i-1) while consistent // check backwards begin consistent := (check(v[i],v[h]) maxCheck := max(h,maxCheck[i]) end if not(consistent) then delete(x,domain[i]) end // did we find a good value? If the loop terminates with consistent true ... lastCheck[i] = i-1 we then step back! BJ jumps then steps back. It can only jump after it has moved forwards!

  39. BJ reduces thrashing maxCheck[i] 0 1 2 3 4 1 2 3 4 5 4 6 Jump back to v[4] then step back

  40. Rina Dechter’s GBJ Graph-based backjumping, exploits topology of constraint graph If there are no values remaining for v[i] Jump back to v[h], where v[h] is the deepest variable connected to v[i] in the constraint graph If there are no values remaining for v[h] Jump back to v[g], where v[g] is the deepest variable connected to v[h] or v[i] in the constraint graph If there are no values remaining for v[g] Jump back to v[f], where v[f] is the deepest variable connected to v[g] or v[h] or v[i] in the constraint graph What happens if constraint graph is a clique?

  41. We want something that can jump and jump again, something that takes into consideration what caused a dead-end, not something that just looks at the topology of the constraint graph Combine BJ and GBJ

  42. CBJ Remember your conflicts, and when you have used them forget them. • When we instantiate v[i] := x and • check(v[i],v[h]) and • it fails • v[i] is in conflict with v[h] • add h to the set confSet[i] confSet[i] is then the set of past variables that conflict with values in the domain of v[i]

  43. CBJ Conflict-directed backjumping, exploits failures within the search process If there are no values remaining for v[i] Jump back to v[h], where v[h] is the deepest variable in conflict with v[i] The hope: re-instantiate v[h] will allow us to find a good value for v[i] If there are no values remaining for v[h] Jump back to v[g], where v[g] is the deepest variable in conflict with v[i] or v[h] The hope: re-instantiate v[g] will allow us to find a good value for v[i] or a good value for v[h] that will be good for v[i] If there are no values remaining for v[g] Jump back to v[f], where v[f] is the deepest variable in conflict with v[i] or v[h] or v[g] The hope: re-instantiate v[f] will allow us to find a good value for v[i] or a good value for v[h] that will be good for v[i] or a good value for v[g] that will be good for v[h] and v[i] What happens if: constraint graph is dense, tight, or highly consistent?

  44. CBJ consistent := false confSet[i] := {0} for x in domain[i] while not(consistent) // find a consistent value begin consistent := true v[i] := x for h in (1 .. i-1) while consistent // check backwards begin consistent := (check(v[i],v[h]) if not(consistent) then confSet[i] := confSet[i]  {h} end if not(consistent) then delete(x,domain[i]) end

  45. CBJ When jumping back from v[i] to v[h] update conflict sets confSet[h] := confSet[h]  confSet[i] \ {h} confSet[i] := {0} That is, when we jump back from v[h] jump back to a variable that is in conflict with v[h] or with v[i] Throw away everything you new on v[i] Reset all variables from v[h+1] to v[i] (i.e. domain and confSet)

  46. CBJ 1 2 conflict set 3 4 {2,0} 5 {4,1,0} 6

  47. CBJ 1 2 conflict set 3 4 {2,1,0} 5 6

  48. CBJ (reduce thrashing) 1 2 3 4 {2,1,0} 5 6 Jump back to deepest past variable in confSet (call it h) and then combine confSet[i] with confSet[h] • History: • Konkrat and V Beek, • Gent and Underwood

More Related