Presentation is loading. Please wait.

Presentation is loading. Please wait.

SCIP Optimization Suite. Three main software –zimpl: Compiler of ZIMPL modeling language –soplex: LP solver (implementation of Simplex) –scip: An advanced.

Similar presentations


Presentation on theme: "SCIP Optimization Suite. Three main software –zimpl: Compiler of ZIMPL modeling language –soplex: LP solver (implementation of Simplex) –scip: An advanced."— Presentation transcript:

1 SCIP Optimization Suite

2 Three main software –zimpl: Compiler of ZIMPL modeling language –soplex: LP solver (implementation of Simplex) –scip: An advanced implementation of B&B to solve ILP All these are available in single packages –SCIP optimization suite –Source code –zimpl, soplex, scip are standalone applications –Binary (Linux & Windows) –Single executable scip application that is linked by zimpl & soplex 2

3 How Does It Work? As a programming library –It has API, you can call the functions in C, C++ As a standalone solver –Develop a model in zimpl language –Compile/Translate your model: zimpl model.zpl –Solve it LP problems: soplex model.lp ILP, MIP problems: scip -f model.lp –scip by itself calls zimpl if the input file is not.lp scip -f model.zpl 3

4 4

5 What we need Parameters Variables Sets Objective function Constraints 5

6 Sets Set of numbers Set of strings Set of tuples 6

7 Set operations 7

8 {,,,, …} {1, 6, 7, 8, 9} 8

9 Indexed Sets The arrays of ZIMPL Each element has its own index –A set indexes another set Refer to i-th element by S[i] Example set I := {1, 2, 4}; set A[I] := {10}, {20}, {30,40,50}; set B[ in I] := {10 * i}; 9

10 Parameters set A := {1,2,3}; param B := 10; param C[A] := 10, 20, 30; param D[A] := 100 default 0; param E := min A; param F := max in A : C[i]; 10

11 These operations are used in zimpl models to generate the numerical model. Most operations are applicable only on parameters, cannot be used for variables, because they are not linear 11

12 Variables “real”, “binary”, or “integer” –Default is “real” var x1; var x2 integer; var x3 binary; set A := {1,2,3}; var x4[A] real; var x5[A * A] integer >=0 <= 10; 12

13 Objective “maximize” or “minimize” var x1; var x2; var x3; maximize obj1: x1 + x2 + x3; minimize obj2: 2*x1 + 3*x2; 13

14 Objective set A := {1,2,3}; param B[A] := 10, 20, 30; var X[A]; maximize obj1: sum in A: X[i]; minimize obj2: sum in A: B[i] * X[i]; 14

15 Constraint subto name: constraint –“ ”, “==“ –There is not “>” and “<“ subto c1: x1 <= 10; subto c2: x1 + x2 <= 20; subto c3: x1 + x2 + x3 == 100; 15

16 Constraint set A := {1,2,3}; param B[A] := 10, 20, 30; var X[A]; subto c1: forall in A: X[i] <= B[i]; 16

17 Expressions forall expression –forall in S: x[i] <= b[i]; sum expression –sum in S: x[i]; if expression –forall in S: x[i] <= if (i mod 3 == 0) then A[i] else B[i] end; 17

18 Example 18

19 set I := {1,2,3}; set J := {1,2}; param c[I] := 1, 20, 300; param A[J * I] := 1, 2, 3, 30, 20, 10; param b[J] := 20, 200; var X[I]; maximize obj: sum in I: c[i] * X[i]; subto const: forall in J: sum in I: A[j,i] * X[i] <= b[j]; 19

20 Realistic Problems A model for the problem Multiple instances –Each instance has its own data Separation between model and data –Create a general model –Read data from file 20

21 Reading Set and Parameters from file “read filename as template” set A := {read "a.txt" as " "}; a.txt

22 set A := {read "a.txt" as " "}; param B[A] := read "b.txt" as " 2s"; a.txtb.txt 11 aa 23 bb 32 cc 22

23 23

24 set I := {read "I.txt" as " "}; set J := {read "J.txt" as " "}; param c[I] := read "c.txt" as " 2n"; param A[J * I] := read "A.txt" as " 3n"; param b[J] := read "b.txt" as " 2n"; var X[I]; maximize obj: sum in I: c[i] * X[i]; subto const: forall in J: sum in I: A[j,i] * X[i] <= b[j]; 24

25 25

26 Integrality  Complexity: An Example Consider the LP problem –I = 1000 –J = 100 If variables are “real” – Solution time = 0.21 sec. – Objective = If variables are “integer” –Solution time = sec. –Objective =


Download ppt "SCIP Optimization Suite. Three main software –zimpl: Compiler of ZIMPL modeling language –soplex: LP solver (implementation of Simplex) –scip: An advanced."

Similar presentations


Ads by Google