-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathL07-SolvingEncoding.tex
More file actions
1776 lines (1527 loc) · 77.6 KB
/
L07-SolvingEncoding.tex
File metadata and controls
1776 lines (1527 loc) · 77.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% Source: https://github.com/tias/constraint-solving-course
%% Licensed under CC BY-NC-SA 4.0: https://creativecommons.org/licenses/by-nc-sa/4.0/
%% You may share and adapt this for non-commercial use,
%% with attribution and under the same license.
\documentclass{cons-beamer}
\begin{document}
\begin{frame}{L07: Solving technologies and encodings}
\begin{center}
~ \\
\includegraphics[height=42mm, trim=0 50pt 0 50pt, clip]{images/ch6-logo.png} \\
Prof. Tias Guns and Dr. Dimos Tsouros \\[0.5em]
\includegraphics[width=2cm]{images/kuleuven_CMYK_logo.pdf}
\end{center}
{\footnotesize
Partly based on slides from Pierre Flener, Uppsala University.}
% https://pierre-flener.github.io/courses/M4CO/lectures.html
\end{frame}
\begin{frame}{Solvers}
You formulated a combinatorial problem in a high-level modeling language...
\vfill
Now, \textit{which solver} should you use?
\vfill
%Solvers differ in:
%\begin{itemize}
% \item The constraints they support (including global constraints/functions)
% \item The decision variables types they support (Boolean, integer, float, set, ...)
% \item How they perform search and propagation (CP vs MIP vs PB vs SAT)
% \item How they guide the search (heuristics, hyper-parameters)
%\end{itemize}
\end{frame}
\begin{frame}
\begin{examples}[Solving technologies]
With general-purpose solvers, taking model and data as input:
\begin{itemize}
\item Boolean satisfiability (SAT)
\item Pseudo-Boolean solving (PB)
\item (Mixed) Integer Linear Programming (IP and MIP)
\item SAT (resp.\ optimisation) Modulo Theories (SMT and OMT)
\item Constraint programming (CP)
\item \dots
\end{itemize}
\end{examples}
\begin{examples}[Methodologies, \emph{usually without} modelling and solvers]
\begin{itemize}
\item Dynamic programming (DP)
\item Greedy algorithms
\item Local search (LS)
\item Genetic algorithms (GA)
\item \dots
\end{itemize}
\end{examples}
\end{frame}
\begin{frame}{How to Compare Solving Technologies?}
\structured{Specification language:}
\begin{itemize}
\item What types of decision variables are available? % (Bool, int, float, string, ...)
\item What types of constraints are available? % (clause, linear, alldifferent, ...)
\item Can there be an objective function?
\end{itemize}
\vfill
\structured{Guarantees:}
\begin{itemize}
\item Are its solvers \defined{exact}, given enough time: \\ will
they prove unsatisfiability? prove optimality? find all solutions?
\item If not, is there an \defined{approximation} ratio for the
solution quality?
\end{itemize}
\vfill
\structured{Features:}
\begin{itemize}
\item In which application areas has the technology been
successfully used?
\item Does the solving technology align well with this type of problem?
\item Can the modeller influence the search process? If yes, then how?
\end{itemize}
\end{frame}
\begin{frame}{How Do Solvers Work? (Hooker, 2012)}
\begin{definition}[Solving = Search + Inference + Relaxation]
\begin{itemize}
\item \search{Search}: Explore the space of candidate solutions.
\item \inference{Inference}: Reduce the space of candidate solutions.
\item \relaxation{Relaxation}: Exploit solutions to easier problems.
\end{itemize}
\end{definition}
\vfill
\begin{definition}[Systematic \search{Search}]
Progressively build a solution, and backtrack if necessary. \\ Use
\inference{inference} and \relaxation{relaxation} to reduce the
search effort.
\end{definition} \vfill
Systematic search is used in most SMT, CP, ILP/MIP, PB and SAT solvers.
\end{frame}
\begin{frame}{How to model in a specific solvers' input language?}
Every solver has their own input language.
\vfill
Different communities have different 'standard' input languages.
\begin{itemize}
\item SAT: DIMACS format
\item Pseudo-Boolean: OPB format
\item ILP/MIP: MPS format
\item SMT: SMT-LIB format
\end{itemize}
\vspace{1em}
The CP community does not really have a standard input language (due to the large variety of global constraints possible), BUT it has: \\
\textbf{solver-independent modelling languages}
\vfill
How to go from a high-level modelling language to a specific solver input? Through transformations...
\end{frame}
\begin{frame}{From Model to Model to Solver: transformations}
\begin{tikzpicture}[scale=0.8, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=blue!20, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=blue!20, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}{Objectives}
An overview of some solving technologies: \vfill
\begin{itemize}
\item to understand their advantages and limitations; \vfill
\item to help you choose a technology for a particular model; \vfill
\item to help you encode and adapt a model to a particular technology.
\end{itemize}
\end{frame}
\section*{Solvers}
\subsection*{SAT Modulo Theories (SMT)}
% OVERVIEW: SMT solver highlight
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=blue!20, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=blue!20, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, fill=red!30, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}[fragile]{SAT Modulo Theories (SMT) and OMT}
\structured{Modelling Language:}
\begin{itemize}
\item Language of SAT: Boolean decision variables and clauses.
\item Several \defined{theories} extend the language, such as \\ bit vectors,
uninterpreted functions, or linear integer arithmetic.
\item SMT is only for satisfaction problems.
\item OMT (optimisation modulo theories) extends SMT.
\end{itemize}
\begin{definition}
A \defined{theory}
\begin{itemize}
\item defines types for decision variables and defines constraint
predicates;
\item is associated with a sub-solver for any conjunction of its
predicates.
\end{itemize}
\end{definition}
Different SMT or OMT solvers may have different theories.
\end{frame}
\begin{frame}{LIA}
Example: \defined{theory} of Linear Integer Arithmetic (LIA)
(variables can be unbounded for SMT solvers!)
\vfill
\begin{columns}
\begin{column}{0.45\textwidth}
\textbf{Mathematical Formulation}
\begin{align*}
& (x \geq 0)\\
& (y \leq 0) \\
& (x = y + 1) \lor (x = 2 \cdot y) \\
& (x = 2) \lor (y = -2) \lor (x = y)
\end{align*}
\end{column}
\begin{column}{0.45\textwidth}
\textbf{SMT-LIB format}
\begin{align*}
&\texttt{(>= x 0)}\\
&\texttt{(<= y 0)}\\
&\texttt{(or (= x (+ y 1)) (= x (* 2 y)))}\\
&\texttt{(or (= x 2) (= y -2) (= x y))}
\end{align*}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Satisfiability Modulo Theories (SMT)}
\begin{itemize}
%\item Extends \textbf{SAT} (Boolean Satisfiability) by adding rich background \textbf{theories} \\(e.g., arithmetic, arrays, bit-vectors, strings, uninterpreted functions).
\item Determines the satisfiability of a first-order logical formulas over (one or more) background theories
\item if SAT: return SAT + a solution to the \emph{theory} problem\\
if UNSAT: return UNSAT
\item there is a standardized language for many different theories, that all SMT solvers accept: the SMT-LIB language
\end{itemize}
\vfill
\textbf{Typical application areas}
\begin{itemize}
\item {Formal Verification} of hardware and software
\item {Model Checking}, and {Program Analysis}
\item {Automated Reasoning}, {Theorem Proving}
\end{itemize}
\end{frame}
\begin{frame}{Boolean abstraction}
Separate the theory constraints and create the Boolean skeleton
\vfill
Example:
\begin{align*}
& (x \geq 0) \land (y \leq 0) ~\land \\
& \big(~(x = y + 1) \lor (x = 2 \cdot y)~\big) ~\land \\
& \big(~(x = 2) \lor (y = -2) \lor (x = y)~\big)
\end{align*}
Boolean skeleton:
$a \land b \land \big(c \lor d\big) \land \big(e \lor f \lor g\big)$
Theory constraints (each Boolean indicates whether a constraint holds or not):
\begin{align*}
&a \leftrightarrow (x \geq 0) ~\land~ b \leftrightarrow (y \leq 0) ~\land \\
&c \leftrightarrow (x = y + 1) ~\land~ d \leftrightarrow (x = 2 * y) ~\land \\
&e \leftrightarrow (x = 2) ~\land~ f \leftrightarrow (y = -2) ~\land~ g \leftrightarrow (x = y)
\end{align*}
\end{frame}
\begin{frame}{SMT Solving: DPLL($T$\,)}
\textbf{How it Works (High-Level Overview)} $ $\\
Combines a SAT solver with a theory solver.
\begin{itemize}
\item \textbf{SAT solver} generates Boolean assignment over the Boolean skeleton;
\item \textbf{Theory solver} checks consistency of activated theory constraints; \\
\begin{itemize}
\item if SAT: generate theory-level assignment, return
\item if UNSAT: generate Boolean-level \textit{conflict} between theory constraints, add it to the SAT solver
\end{itemize}
\item repeat.
\end{itemize}
\vfill
Theory solvers operate over all (activated) constraints in the theory at once.
Efficient theory solvers are incremental: reuse information from previous checks.
\vfill
Example SMT solvers:
\href{https://cvc4.github.io}{CVC4},
\href{https://yices.csl.sri.com}{Yices 2},
\href{https://github.com/Z3Prover/z3}{Z3}, \dots
Example OMT solvers:
\href{https://optimathsat.disi.unitn.it}{OptiMathSAT},
\href{https://github.com/Z3Prover/z3}{Z3}
\end{frame}
\begin{frame}{SMT/OMT for CP solving}
Theory: QF\_LIA = "Quantifier Free, Linear Integer Arithmetic"
(and QF\_NIA in case of non-linearities)
\vfill
Supports Bool and Int, as well as logical and arithmetic operators; including nested expressions thereof.
\vfill
But no global constraints / global functions:
\begin{itemize}
\item requires to \defined{decompose} global constraints
\end{itemize}
\end{frame}
\subsection*{Transformation: decompose}
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=red!30, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=blue!20, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}{Decomposing global constraints}
\small
Rewrite global constraints using (more) primitive constraints.
\begin{example}
\small
$\cons{AllDifferent}{x_1, \dots, x_n}$:
Its decomposition is a conjunction of
$\frac{n\cdot(n-1)}{2}$ disequality
constraints:
\vspace{-3mm}
\[
\bigwedge_{i, j \in \{1..n\}, i < j} x_i \neq x_j
\]
\end{example}
\begin{example}
\small
\cons{Cumulative}{s,d,r,c}:
Its time-resource decomposition introduces new Booleans \( B_{it} \), representing if task \( i \) (with start time $s_i$, and duration $d_i$) is active at time \( t \):
\vspace{-3mm}
\[
\forall t \in \{0..t_{\text{max}} - 1\}, \forall i \in \{1..n\} : \quad B_{it} \leftrightarrow (s_i \leq t) \land \neg(s_i \leq t - d_i)
\]
The resource constraint at each time \( t \), for $n$ tasks, with $r_i$ being the resource consumption of task $i$, is expressed as:
\vspace{-3mm}
\[
\forall t \in \{0..t_{\text{max}} - 1\} : \quad \sum_{i \in [1..n]} r_i \cdot B_{it} \leq c
\]
\vspace{-3mm}
\end{example}
\end{frame}
\begin{frame}{Decomposing global functions}
\small
The function itself is an integer-valued function. Need to decompose wrt a specific comparison.
\begin{example}
$\cons{Count}{A, v} == res$ (or $\cons{CountEq}{A,v,res}$): Its decomposition is a sum constraint over all variables:
\[
\sum_{i} [ A_i = v ] = res
\]
\end{example}
\begin{example}
$\cons{Element}{Arr, idx} == res$ (or $\cons{ElementEq}{Arr, idx, res}$, or $Arr[idx] == res$): Its decomposition is a list of implications, specifying that if the index has a given value, then the respective value from the array must be equal to the resulting variable $res$:
\[
\forall i \in \{0..n - 1\}, \quad (\text{idx} = i) \rightarrow (\text{Arr}_i \ = \ \text{res})
\]
\end{example}
\end{frame}
\subsection*{Constraint Programming (CP)}
% OVERVIEW: CP solver highlight
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=blue!20, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=blue!20, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, fill=red!30, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}{Constraint Programming (CP)}
\begin{itemize}
\item Solves combinatorial optimisation problems with finite-domain variables
\item Includes logical, arithmetic and specialised \textit{global constraints}
\item Solves both satisfaction and optimisation problems
\end{itemize}
\vfill
\textbf{How it Works (High-Level Overview)} $ $\\
\begin{itemize}
\item \textbf{Propagation} each constraint reduces the domains of the variables involved as much as possible until no domain can be further reduced;
\item \textbf{Systematic search} the solver chooses a variable and branches over each of its remaining values
\end{itemize}
\vfill
\textbf{Typical Applications}
\begin{itemize}
\item Scheduling, Timetabling, Assignment problems
\item Routing Problems, Packing problems, esp. with side-constraints
\item Puzzles and Games, Configuration Problems
\end{itemize}
\end{frame}
\begin{frame}{Constraint Programming (CP)}
\structured{Modelling Language = flat list of (supported) constraints}
\begin{itemize}
\item Variables: Boolean, integer (finite-domain); a few solvers support sets, floats even graphs
\item Logic, arithmetic and \textbf{global} constraints
\item For satisfaction problems and optimisation problems.
\end{itemize}
\vfill
\structured{Many solvers}
There is no standard input format for CP solvers... two things come close:
\begin{itemize}
\item XCSP3: an XML format, contrary to most solvers it allows for some form of nesting and many global constraints
\item FlatZinc: an intermediary 'flat' predicate list produced by MiniZinc, but creates multiple auxiliary variables and no standard constraint naming (can differ for different solvers)
\end{itemize}
\end{frame}
\begin{frame}{Domains}
\begin{definition}
The \defined{domain} of a decision variable $v$, denoted here by
$\Domain{v}$, is the set of values that $v$ can still take during
\search{search}:
\begin{itemize}
\item The domains of the decision variables are reduced by
\search{search} \\ and by \inference{inference} (see the next two
slides).
\item A decision variable is said to be \defined{fixed} if its
domain is a singleton.
\item \defined{Unsatisfiability} occurs if the domain of a
decision variable goes empty.
\end{itemize}
\end{definition}
\vfill
Note the difference between:
\begin{itemize}
\item a domain as a technology-independent declarative entity when
modelling;
\item a domain as a CP-technology procedural data structure when
solving.
\end{itemize}
\end{frame}
\begin{frame}{CP solver structure}
\centering
\includegraphics[height=70mm]{images/cp_domain_store.png}
\end{frame}
\begin{frame}{CP Solving}
\search{Tree Search}, upon initialising each domain as in the model: \vfill
\structured{Satisfaction problem}:
\begin{enumerate}
\item Perform propagation \inference{inference}.
\item If the domain of some decision variable is empty, then
backtrack.
\item If all decision variables are fixed, then we have a solution.
\item Select a non-fixed decision variable $v$, \\ partition its
domain into two parts $\pi_1$ and $\pi_2$, and make two branches: \\
one with $v \in \pi_1$, and the other one with $v \in \pi_2$.
\item Recursively explore each of the two branches.
\end{enumerate}
\vfill
\structured{Optimisation problem}: when a feasible solution is found
at step~3, first add the constraint that the next solution must
be better and then backtrack.
\end{frame}
\begin{frame}{CP Inference}
\begin{definition}
A \inference{propagator} for a constraint $\gamma$ deletes from the
domains of the
% decision
variables of a~$\gamma$-constraint
the values that cannot
be in a solution to that constraint. \\
\end{definition}
\begin{examples}
\begin{itemize}
\item For $x < y$: when $\Domain{x} = \{1..4\}$ and $\Domain{y} = \{-1..3\}$,
delete $\{3, 4\}$ from $\Domain{x}$ and
$\{-1..1\}$ from $\Domain{y}$.
\item For $\cons{AllDifferent}{x,y,z}$: when
$\Domain{x} = \{1..3\}$ =
$\Domain{y}$ and $\Domain{z} = \{1..4\}$, delete $1$ and $3$ from
$\Domain{z}$ so that it becomes the non-range
$\{2,4\}$.
\end{itemize}
\end{examples}
Propagation of constraints is executed until \textbf{fixed-point}: no constraint can reduce the current domains further.
\end{frame}
\begin{frame}{Strategies and Improvements}
\search{Search Strategies:}
\begin{itemize}
\item On which decision variable to branch next?
\item How to partition the domain of the chosen decision variable?
\item Which search (depth-first, breadth-first, \dots) to use?
\end{itemize}
\vfill
\structured{Improvements:}
\begin{itemize}
\item \inference{Propagators}, including for global constraints and global functions. \\ Not all impossible domain values need to
be deleted: there is a compromise between algorithm complexity and
achieved \inference{inference}.
\item \search{Partition} the chosen domain into at least two parts.
\item Domain representations.
\item \search{Order} in which propagators are executed (and re-actived when a variable changes)
\item \dots
\end{itemize}
\end{frame}
\begin{frame}{CP Solving}
\begin{itemize}
\item Guarantee: exact, given enough time. \vfill
\item White-box: within a solver one can design one's own \inference{propagators}
and \search{search strategies}, or choose among predefined ones.
\vfill
\item Successful application areas:
\begin{itemize}
\item Configuration
\item Scheduling
\item Personnel rostering and timetabling
\item rich vehicle routing
\item \dots
\end{itemize}
\end{itemize}
\end{frame}
\subsection*{Transformation: flatten}
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=blue!20, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=red!30, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}{From CP Language to CP Solver: flattening steps}
\begin{enumerate}
\item[0.] Decompose Unsupported Globals (see previous part)
\item \textbf{Push down negation}
\begin{itemize}
\item Simplifies later code by eliminating 'negation' operator, \\afterwards only in front of Boolean variable
\item Example: $\neg(x \land y)$ becomes $(\neg x \lor \neg y)$ and $\neg (a > b)$ becomes $(a \leq b)$
\end{itemize}
\item \textbf{Normalize and simplify expressions}
\begin{itemize}
\item Eliminates unnecessary 'nested' expressions, avoids auxiliary variables later
\item Example: $(x \rightarrow (y \lor z))$ becomes $(\neg x \lor y \lor z)$ and $(a - (b + 2c))$ becomes $(a -b -2c)$
\end{itemize}
\item \textbf{Unnest arguments using auxiliary variables}
\begin{itemize}
\item Because CP solvers only accept a list of constraints over variables
\item Example: Rewrite $x \lor (a + b \geq 2)$ by:
\begin{itemize}
\item Introduce auxiliary variable $w$ (here: Boolean)
\item Add new constraint to solver: \( w = (a + b \geq 2) \)
\item Rewrite $(x \lor (a + b \geq 2))$ to $(x \lor w)$
\end{itemize}
\item Similarly for $(a + (b*c) \geq 0)$: $(w = b*c) \land (a + w \geq 0)$
\end{itemize}
\end{enumerate}
\end{frame}
\subsection*{Integer Linear Programming (ILP)}
% OVERVIEW: ILP solver highlight
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)
\node[draw, fill=green!30, rounded corners, minimum width=2cm, minimum height=1cm] (model) {Model (high-level modelling language)};
% Decompose-globals (blue box)
\node[draw, fill=blue!20, below=of model, rounded corners, minimum width=3.5cm, minimum height=1cm] (decompose) {decompose globals};
% Flatten (orange box)
\node[draw, fill=blue!20, below=of decompose, rounded corners, minimum width=3.5cm, minimum height=1cm] (flatten) {flatten};
% Linearize (purple box)
\node[draw, fill=blue!20, below=of flatten, rounded corners, minimum width=3.5cm, minimum height=1cm] (linearize) {linearize};
% int2bool (cyan box)
\node[draw, fill=blue!20, below=of linearize, rounded corners, minimum width=3.5cm, minimum height=1cm] (int2bool) {int to bool};
% pb2sat (pink box)
\node[draw, fill=blue!20, below=of int2bool, rounded corners, minimum width=3.5cm, minimum height=1cm] (pb2sat) {pb to sat};
% Low-level mdoels (no fill)
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of decompose, align=left] (smt) {SMT model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of flatten, align=left] (cp) {CP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum width=4cm, right=1cm of linearize, fill=green!30, rounded corners, align=left] (ilp) {ILP model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of int2bool, align=left] (pb) {PB model};
\node[draw, fill=green!30, rounded corners, dotted, minimum height=1cm, minimum width=4cm, right=1cm of pb2sat, align=left] (sat) {(max)SAT model};
% Solvers (no fill)
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of smt, align=left] (smt2) {SMT solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of cp, align=left] (cp2) {CP solver};
\node[draw, fill=red!30, minimum height=1cm, minimum width=4cm, right=1cm of ilp, align=left] (ilp2) {ILP solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of pb, align=left] (pb2) {PB solver};
\node[draw, minimum height=1cm, minimum width=4cm, right=1cm of sat, align=left] (sat2) {(max)SAT solver};
% Arrows
\draw[->] (model) -- (decompose);
\draw[->] (decompose) -- (flatten);
\draw[->] (flatten) -- (linearize);
\draw[->] (linearize) -- (int2bool);
\draw[->] (int2bool) -- (pb2sat);
% Connections to low-level
\draw[->] (decompose.east) -- ++(0.5,0) |- (smt.west);
\draw[->] (flatten.east) -- ++(0.5,0) |- (cp.west);
\draw[->] (linearize.east) -- ++(0.5,0) |- (ilp.west);
\draw[->] (int2bool.east) -- ++(0.5,0) |- (pb.west);
\draw[->] (pb2sat.east) -- ++(0.5,0) |- (sat.west);
% Connections to solvers
\draw[->] (smt.east) -- ++(0.5,0) |- (smt2.west);
\draw[->] (cp.east) -- ++(0.5,0) |- (cp2.west);
\draw[->] (ilp.east) -- ++(0.5,0) |- (ilp2.west);
\draw[->] (pb.east) -- ++(0.5,0) |- (pb2.west);
\draw[->] (sat.east) -- ++(0.5,0) |- (sat2.west);
\end{tikzpicture}
\end{frame}
\begin{frame}{Integer Linear Programming (ILP)}
\begin{itemize}
\item Solves combinatorial optimisation problems where variables are constrained to integer values (including 0/1 variables, e.g. Booleans)
\item Formulated using \textbf{linear objective functions} and \textbf{linear constraints}
\item There is also MIP: \textit{Mixed} IP, involving both integer and continuous variables.
\end{itemize}
\vfill
\textbf{How it Works (High-Level Overview)} $ $\\
%Combines branch-and-bound with cutting plane methods.
\begin{itemize}
\item \textbf{Relaxation} relax the integer constraints to solve a linear program, providing a lower/upper bound
\item \textbf{Branch-and-Bound} systematically explore branches by dividing the search space and applying bounds to prune infeasible solutions
\end{itemize}
\vfill
\textbf{Typical Applications}
\begin{itemize}
\item Production planning, Supply chain optimisation
\item Vehicle Routing, Network design problems
\item Facility location, Scheduling, Workforce allocation
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Integer (Linear) Programming (IP = ILP)}
\structured{Modelling Language:}
\begin{itemize}
\item Only integer decision variables.
\item A set of linear equality and inequality constraints (note: no
disequality $\neq$).
\item For optimisation problems: linear objective function.
\end{itemize}
\vfill
\begin{example}
\begin{itemize}
\item Integer decision variables: p, q
\item Constraints:
\vspace{-2mm}
{\footnotesize
\begin{align*}
p \geq 0 \\
q \geq 0 \\
p + 2 * q \leq 5 \\
3 * p + 2 * q \leq 9 \\
\end{align*}}
\vspace{-6mm}
\item Objective: maximize $3 * p + 4 * q$
\end{itemize}
\end{example}
\end{frame}
\begin{frame}{IP Solving}
\structured{Basic Idea = Relaxation:}
\begin{itemize}
\item Polynomial-time algorithms (such as the interior point method and the
ellipsoid method) and exponential-time but practical algorithms
(such as the simplex method) exist for solving LP models very
efficiently.
\item Use them for IP by occasionally \relaxation{relaxing} an IP
model, by dropping its integrality requirement on the decision
variables.
\end{itemize}
\vfill
\structured{Implementations:}
\begin{itemize}
\item \defined{Branch and bound} = \relaxation{relaxation} +
\search{search}.
\item \defined{Cutting-plane algorithms} = \relaxation{relaxation} +
\inference{inference}.
\item \defined{Branch and cut} = \relaxation{relaxation} +
\search{search} + \inference{inference}.
\end{itemize}
\end{frame}
\begin{frame}{Branch and Bound}\label{ip:bb}
\search{Tree Search}, upon initialising the incumbent (current best solution)'s value to $\pm\infty$:
\begin{enumerate}
\item \relaxation{Relax} the IP model into an LP model, and solve it.
\item If the LP model is unsatisfiable, then backtrack.
\item If all the decision variables have an integer value in the
optimal LP solution: update incumbent to found (coincidentally IP) solution, backtrack.
\item If the objective value of the optimal LP solution is no better
than the incumbent, then backtrack.
\item Otherwise, some decision variable $v$ has a non-integer value
$\rho$. \\ Make two branches: one with $v \leq \Floor{\,\rho}$,
and the other one with $v \geq \Ceiling{\rho}$.
\item Create a new search node for each branch, and start exploring one of them
\end{enumerate}
\end{frame}
\begin{frame}{Strategies and Improvements}
\search{Search Strategies:}
\begin{itemize}
\item On which decision variable to branch next?
\item Which search node to explore next when backtracking?
\end{itemize}
\vfill
\structured{Improvements:}
\begin{itemize}
\item \defined{Cutting planes}: Forbid the LP \relaxation{relaxed} solution by cutting off a portion of the LP-feasible region that does not contain an integer solution; then compute new LP solution (and bound).
\item \defined{Decomposition}: Split into a master problem and a
subproblem, such as by the Benders decomposition.
\item Solving the LP \relaxation{relaxation}:
\begin{itemize}
\item Primal-dual methods.
\item Efficient algorithms for special cases, such as flows.
\end{itemize}
\item Primal heuristics: getting good feasible solutions quickly (e.g. upper bound)
\item \dots
\end{itemize}
\end{frame}
\begin{frame}{IP Solving}
\begin{itemize}
\item Guarantee: exact, given enough time. \vfill
\item Mainly black-box: limited ways to guide the solving. \vfill
\item It scales well to thousands of variables.
\vfill
\item \alert{Any combinatorial problem can be encoded into IP.} \\
(but it might require an exponential number of constraints) \vfill
\item Advantages of ILP solving:
\begin{itemize}
\item Provides both a lower bound and an upper bound on the
objective value of optimal solutions, if stopped early.
\item Strong guidance by objective function (through LP solving)
\item Naturally extends to MIP solving.
\item \dots
\end{itemize} \vfill
\item Central method of operations research (OR), \\ applied in
production planning, linear assignment problems, \dots
\end{itemize}
\end{frame}
\subsection*{Transformation: linearize}
\begin{frame}{Overview}
\begin{tikzpicture}[scale=0.7, every node/.style={transform shape}, node distance=0.5cm]
% Model (green box)