introduction to scipscip.zib.de/download/slides/scip-introduction.pdfintroduction to scip marc...

81
Introduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies Berlin, 10/11/2007

Upload: others

Post on 21-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Introduction to SCIP

Marc PfetschZuse Institute Berlin

DFG Research Center MATHEONMathematics for key technologies

Berlin, 10/11/2007

Page 2: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

2 / 60

Page 3: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

What is SCIP?

SCIP (Solving Constraint Integer Programs) . . .. is a branch-and-cut-and-price framework,. incorporates a full-scale mixed integer programming (MIP) solver,. is also a constraint programming (CP) solver,. incorporates SAT-solving features (conflict analysis, restarts),. is free for academic purposes,. and is available in source-code!

3 / 60

Page 4: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Comparison of MIP-Solvers

0

1000

2000

3000

4000

Tim

ein

seco

nds

non-

com

mer

cial

com

mer

cial

SymphonylpsolveGLPKMintoCBC 1.2SCIP–CLPSCIP-SoPlexSCIP-CPLEXCPLEX 10.2

7.05x 6.99x

6.12x

4.10x

2.12x

1.06x 1.00x0.37x 0.13x

not solved 73% 81% 72% 55% 40% 16% 16% 1% 4%

. MIP-solver as fast as CPLEX 9.0

. Underlying LP-solver: treated as black box

4 / 60

Page 5: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

SCIP History

1998 SIP – Solving Integer Programs (Alexander Martin)

10/2002 start of SCIP development (Tobias Achterberg)02/2003 first version to solve MIPs05/2003 Gomory cuts08/2003 conflict analysis03/2004 knapsack cover separator (Kati Wolter)04/2004 restarts, c-MIR cuts01/2005 feasibility pump (Timo Berthold)09/2005 first public version 0.8009/2006 version 0.9009/2007 version 1.00

5 / 60

Page 6: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

SCIP Facts

. Approx. 220.000 lines of C code

. Main SCIP developer: Tobias Achterberg → ILOGTimo Berthold (heuristics), Kati Wolter (cuts)

. Current development: Timo Berthold, Kati Wolter, . . .

. Development together with TU Darmstadt.

. Free for academic use (as is SoPlex)

. Available at http://scip.zib.de

. ZIB Optimization Suite = SCIP + SoPlex + ZIMPLhttp://zibopt.zib.de

6 / 60

Page 7: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

7 / 60

Page 8: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTxs.t. Ax ≤ b

l ≤ x ≤ uxj ∈ Z j ∈ J

8 / 60

Page 9: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTx

s.t. Ax ≤ bl ≤ x ≤ u

xj ∈ Z j ∈ J

8 / 60

Page 10: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTxs.t. Ax ≤ b

l ≤ x ≤ uxj ∈ Z j ∈ J

8 / 60

Page 11: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTxs.t. Ax ≤ b

l ≤ x ≤ u

xj ∈ Z j ∈ J

8 / 60

Page 12: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTxs.t. Ax ≤ b

l ≤ x ≤ u

xj ∈ Z j ∈ J

8 / 60

Page 13: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Definition: Mixed Integer Program (MIP)

min cTxs.t. Ax ≤ b

l ≤ x ≤ uxj ∈ Z j ∈ J

8 / 60

Page 14: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 15: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 16: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 17: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 18: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 19: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 20: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 21: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 22: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 23: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 24: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 25: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 26: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 27: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 28: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 29: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 30: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 31: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 32: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branch-And-Cut

Combination of

. Branch-and-Bound

. Cutting planes

9 / 60

Page 33: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Constraint Programming

Constraint Program (CP)

. Domains of variables = (finite) set

. Constraints = subsets of domain space

Easy example:. variables x and y. domains: Dx = Dy = {0, 1}. constraint: {(0, 1), (1, 0)} ⊂ Dx × Dy ⇔ x = 1− y .

Constraint Integer Program (CIP)

Fixing integer variables leaves LP.

10 / 60

Page 34: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Solving CPs

. Branching:I Divide into subproblems, solve recursively

. Domain Propagation:I Reductions in variables’ domains “propagate”I E.g. x1 + 2x2 ≥ 5, x1 ≤ 2 ⇒ x2 ≥ 1.5

11 / 60

Page 35: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Propagation Example

Alldifferent constraint:{x1, x2, x3, x4} ∈ {1, 2, 3, 4} pairwise different.

x1

x2

x3

x4

alldiff

x1

x2

x3

x4

12 / 60

Page 36: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

13 / 60

Page 37: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Important Aspects

. SCIP is constraint basedI Advantage: flexibilityI Disadvantage: no dual representation

. A constraint knows its variables, but a variable does not know theconstraints it appears in.

. A constraint usually implements a type of inequalities, not a singleinequality.

. From CP-perspective: LP-relaxation is only an add-on! Manyconstraints do not separate inequalities at all.

14 / 60

Page 38: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Example: TSPTraveling Salesman problem (TSP)

Given graph G = (V , E ) and distances de , find shortest tour throughall nodes.

IP-formulation:

min∑e∈E

de xe

s.t.∑

e∈δ(v)

xe = 2 ∀ v ∈ V

∑e∈δ(S)

xe ≥ 2 ∀ S ⊂ V , S 6= ∅

xe ∈ {0, 1} ∀ e ∈ E

Example available with SCIP, including visualization.15 / 60

Page 39: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

SCIP Stages

Init

Problem Transforming

Free Transform

Presolving

Init Solve

Solving

Free Solve

16 / 60

Page 40: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

17 / 60

Page 41: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

SCIP Interface

Main SCIP interface: plugins.

. Perform all problem specific actions.

. Each step calls user defined plugins.

. SCIP knows of plugins through “include” functions.

. Plugins may have private data.

. User defined callback functions(virtual functions in C++-interface).

. Yields modular structure.

. The MIP solver is realized through plugins.

Everything SCIP knows, it knows through plugins.

18 / 60

Page 42: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Types of Plugins

. Constraint handler: assures feasibility, strengthens formulation

. Separator: adds cuts, improves dual bound

. Pricer: allows dynamic generation of variables

. Heuristic: searches solutions, improves primal bound

. Branching rule: how to divide the problem?

. Node selection: which subproblem should be regarded next?

. Presolver: simplifies the problem in advance, strengthens structure

. Propagator: simplifies problem, improves dual bound locally

. Reader: reads problems from different formats

. Event handler: catches events (e.g., bound changes, new solutions)

. Display: allows modification of output

19 / 60

Page 43: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Default Plugins

5 presolvers5 node selection rules

14 constraint handlers8 separators8 branching rules2 propagators

23 primal heuristics

20 / 60

Page 44: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

TSP Plugins

MIP default plugins 2-Opt Heuristic

No-Subtour Constraint Farthest Insert Heuristic

File Reader New Solution Event Handler

Search Tree LP Relaxation Presolve Management

ImplicationGraph

SolutionPool

CutPool

ConflictAnalysis

21 / 60

Page 45: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

22 / 60

Page 46: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Problem Specification

Init

Problem Transforming

Free Transform

Presolving

Init Solve

Solving

Free Solve

23 / 60

Page 47: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Define Variables (TSP Example)

SCIP_VAR* var;SCIP_CALL( // return value macro

SCIPcreateVar(scip , // SCIP pointer&var , // save in variable"varname", // pass variable name0.0, // lower bound1.0, // upper boundlength , // obj. valueSCIP_VARTYPE_BINARY , // typeTRUE , // initialFALSE , // removableNULL , NULL , NULL , // no callback functionsNULL // no variable data

));SCIP_CALL( SCIPaddVar(scip , var) ); // add var.

25 / 60

Page 48: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

TSP: Define Degree ConstraintsSCIP_CALL( SCIPcreateConsLinear(

scip , // SCIP pointer&cons , // save in cons"consname", // namenvar , // number of variablesvars , // array of variablesvals , // array of values2.0, // left hand side2.0, // right hand side (equation)TRUE , // initial?FALSE , // separate?TRUE , // enforce?TRUE , // check?TRUE , // propagate?FALSE , // local?FALSE , // modifable?FALSE , // dynamic?FALSE , // removable?FALSE // stick at node?

));SCIP_CALL( SCIPaddCons(scip , cons) ); // add constraintSCIP_CALL( SCIPreleaseCons(scip , &cons) ); // free cons. space

MIPs are specified using linear constraints only (may be “upgraded”).27 / 60

Page 49: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Transformation

Init

Problem Transforming

Free Transform

Presolving

Init Solve

Solving

Free Solve

28 / 60

Page 50: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Transformation

Original problem Transformed problem

original variables

original constraints

transformed variables

transformed constraints

All variables and constraints are transformed:

. data are copied into separate memory area

. presolving and solving operate on transformed problem

. original data can only be modified in problem modification stage

29 / 60

Page 51: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

30 / 60

Page 52: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Presolving

Init

Problem Transforming

Free Transform

Presolving

Init Solve

Solving

Free Solve

31 / 60

Page 53: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Presolving

init exec. presolvers exec. constraint presolving

found?yes no

. Presolvers provide global presolving (e.g. dual fixing)

. Constraint Handlers provide constraint specific presolving, e.g.:I domain tightening,I coefficient modification,I deletion of redundant constraints,I constraint upgrading.

32 / 60

Page 54: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Probing

Probing:. Tentatively fix binary variables to 0 and 1.. Execute domain propagation of constraints.. Try to deduce global fixings and implications.

Example: x − z ≤ 0,−y + z ≤ 0,

x + y ≤ 1

⇒ x = 0

33 / 60

Page 55: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

34 / 60

Page 56: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Solving

Init

Problem Transforming

Free Transform

Presolving

Init Solve

Solving

Free Solve

35 / 60

Page 57: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Flow Chart SCIP

Start Init Presolving

Stop

Node selection

Processing

Branching

Conflict analysis

Primal heuristics

LP inf.

LP feas.IP inf.

IP feas.

36 / 60

Page 58: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Node Selection

. Node Selectors called in order of priority

. Choose:I child nodeI sibling nodeI leaf node stored in the tree

. two operation modes:I standard mode (default: best estimate)I memory-saving mode (default: depth first search)switching between modes is automatic

37 / 60

Page 59: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Branching,Conflict Analysis, and Heuristics

Start Init Presolving

Stop

Node selection

Processing

Branching

Conflict analysis

Primal heuristics

LP inf.

LP feas.IP inf.

IP feas.

→ separate talks

38 / 60

Page 60: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Node Solving

Start Init Presolving

Stop

Node selection

Processing

Branching

Conflict analysis

Primal heuristics

LP inf.

LP feas.IP inf.

IP feas.

39 / 60

Page 61: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Node Solving

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

40 / 60

Page 62: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

TSP Example

Recall TSP IP-formulation:

min∑e∈E

de xe

s.t.∑

e∈δ(v)

xe = 2 ∀ v ∈ V

∑e∈δ(S)

xe ≥ 2 ∀ S ⊂ V , S 6= ∅

xe ∈ {0, 1} ∀ e ∈ E

Introduce no-subtour constraint: nosub(x)ensures that x does not contain a subtour.

41 / 60

Page 63: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

TSP CP-Formulation

min∑e∈E

de xe

s.t.∑

e∈δ(v)

xe = 2 ∀ v ∈ V

nosub(x)

xe ∈ {0, 1} ∀ e ∈ E

42 / 60

Page 64: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

TSP No-Subtour Constraint

∑e∈δ(S)

xe ≥ 2 ∀ S ⊂ V , S 6= ∅

No-Subtour Constraint Handler callback functions:. Separate: separate inequalities → added to LP

Compute Gomory-Hu tree (max-flow techniques) and check cuts.. Enforcing: separate subtour inequalities. Checking: check whether an integer solution (produced by a

heuristic) is feasible. Propagation: –. Other callbacks: (de)initialization, “locking”, transforming, printing

43 / 60

Page 65: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Linear Constraint Handler

linear constraints: α ≤ aTx ≤ β

. Main constraint for MIP solving

. MIP is constructed with linear constraints.

. May be upgraded to knapsack constraints, etc.

. The linear constraint handler providesI presolving methodsI separates the corresponding inequalitiesI propagates variable bounds

44 / 60

Page 66: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Specially Ordered Sets

Definition (Specially Ordered Set of Type 1)

In given set of variables, at most one is nonzero.

. Nonlinear constraint

. In general: no (good) inequalities (unless bounds are tight)

. Enforcing: branch to remove infeasibility:fix all variables except one to 0.

45 / 60

Page 67: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Domain Propagation

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

46 / 60

Page 68: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Domain Propagation

. Propagators provide global domain reduction methods.

. Constraint handlers provide constraint specific domain reduction:Example: knapsack 4x1 + 6x2 + 7x3 ≤ 11, x2 = 1 ⇒ x3 = 0.

. With propagation frequency f :Propagation called every f th level of the branch-and-bound tree

Similar frequencies for separation, enforcing, . . .

47 / 60

Page 69: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

LP Solving

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

48 / 60

Page 70: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

LP Solving

. LP-Interface LPI to various LP-solvers:SoPlex, CPLEX, XPress, CLP, . . .

. Primal or dual simplex

. Barrier with or without crossover (if supported)

. LP stability checked:resolution by changing parameters:scaling, tolerances, solving from scratch, other simplex method.

49 / 60

Page 71: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Pricing

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

50 / 60

Page 72: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Pricing

execute pricers new columns?

resolve LPyes

no

. Pricers search for new variables with negative reduced costs

. inform constraint handlers about the new variables

. LP resolved after few new columns

. Currently: partial pricing is not allowed(LP objective value has to be a lower bound.)

51 / 60

Page 73: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Separation

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

→ separate talk. SCIP has a built-in cut selection methodology.

52 / 60

Page 74: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Constraint Enforcement

Domain Propagation Solve LP

Pricing

Separation

Domain Propagation

LP Solving

Constraint Enforcement

53 / 60

Page 75: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Constraint Enforcement

If no separating cutting plane was found, solution can still beinfeasible for a constraint.

Enforcing is necessary for a correct implementation!

Constraint handler resolves the infeasibility by. reducing a variable’s domain,. separating a cutting plane (may use integrality),. adding a (local) constraint,. creating a branching, or. concluding that current subproblem is infeasible.

54 / 60

Page 76: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Outline

1 SCIP Facts2 Branch-And-Cut and Constraint Programming3 SCIP Basics

SCIP PluginsProblem SpecificationPresolvingSolving

4 Further Information

55 / 60

Page 77: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Implementation Hints

. SCIP has own memory handling.I Standard memory: SCIPallocMemoryArray(scip,&p,10),

SCIPfreeMemoryArray(scip,&p)I Block memory: SCIPallocBlockMemoryArray(scip,&p,10),

SCIPfreeBlockMemoryArray(scip,&p,10)I Fast buffer: SCIPallocBufferArray(scip,&p,10),

SCIPfreeBufferArray(scip,&p)

. Functions calling SCIP_RETCODE <function>() should use theSCIP_CALL() macro and should return SCIP_RETCODE.

. There are template files, e.g. cons_xxx.{c,h}.

. Only include scip/scip.h or scip/scipdefplugins.h.

56 / 60

Page 78: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Documentation. Constraint Integer Programming

Ph.D. dissertation of Tobias Achterberg, 2007.. SCIP – a framework to integrate Constraint and Mixed Integer

ProgrammingTobias Achterberg, ZIB-Report 04-19, 2004.

. Primal Heuristics for Mixed Integer ProgramsTimo Berthold, Diploma Thesis, TU Berlin, 2006

. Implementation of Cutting Plane Separators for Mixed IntegerProgramsKati Wolter, Diploma Thesis, TU Berlin, 2006

. http://scip.zib.deDoxygen documentation, HowTos, FAQ

. See: scip.h, pub_*.h, <plugin>.h (e.g. cons_linear.h)

57 / 60

Page 79: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

How to Contribute?

You can/should contribute by . . .. using SCIP and report publications/projects,. sending bug-reports – better: bug-fixes,. giving feedback on documentation,. implementing plugins.

58 / 60

Page 80: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Future Plans

. nonlinear components/constraintsI SOS1, SOS2I indicatorsI MINLP

. exact IP (without rounding errors)

. symmetries

. counting solutions

. improved column generation support

. new heuristics/cuts

. performance improvement

. arbitrary constraints in ZIMPL → SCIP

59 / 60

Page 81: Introduction to SCIPscip.zib.de/download/slides/SCIP-introduction.pdfIntroduction to SCIP Marc Pfetsch Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies

Introduction to SCIP

Marc PfetschZuse Institute Berlin

DFG Research Center MATHEONMathematics for key technologies

Berlin, 10/11/2007