Search Combinators
Tom Schrijvers
with Guido Tack, Pieter Wuille, Horst Samulowitz, Peter Stuckey
Search Combinators Tom Schrijvers with Guido Tack, Pieter Wuille, - - PowerPoint PPT Presentation
Search Combinators Tom Schrijvers with Guido Tack, Pieter Wuille, Horst Samulowitz, Peter Stuckey Search heuristics are crucial. Support for Search? General Purpose Solver-Provided Programming Language Options everthing is possible,
Tom Schrijvers
with Guido Tack, Pieter Wuille, Horst Samulowitz, Peter Stuckey
General Purpose Programming Language “everthing is possible, nothing is easy” Solver-Provided Options “everything is easy, nothing is possible”
✓ label1(Vars1) , label2(Vars2) ✓ label1(Vars1) ; label2(Vars2) ✓ once(label1(Vars1)) ✓ once((label1(Vars1),label2(Vars2))
✘ lds(label1(Vars1))
✘ lds(label1(Vars1)) ✘ lds((label1(Vars1) , label2(Vars2)))
✘ lds(label1(Vars1)) ✘ lds((label1(Vars1) , label2(Vars2))) ✓ lds_label1(Vars1) ✓ lds_label1_label2(Vars1,Vars2)
specifications
“Everything is possible and easy” High-level modular building blocks
s ≡ int_search(vars,var_sel,val_sel)
prune let(v,e,s) assign(v,e) post(c,s) if(c,s1,s2) and([s1, s2,..., sn])
portfolio([s1, s2,..., sn]) restart(c,s)
depth(v,s) discrepancy(v,s) nodes(v,s) failures(v,s) time(v,s)
depth(v,s) discrepancy(v,s) nodes(v,s) failures(v,s) time(v,s) if(v < 5,depth(v,s1),s2)
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)
limit(c,s) ≡ if(c,s,prune) for(v,l,u,s) ≡ ... lds(s) ≡ for(n,0,∞, limit(discrepancy ≤ n,s) )
,int_search(vars2,...)])
,int_search(vars2,...)]) ...
bab(obj,s) restart_bab(obj,s) dicho(obj,s,lb,ub) id(s) hot_start(c,s1,s2) see paper
bab(k, and([int_search(N,...)] ++ [once(int_search(rowi,...)) | i in 1..n ] ) )
traditional modularity:
atomic unit
search tree node
traditional modularity:
atomic unit
search tree node
monolithic code
★ meaningful and pre-defined set of
interaction points
success failure enter(n) more for every child c push(c) next(n',n)
Details: see paper
success failure enter(n) more for every child c push(c) next(n',n)
Compacte Lus
DSL Haskell C++ Scala
Compact Loop
Zoekheuristiek Compacte Lus
DSL Haskell C++ Scala
Compact Loop Search Spec
Zoekheuristiek Objectcompositie Compacte Lus
DSL Haskell C++ Scala
Compact Loop Search Spec Objects
Interpreted
Zoekheuristiek Objectcompositie Compacte Lus Codegenerators
DSL Haskell C++ Scala
Compact Loop Search Spec Objects
Code Generators
Interpreted Compiled
portfolio prune base search without propagation
n
Worst-case Scenario
100,00% 150,00% 200,00% 250,00% 300,00%
1 2 5 10 20
runtime
#combinators
compiled interpreted
80,00% 100,00% 120,00% 140,00% 160,00% 180,00%
G
b 1 G
b 1 1 G
b 1 2 R a d i
h e r a p y 1 R a d i
h e r a p y 2 R a d i
h e r a p y 3 R a d i
h e r a p y 4 R a d i
h e r a p y 5 J
h
G 2 J
h
H 5 J
h
H 3 J
h
A B Z 1
J
h
m t 1
propagation dwarfs combinator overhead
Gecode Interpreted Compiled
high-level modular modeling of search low-level modular implementation competitive performance compared to hand-coded algorithm
100,00% 150,00% 200,00% 250,00% 300,00%
1 2 5 10 20
runtime
#combinators
compiled interpreted