SCIP Optimization Suite

Presentation on theme: "SCIP Optimization Suite"— Presentation transcript:

SCIP Optimization Suite
1

SCIP Optimization Suite
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

How Does It Work? As a programming library As a standalone solver
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

What we need Parameters Variables Sets Objective function Constraints
5

Sets Set of numbers Set of strings Set of tuples 6

Set operations 7

{<1, “hi”>, <2, “hi”>, <3, “hi”>, <1, “ha”>, …}
{1, 6, 7, 8, 9} 8

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] := <1> {10}, <2> {20}, <4> {30,40,50}; set B[ <i> in I] := {10 * i}; 9

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

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

Variables “real”, “binary”, or “integer” var x1; var x2 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

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

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

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

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

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

Example 18

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

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

Reading Set and Parameters from file
“read filename as template” set A := {read "a.txt" as "<1n>"}; a.txt 1 2 3 4 5 21

set A := {read "a.txt" as "<1n>"};
param B[A] := read "b.txt" as "<1n> 2s"; a.txt b.txt aa bb cc 22

23

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

25

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 = 1724 26

Similar presentations