Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00%...
Transcript of Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00%...
![Page 1: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/1.jpg)
Search CombinatorsTom Schrijvers
with Guido Tack, Pieter Wuille, Horst Samulowitz, Peter Stuckey
![Page 2: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/2.jpg)
Search heuristics are crucial.
![Page 3: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/3.jpg)
Support for Search?General Purpose
Programming Language
“everthing is possible, nothing is easy”
Solver-ProvidedOptions
“everything is easy, nothing is possible”
![Page 4: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/4.jpg)
State-of-the-Art Modularity: Prolog
✓ label1(Vars1) , label2(Vars2)
✓ label1(Vars1) ; label2(Vars2)
✓ once(label1(Vars1))
✓ once((label1(Vars1),label2(Vars2))
![Page 5: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/5.jpg)
Lack of Modularity
✘ lds(label1(Vars1))
![Page 6: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/6.jpg)
Lack of Modularity
✘ lds(label1(Vars1))
✘ lds((label1(Vars1) , label2(Vars2)))
![Page 7: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/7.jpg)
Lack of Modularity
✘ lds(label1(Vars1))
✘ lds((label1(Vars1) , label2(Vars2)))
✓ lds_label1(Vars1)
✓ lds_label1_label2(Vars1,Vars2)
![Page 8: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/8.jpg)
Can we do better?
✓Lots of expressivity and flexibility
✓Lots of productivity through high-level specifications
✓Modular reuse of search specifications
![Page 9: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/9.jpg)
Yes: Search Combinators
“Everything is possible and easy”
High-level modular building blocks
![Page 10: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/10.jpg)
Base Search
s ≡ int_search(vars,var_sel,val_sel)
• provided by the solver• augment with combinators
![Page 11: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/11.jpg)
Combinatorsprunelet(v,e,s)assign(v,e)post(c,s)if(c,s1,s2)and([s1, s2,..., sn])or([s1, s2,..., sn])portfolio([s1, s2,..., sn])restart(c,s)
![Page 12: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/12.jpg)
Statistics Combinators
depth(v,s)discrepancy(v,s)
nodes(v,s)failures(v,s)time(v,s)
![Page 13: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/13.jpg)
Statistics Combinators
depth(v,s)discrepancy(v,s)
nodes(v,s)failures(v,s)time(v,s)
if(v < 5,depth(v,s1),s2)
![Page 14: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/14.jpg)
Statistics Combinators
depth(v,s)discrepancy(v,s)
nodes(v,s)failures(v,s)time(v,s)
if(v < 5,depth(v,s1),s2)if(depth < 5,s1,s2)
![Page 15: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/15.jpg)
Reusable Abstractionslimit(c,s) ≡ if(c,s,prune)
for(v,l,u,s) ≡ ...
lds(s) ≡ for(n,0,∞, limit(discrepancy ≤ n,s) )
![Page 16: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/16.jpg)
Reuse Examples
✓lds(int_search(vars,...))
✓lds(and([int_search(vars1,...) ,int_search(vars2,...)])
✓lds(or([int_search(vars1,...) ,int_search(vars2,...)])...
![Page 17: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/17.jpg)
More Abstractionsbab(obj,s)
restart_bab(obj,s)
dicho(obj,s,lb,ub)
id(s)
hot_start(c,s1,s2) see paper
![Page 18: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/18.jpg)
Radiotherapy Planning
bab(k, and([int_search(N,...)] ++ [once(int_search(rowi,...)) | i in 1..n ] ) )
![Page 19: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/19.jpg)
ModularSyntax
vs.
SemanticsModular
![Page 20: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/20.jpg)
Modular Semantics
traditional modularity:• each combinator is an atomic unit• minimal interaction
search treenode
![Page 21: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/21.jpg)
Modular Semantics
traditional modularity:• each combinator is an atomic unit• minimal interaction
search treenode
![Page 22: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/22.jpg)
Modular Semantics
• cross-cutting behavior
• highly entangled in monolithic code
➡ “Aspect-Oriented Programming”
![Page 23: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/23.jpg)
Functional Mixin Inheritance
• disciplined form of AOP
★ meaningful and pre-defined set of interaction points
• no AOP system needed
![Page 24: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/24.jpg)
Mixin-based Interaction
successfailure
enter(n)
more
for every child c
push(c)next(n',n)
![Page 25: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/25.jpg)
Mixin-based Interaction
Details:see paper
successfailure
enter(n)
more
for every child c
push(c)next(n',n)
![Page 26: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/26.jpg)
Implementations
Compacte Lus
DSL Haskell C++ Scala
Compact Loop
![Page 27: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/27.jpg)
Implementations
Zoekheuristiek Compacte Lus
DSL Haskell C++ Scala
Compact LoopSearch Spec
![Page 28: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/28.jpg)
Implementations
Zoekheuristiek
Objectcompositie
Compacte Lus
DSL Haskell C++ Scala
Compact LoopSearch Spec
Objects
Interpreted
![Page 29: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/29.jpg)
Implementations
Zoekheuristiek
Objectcompositie
Compacte LusCodegenerators
DSL Haskell C++ Scala
Compact LoopSearch Spec
Objects
Code Generators
Interpreted
Compiled
![Page 30: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/30.jpg)
Combinator Overhead?
portfolio
prune
base searchwithout
propagation
n
Worst-case Scenario
100,00%
150,00%
200,00%
250,00%
300,00%
1 2 5 10 20
runtim
e
#combinators
compiled interpreted
![Page 31: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/31.jpg)
80,00%
100,00%
120,00%
140,00%
160,00%
180,00%
Golom
b 10
Golom
b 11
Golom
b 12
Radio
ther
apy 1
Radio
ther
apy 2
Radio
ther
apy 3
Radio
ther
apy 4
Radio
ther
apy 5
Job-s
hop G2
Job-s
hop H5
Job-s
hop H3
Job-s
hop ABZ1-
5
Job-s
hop mt1
0
In Practicepropagation dwarfs combinator overhead
Gecode Interpreted Compiled
![Page 32: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/32.jpg)
Summary
high-level modular modeling of search
low-level modular implementation
competitive performance compared to hand-coded algorithm
![Page 33: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/33.jpg)
Future Work
• Optimizations
• MiniZinc integration
• Combinators for parallel search
• Extend other solving technology (e.g., LP)
➡ Combinators for hybrid search
![Page 34: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/34.jpg)
Thank You!
![Page 35: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/35.jpg)
![Page 36: Search Combinatorshorst/cogrobo/papers/cp2011_search... · 2011. 10. 10. · 80,00% 100,00% 120,00% 140,00% 160,00% 180,00% Golomb 10 Golomb 11 Golomb 12 Radiotherapy 1 Radiotherapy](https://reader033.fdocuments.net/reader033/viewer/2022052018/603107f980e0a62725311f94/html5/thumbnails/36.jpg)
Combinator Overhead
100,00%
150,00%
200,00%
250,00%
300,00%
1 2 5 10 20
runtim
e
#combinators
compiled interpreted