Implementing Constraint Handlers in SCIP

Size: px
Start display at page:

Download "Implementing Constraint Handlers in SCIP"

Transcription

1 Implementing Constraint Handlers in SCIP Gregor Hendel Ambros Gleixner, Felipe Serrano September 30

2 Outline Why use constraints? Motivation Callback: Default Constraint Handlers of SCIP Implementation hints for the Nosubtour Constraint Handler Hendel,Gleixner,Serrano Constraint Handler Implementation 1 / 43

3 Outline Why use constraints? Motivation Callback: Default Constraint Handlers of SCIP Implementation hints for the Nosubtour Constraint Handler Hendel,Gleixner,Serrano Constraint Handler Implementation 2 / 43

4 Traveling Salesman Problem (TSP) Denition Given a graph G = (V, E) with edge lengths c e. Find a Hamiltonian cycle (cycle containing all nodes, tour) of minimum length. K 8 Hendel,Gleixner,Serrano Constraint Handler Implementation 3 / 43

5 Traveling Salesman Problem (TSP) Denition Given a graph G = (V, E) with edge lengths c e. Find a Hamiltonian cycle (cycle containing all nodes, tour) of minimum length. K 8 Hendel,Gleixner,Serrano Constraint Handler Implementation 3 / 43

6 Motivation For General Constraints: MIP Formulation min s.t. c e x e e E e δ(v) e δ(s) x e = 2 v V x e 2 S V, S x e {0, 1} e E. Hendel,Gleixner,Serrano Constraint Handler Implementation 4 / 43

7 Motivation For General Constraints: MIP Formulation min s.t. c e x e e E e δ(v) e δ(s) x e = 2 v V x e 2 S V, S x e {0, 1} e E. CIP Formulation min s.t. c e x e e E x e = 2 v V e δ(v) nosubtour(g, x) x e {0, 1} e E. nosubtour(g, x) C {e E x e = 1} : C is a cycle of length C < V Hendel,Gleixner,Serrano Constraint Handler Implementation 4 / 43

8 Separation Problem Separation Problem Given graph G = (V, E) and x [0, 1] E. Decide whether x satises all subtour elimination constraints. If not, nd violated subtour elimination constraint. Hendel,Gleixner,Serrano Constraint Handler Implementation 5 / 43

9 Separation Problem Separation Problem Given graph G = (V, E) and x [0, 1] E. Decide whether x satises all subtour elimination constraints. If not, nd violated subtour elimination constraint. Trivial observation: Consider G = (V, E) with edge capacities x e. x violates at least one subtour elimination constraint cut δ(s) with capacity x (δ(s)) < 2. Hendel,Gleixner,Serrano Constraint Handler Implementation 5 / 43

10 Separation Problem Separation Problem Given graph G = (V, E) and x [0, 1] E. Decide whether x satises all subtour elimination constraints. If not, nd violated subtour elimination constraint. Idea of separation algorithm: s, t V : Find (s, t)-cut δ(s) of minimum capacity If all cut capacities 2, all subtour elimination constraints satised ( ) V 2 times MaxFlow-MinCut algo Hendel,Gleixner,Serrano Constraint Handler Implementation 5 / 43

11 Separation Problem Separation Problem Given graph G = (V, E) and x [0, 1] E. Decide whether x satises all subtour elimination constraints. If not, nd violated subtour elimination constraint. Idea of separation algorithm: s, t V : Find (s, t)-cut δ(s) of minimum capacity If all cut capacities 2, all subtour elimination constraints satised V 1 times MaxFlow-MinCut algo within Gomory-Hu-Algorithm Hendel,Gleixner,Serrano Constraint Handler Implementation 5 / 43

12 Result of Gomory-Hu-Algorithm Gomory-Hu-Tree T For all s, t V : capacity of minimum (s, t)-cut in G : minimum label f e of all edges e in unique (s, t)-path in T minimum (s, t)-cut in G : bipartition of V obtained be deleting this edge from T Hendel,Gleixner,Serrano Constraint Handler Implementation 6 / 43

13 Outline Why use constraints? Motivation Callback: Default Constraint Handlers of SCIP Implementation hints for the Nosubtour Constraint Handler Hendel,Gleixner,Serrano Constraint Handler Implementation 7 / 43

14 Default Constraint Handlers Hendel,Gleixner,Serrano Constraint Handler Implementation 8 / 43

15 Special Linear Constraints min x 1 + x 2 + x 3 + x 4 + x 5 + y 1 + y 2 s.t. y x 1 y x 2 3 x x x 3 8 x 2 + x 3 + x 4 = 1 3 x x x y y 2 4 x 1, x 2, x 3, x 4 {0, 1} x 5 Z + y 1, y 2 R + Hendel,Gleixner,Serrano Constraint Handler Implementation 9 / 43

16 Special Linear Constraints min x 1 + x 2 + x 3 + x 4 + x 5 + y 1 + y 2 s.t. y x 1 y x 2 3 x x x 3 8 x 2 + x 3 + x 4 = 1 3 x x x y y 2 4 x 1, x 2, x 3, x 4 {0, 1} x 5 Z + y 1, y 2 R + Hendel,Gleixner,Serrano Constraint Handler Implementation 9 / 43

17 Special Linear Constraints min x 1 + x 2 + x 3 + x 4 + x 5 + y 1 + y 2 s.t. y x 1 y x 2 3 x x x 3 8 x 2 + x 3 + x 4 = 1 3 x x x y y 2 4 x 1, x 2, x 3, x 4 {0, 1} x 5 Z + y 1, y 2 R + Hendel,Gleixner,Serrano Constraint Handler Implementation 9 / 43

18 Special Linear Constraints min x 1 + x 2 + x 3 + x 4 + x 5 + y 1 + y 2 s.t. y x 1 y x 2 3 x x x 3 8 x 2 + x 3 + x 4 = 1 3 x x x y y 2 4 x 1, x 2, x 3, x 4 {0, 1} x 5 Z + y 1, y 2 R + Hendel,Gleixner,Serrano Constraint Handler Implementation 9 / 43

19 Special Linear Constraints min x 1 + x 2 + x 3 + x 4 + x 5 + y 1 + y 2 s.t. y x 1 y x 2 3 x x x 3 8 x 2 + x 3 + x 4 = 1 3 x x x y y 2 4 x 1, x 2, x 3, x 4 {0, 1} x 5 Z + y 1, y 2 R + Hendel,Gleixner,Serrano Constraint Handler Implementation 9 / 43

20 Knapsack Constraints Feasible region of 0-1 knapsack problem: { x {0, 1} N : j N a j x j b } weights of the variables: a j Z + for all j N capacity of the knapsack: b Z + Hendel,Gleixner,Serrano Constraint Handler Implementation 10 / 43

21 The Integral Constraint Handler The integral constraint handler ensures the integrality of discrete problem variables in a solution does not need constraints because integrality restrictions are encoded in the type of a variable is the shortest example of a working constraint handler I know Hendel,Gleixner,Serrano Constraint Handler Implementation 11 / 43

22 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties/Parameters Hendel,Gleixner,Serrano Constraint Handler Implementation 12 / 43

23 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties/Parameters Hendel,Gleixner,Serrano Constraint Handler Implementation 12 / 43

24 Private Data Constraint data: information needed to dene single constraint 1 struct SCIP_ConsData 2 { 3 SCIP_VAR** vars; // vari ables in knapsack 4 int nvars; // number of v ariabl es 5 SCIP_Longint* weights; // weights of v ariab les 6 SCIP_Longint capacity; // c a p a c i t y of knapsack 7 }; Constraint handler data: information belonging to constraint handler itself 1 struct SCIP_ConshdlrData 2 { 3 int maxrounds; // max nr. of sepa rounds per node 4 int maxsepacuts; // max nr. of cuts per sepa round 5 }; Hendel,Gleixner,Serrano Constraint Handler Implementation 13 / 43

25 Interface Methods Creating a single knapsack constraint. 1 SCIP_RETCODE SCIPcreateConsBasicKnapsack( 2 SCIP* scip, / < SCIP data s t r u c t u r e / 3 SCIP_CONS** cons, / < p o i n t e r to hold the created c o n s t r a i n t 4 const char* name, / < name of c o n s t r a i n t / 5 int nvars, / < number of items i n the knapsack / 6 SCIP_VAR** vars, / < array with item vari ables / 7 SCIP_Longint* weights, / < a r r a y with item weights / 8 SCIP_Longint capacity / < c a p a c i t y of knapsack / 9 ) 10 { 11 SCIP_CONSDATA* consdata; 12 SCIP_CALL( consdatacreate(scip, &consdata, nvars, vars, 13 weights, capacity) ); 14 SCIP_CALL( SCIPcreateConsBasic(scip, cons, name, conshdlr, 15 consdata) ); 16 return SCIP_OKAY; 17 } Hendel,Gleixner,Serrano Constraint Handler Implementation 14 / 43

26 Interface Methods Including the knapsack constraint handler. 1 SCIP_RETCODE SCIPincludeConshdlrKnapsack( 2 SCIP* scip // SCIP data s t r u c t u r e 3 ) 4 { 5 SCIP_CONSHDLR* conshdlr; 6 SCIP_CONSHDLRDATA* conshdlrdata; 7 8 SCIP_CALL( conshdlrdatacreate(scip, &conshdlrdata) ); / i n c l u d e c o n s t r a i n t handler i n t o SCIP / 12 SCIP_CALL( SCIPincludeConshdlrBasic(scip, &conshdlr, 13 CONSHDLR_NAME, CONSHDLR_DESC, 14 [...] 15 consenfolpknapsack, consenfopsknapsack, 16 conscheckknapsack, conslockknapsack, 17 conshdlrdata) ); / s e t non fundamental c a l l b a c k s v i a s p e c i f i c s e t t e r f u n c t i o n s / } Hendel,Gleixner,Serrano Constraint Handler Implementation 15 / 43

27 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties/Parameters Hendel,Gleixner,Serrano Constraint Handler Implementation 16 / 43

28 Callback Methods What is a callback method? Hendel,Gleixner,Serrano Constraint Handler Implementation 17 / 43

29 Callback Methods What is a callback method? Nice quote from someone who cited an older Wikipedia version: In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software layer to call a subroutine (or function) dened in a higher-level layer. source: Hendel,Gleixner,Serrano Constraint Handler Implementation 17 / 43

30 Callback Methods What is a callback method? Nice quote from someone who cited an older Wikipedia version: In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software layer to call a subroutine (or function) dened in a higher-level layer. source: All the functionality of constraint handlers (as well as all other plugin types of SCIP) is dened through callback functions. Hendel,Gleixner,Serrano Constraint Handler Implementation 17 / 43

31 CONSCHECK Most important callback... usually called by primal heuristics checks given solution for feasibility wrt all constraints of its type possible result values SCIP_FEASIBLE SCIP_INFEASIBLE Given solution: (x 1, x 2, x 3 ) = (1, 0, 1) Knapsack constraints: 3x 1 + 6x 2 + 4x 3 8 2x x 3 3 Result: SCIP_INFEASIBLE Hendel,Gleixner,Serrano Constraint Handler Implementation 18 / 43

32 CONSENFOLP and CONSENFOPS CONSENFOLP: checks LP solution for feasibility CONSENFOPS: checks Pseudo solution for feasibility LP solution solution of LP relaxation min x 1 x 2 + x 3 s.t. 3 x x x 3 4 x 1, x 2, x 3 {0, 1} LP solution: (0, 1 2, 0) Pseudo Solution solution of LP relaxation with only bound constraints used if LP solving disabled, or numerical diculties occurred min x 1 x 2 + x 3 s.t. x 1, x 2, x 3 {0, 1} Pseudo Solution: (0, 1, 0) Hendel,Gleixner,Serrano Constraint Handler Implementation 19 / 43

33 CONSENFOLP and CONSENFOPS LP solution may violate a constraint not contained in the relaxation. Enforcement callbacks are necessary for a correct implementation! In addition, they can resolve an infeasibility by... reducing a variable's domain, separating a cutting plane (may use integrality), adding a (local) constraint, creating a branching, concluding that the subproblem is infeasible and can be cut o, or just saying solution infeasible. Hendel,Gleixner,Serrano Constraint Handler Implementation 20 / 43

34 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

35 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

36 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

37 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

38 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

39 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

40 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

41 CONSENFOLP and CONSENFOPS Presolving Domain propagation Conict analysis Node selection Solve LP Pricing Primal heuristics Processing Branching Enforce constraints Cuts Enforcement result of constraint handler: reduced domain added cut added constraint branched cuto infeasible feasible Hendel,Gleixner,Serrano Constraint Handler Implementation 21 / 43

42 The Integral Constraint Handler The integral constraint handler ensures the integrality of discrete problem variables in a solution does not need constraints because integrality restrictions are encoded in the type of a variable is the shortest example of a working constraint handler I know Hendel,Gleixner,Serrano Constraint Handler Implementation 22 / 43

43 The Integral Constraint Handler The integral constraint handler ensures the integrality of discrete problem variables in a solution does not need constraints because integrality restrictions are encoded in the type of a variable is the shortest example of a working constraint handler I know Question How does the integral constraint handler enforce the LP solution? Hendel,Gleixner,Serrano Constraint Handler Implementation 22 / 43

44 The Integral Constraint Handler The integral constraint handler ensures the integrality of discrete problem variables in a solution does not need constraints because integrality restrictions are encoded in the type of a variable is the shortest example of a working constraint handler I know Question How does the integral constraint handler enforce the LP solution? Answer It calls the branching rules to perform variable branching. Hendel,Gleixner,Serrano Constraint Handler Implementation 22 / 43

45 CONSLOCK Provides dual information for single constraints (useful for presolving, primal heuristics,... ) For each variable of a constraint, returns whether... increasing its value, and/or decreasing its value may lead to a violation of the constraint 3 x 1 5 x x 3 7 increasing: x 1 and x 3 decreasing: x 2 Hendel,Gleixner,Serrano Constraint Handler Implementation 23 / 43

46 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties/Parameters Hendel,Gleixner,Serrano Constraint Handler Implementation 24 / 43

47 CONSINIT..., CONSEXIT... Init Presolving Init Solve Problem Transforming Transformed Solving Free Transform Transformed Free Solve CONSINIT and CONSEXIT: called after problem was transformed / before transformed problem is freed initialize and free statistics in SCIP_ConshdlrData Hendel,Gleixner,Serrano Constraint Handler Implementation 25 / 43

48 CONSINIT..., CONSEXIT... Init Presolving Init Solve Problem Transforming Transformed Solving Free Transform Transformed Free Solve CONSINITPRE and CONSEXITPRE: called before presolving starts / after presolving is nished initialize and free presolving data Hendel,Gleixner,Serrano Constraint Handler Implementation 25 / 43

49 CONSINIT..., CONSEXIT... Init Presolving Init Solve Problem Transforming Transformed Solving Free Transform Transformed Free Solve CONSINITSOL and CONSEXITSOL: called before branch-and-bound process starts / before branch-and-bound process is freed initialize and release branch-and-bound specic data Hendel,Gleixner,Serrano Constraint Handler Implementation 25 / 43

50 CONSINIT..., CONSEXIT... Init Presolving Init Solve Problem Transforming Transformed Solving Free Transform Transformed Free Solve CONSINITLP: called before rst LP relaxation is solved add linear relaxation of all "initial" constraints to the LP relaxation Hendel,Gleixner,Serrano Constraint Handler Implementation 25 / 43

51 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties/Parameters Hendel,Gleixner,Serrano Constraint Handler Implementation 26 / 43

52 CONSSEPALP, CONSSEPASOL Feasible region of 0-1 knapsack problem: { x {0, 1} N : j N a j x j b } Minimal Cover: C N j C a j > b j C\{i} a j b i C Minimal Cover Inequality x j C 1 j C 5x 1 + 6x 2 + 2x 3 + 2x 4 8 Minimal cover: C = {2, 3, 4} Minimal cover inequality: x 2 + x 3 + x 4 2 separated in knapsack constraint handler Hendel,Gleixner,Serrano Constraint Handler Implementation 27 / 43

53 CONSSEPALP, CONSSEPASOL Separation is implemented in separators and constraint handlers. 1. Separators with SEPA_PRIORITY 0 (decreasing order) 2. Constraint handlers (decreasing order of CONSHDLR_SEPAPRIORITY) 3. Separators with SEPA_PRIORITY < 0 (decreasing order) Hendel,Gleixner,Serrano Constraint Handler Implementation 28 / 43

54 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Domain propagation (during subproblem processing) Reason for domain reductions (for conict analysis) Presolving (before processing root node) Hendel,Gleixner,Serrano Constraint Handler Implementation 29 / 43

55 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Called whenever... SCIP enters/leaves subtree where local constraint exists constraint is enabled/disabled (no propagation, no separation) Hendel,Gleixner,Serrano Constraint Handler Implementation 29 / 43

56 Ingredients of a Constraint Handler Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Displaying, parsing problems Copying problems between dierent SCIP environments Hendel,Gleixner,Serrano Constraint Handler Implementation 29 / 43

57 Outline Why use constraints? Motivation Callback: Default Constraint Handlers of SCIP Implementation hints for the Nosubtour Constraint Handler Hendel,Gleixner,Serrano Constraint Handler Implementation 30 / 43

58 Exercise: TSP MIP Formulation min s.t. c e x e e E e δ(v) e δ(s) x e = 2 v V x e 2 S V, S x e {0, 1} e E. CIP Formulation min s.t. c e x e e E x e = 2 v V e δ(v) nosubtour(g, x) x e {0, 1} e E. nosubtour(g, x) C {e E x e = 1} : C is a cycle of length C < V Hendel,Gleixner,Serrano Constraint Handler Implementation 31 / 43

59 Exercise: TSP Conict Analysis Cut Pool Solution Pool Implication Graph Presolve Management LP Relaxation Search Tree Hendel,Gleixner,Serrano Constraint Handler Implementation 32 / 43

60 Exercise: TSP MIP Default Plugins Conict Analysis Cut Pool Solution Pool Implication Graph Presolve Management LP Relaxation Search Tree Hendel,Gleixner,Serrano Constraint Handler Implementation 32 / 43

61 Exercise: TSP New Solution TSP Event Handler File Reader 2-Opt MIP Heuristic Default Plugins Conict Analysis Cut Pool Solution Pool Implication Graph Presolve Management LP Relaxation Search Tree Hendel,Gleixner,Serrano Constraint Handler Implementation 32 / 43

62 Exercise: TSP New Solution Event Handler TSP File Reader Nosubtour Constraint Hdlr 2-Opt MIP Heuristic Default Plugins Conict Analysis Cut Pool Solution Pool Implication Graph Presolve Management LP Relaxation Search Tree Hendel,Gleixner,Serrano Constraint Handler Implementation 32 / 43

63 Exercise: TSP New Solution Event Handler TSP File Reader Bonus: LP Greedy Heuristic Nosubtour Constraint Hdlr 2-Opt Heuristic MIP Default Plugins Conict Analysis Cut Pool Solution Pool Implication Graph Presolve Management LP Relaxation Search Tree Hendel,Gleixner,Serrano Constraint Handler Implementation 32 / 43

64 Exercise: TSP Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSINIT..., CONSEXIT... CONSSEPALP, CONSSEPASOL CONSPROP, CONSRESPROP, CONSPRESOL CONSACTIVE, CONSDEACTIVE, CONSENABLE, CONSDISABLE CONSTRANS, CONSDELETE, CONSFREE CONSPRINT, CONSPARSE, CONSCOPY CONSDELVARS, CONSGETVARS, CONSGETNVARS CONSGETDIVEBDCHGS Further Ingredients Private data Interface methods Properties Hendel,Gleixner,Serrano Constraint Handler Implementation 33 / 43

65 Exercise: TSP Callback Methods Fundamental: CONSCHECK CONSENFOLP, CONSENFOPS CONSLOCK Additional: CONSSEPALP, CONSSEPASOL CONSTRANS, CONSDELETE Further Ingredients Private data Interface methods Properties Hendel,Gleixner,Serrano Constraint Handler Implementation 33 / 43

66 CONSCHECK Feasibility Check Given a point y Q E, decide whether y satises all subtour elimination constraints. Hendel,Gleixner,Serrano Constraint Handler Implementation 34 / 43

67 CONSCHECK Feasibility Check Given a point y Q E, decide whether y satises all subtour elimination constraints. Check Priorities make this task easier: Constraint handlers check y in decreasing order of their check priority (CONSHDLR_CHECKPRIORITY). Check priority of nosubtour(g, x) smaller than linear and integral check priorities The solution y already satises integrality and (linear) degree constraints. min s.t. c e x e e E x e = 2 v V e δ(v) nosubtour(g, x) x e {0, 1} e E. Hendel,Gleixner,Serrano Constraint Handler Implementation 34 / 43

68 CONSCHECK Feasibility Check Given a point y Q E, decide whether y satises all subtour elimination constraints. Check Priorities make this task easier: Constraint handlers check y in decreasing order of their check priority (CONSHDLR_CHECKPRIORITY). Check priority of nosubtour(g, x) smaller than linear and integral check priorities The solution y already satises integrality and (linear) degree constraints. min s.t. c e x e e E x e = 2 v V e δ(v) nosubtour(g, x) x e {0, 1} e E. Hendel,Gleixner,Serrano Constraint Handler Implementation 34 / 43

69 CONSCHECK Feasibility Check Given a point y Q E, decide whether y satises all subtour elimination constraints. Check Priorities make this task easier: Constraint handlers check y in decreasing order of their check priority (CONSHDLR_CHECKPRIORITY). Check priority of nosubtour(g, x) smaller than linear and integral check priorities The solution y already satises integrality and (linear) degree constraints. min s.t. c e x e e E x e = 2 v V e δ(v) nosubtour(g, x) x e {0, 1} e E. y is the characteristic vector of a collection of cycles when passed to the nosubtour constraint handler. Hendel,Gleixner,Serrano Constraint Handler Implementation 34 / 43

70 Understanding SCIP Callbacks SCIP callback declarations are realized as macros: What you see in cons_nosubtour.c: 1 static 2 SCIP_DECL_CONSCHECK(consCheckNosubtour) 3 { 4 // Your S o p h i s t i c a t e d Code 5 } What the compiler sees (after preprocessor and some formatting): 1 static 2 SCIP_RETCODE conschecknosubtour(scip* scip, SCIP_CONSHDLR* conshdlr, 3 SCIP_CONS** conss, int nconss, SCIP_SOL* sol, 4 SCIP_Bool checkintegrality, SCIP_Bool checklprows, 5 SCIP_Bool printreason, SCIP_RESULT* result) 6 { 7 // Your S o p h i s t i c a t e d Code 8 } SCIP_DECL_CONSCHECK is a macro dened in type_cons.h. It is responsible of expanding the callback function with the needed arguments and return value. Hendel,Gleixner,Serrano Constraint Handler Implementation 35 / 43

71 Understanding SCIP Callbacks even more A compilable check callback 1 static 2 SCIP_DECL_CONSCHECK(consCheckNosubtour) 3 { 4 / TODO: add some more code / 5 *result = SCIP_INFEASIBLE; 6 7 return SCIP_OKAY; 8 } all callbacks must return a SCIP_RETCODE! Use SCIP_OKAY if everything worked often, callbacks require to correctly assign a result-pointer, examples: *result = SCIP_[IN]FEASIBLE *result = SCIP_SEPARATED *result = SCIP_DIDNOTFIND Find the full callback denition and possible return types in type_<pluginname>.h, eg, type_cons.h for constraint handlers or type_heur.h for primal heuristics. Hendel,Gleixner,Serrano Constraint Handler Implementation 36 / 43

72 The Graph implementation The graph data structure for this exercise is dened in GomoryHuTree.h: 1 typedef struct Graph 2 { 3 int nuses; 4 int nnodes; / < number of nodes of the graph / 5 int nedges; / < number of edges / 6 int nedgesnonzero; 7 8 GRAPHNODE *nodes; / < a r r a y c o n t a i n i n g the nodes of the graph / 9 10 GRAPHEDGE *edges; / < a r r a y c o n t a i n i n g a l l h a l f e d g e s... / } GRAPH; Hendel,Gleixner,Serrano Constraint Handler Implementation 37 / 43

73 The Graph implementation Every graph edge is a half-edge in GomoryHuTree.h: 1 typedef struct GraphEdge 2 { 3 double cap; / < c a p a c i t y used i n maxflow / 4 double rcap; / < r e s i d u a l capacity used in maxflow / 5 double length; / < length of the edge measured by some f i x e d metric 6 7 struct GraphEdge *next; / < i n i n c i d e n c e l i s t of node from which edge i s em 8 struct GraphEdge *back; / < p o i n t e r to r e v e r s e edge / 9 10 GRAPHNODE *adjac; / < p o i n t e r to adjacent node / SCIP_VAR* var; } GRAPHEDGE; Every edge has a variable pointer edge->var. Hendel,Gleixner,Serrano Constraint Handler Implementation 38 / 43

74 The Graph implementation Nodes of the graph only have two relevant members (for us): 1 typedef struct GraphNode 2 { 3 int id; / < number of the node / struct GraphEdge *first_edge;/ < i n l i s t of i n c i d e n t edges / } GRAPHNODE; Hendel,Gleixner,Serrano Constraint Handler Implementation 39 / 43

75 The Graph implementation Question How to traverse all incident edges of a node? Answer: 1 GRAPHEDGE* edge = node->first_edge; 2 while( edge!= NULL ) 3 { 4 / do something with t h i s edge / 5 6 edge = edge->next; 7 } Hendel,Gleixner,Serrano Constraint Handler Implementation 40 / 43

76 The Gomory-Hu Black Box Only one method from GomoryHuTree.h is relevant for us: ghc_tree(). It has the following arguments: GRAPH* gr: the graph data structure SCIP_Bool** cuts: 2-dimensional array to return cuts, needs to be allocated by the user int* ncuts: pointer to store the number of violated cuts double minviol feasibility tolerance, use SCIPfeastol(scip) The method returns TRUE if it found at least one violated cut, and false otherwise. ghc_tree() lls cuts with all minimum (s, t)-cuts with capacity 2 minviol Hendel,Gleixner,Serrano Constraint Handler Implementation 41 / 43

77 Documentation Constraint Integer Programming Tobias Achterberg, Ph.D. dissertation, TU Berlin, Doxygen documentation, HowTos, FAQ source code scip.h, pub_*.h, type_*.h Hendel,Gleixner,Serrano Constraint Handler Implementation 42 / 43

78 Please,... build groups of 3 people laptop owner C expert IP expert raise your hand, if you get stuck. Hendel,Gleixner,Serrano Constraint Handler Implementation 43 / 43

79 Implementing Constraint Handlers in SCIP Gregor Hendel Ambros Gleixner, Felipe Serrano September 30

The MIP-Solving-Framework SCIP

The MIP-Solving-Framework SCIP The MIP-Solving-Framework SCIP Timo Berthold Zuse Institut Berlin DFG Research Center MATHEON Mathematics for key technologies Berlin, 23.05.2007 What Is A MIP? Definition MIP The optimization problem

More information

SCIP Workshop 2014, Berlin, September 30, Introduction to SCIP

SCIP Workshop 2014, Berlin, September 30, Introduction to SCIP SCIP Workshop 2014, Berlin, September 30, 2014 Introduction to SCIP ZIB: Fast Algorithms Fast Computers Konrad-Zuse-Zentrum für Informationstechnik Berlin non-university research institute of the state

More information

Basic Concepts of Constraint Integer Programming

Basic Concepts of Constraint Integer Programming Basic Concepts of Constraint Integer Programming Ambros Gleixner Zuse Institute Berlin September 30, 2015 Outline SCIP Solving Constraint Integer Programs 4 methodologies in optimization An integrated

More information

Introduction to SCIP. Gregor Hendel, SCIP Introduction Day September 26, rd IMI-ISM-ZIB MODAL Workshop

Introduction to SCIP. Gregor Hendel, SCIP Introduction Day September 26, rd IMI-ISM-ZIB MODAL Workshop Introduction to SCIP Gregor Hendel, hendel@zib.de SCIP Introduction Day September 26, 2018 3rd IMI-ISM-ZIB MODAL Workshop What is SCIP? SCIP (Solving Constraint Integer Programs)... provides a full-scale

More information

SCIP Workshop Visit scip.zib.de/workshop2018 for all information. Tomorrow and on Thursday: Scientific Talks

SCIP Workshop Visit scip.zib.de/workshop2018 for all information. Tomorrow and on Thursday: Scientific Talks SCIP Workshop 2018 Structure of the SCIP Introduction Day 9:30 11:00 Introduction to SCIP 11:00 11:30 Coffee Break 11:30 12:30 Installation of SCIP and GCG 12:30 14:00 Lunch 14:00 17:30 Programming Exercises

More information

Primal Heuristics in SCIP

Primal Heuristics in SCIP Primal Heuristics in SCIP Timo Berthold Zuse Institute Berlin DFG Research Center MATHEON Mathematics for key technologies Berlin, 10/11/2007 Outline 1 Introduction Basics Integration Into SCIP 2 Available

More information

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem L. De Giovanni M. Di Summa The Traveling Salesman Problem (TSP) is an optimization problem on a directed

More information

Fundamentals of Integer Programming

Fundamentals of Integer Programming Fundamentals of Integer Programming Di Yuan Department of Information Technology, Uppsala University January 2018 Outline Definition of integer programming Formulating some classical problems with integer

More information

Addressing degeneracy in the dual simplex algorithm using a decompositon approach

Addressing degeneracy in the dual simplex algorithm using a decompositon approach Addressing degeneracy in the dual simplex algorithm using a decompositon approach Ambros Gleixner, Stephen J Maher, Matthias Miltenberger Zuse Institute Berlin Berlin, Germany 16th July 2015 @sj_maher

More information

Motivation for Heuristics

Motivation for Heuristics MIP Heuristics 1 Motivation for Heuristics Why not wait for branching? Produce feasible solutions as quickly as possible Often satisfies user demands Avoid exploring unproductive sub trees Better reduced

More information

MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms

MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms Ann-Brith Strömberg 2018 04 24 Lecture 9 Linear and integer optimization with applications

More information

Combinatorial Optimization - Lecture 14 - TSP EPFL

Combinatorial Optimization - Lecture 14 - TSP EPFL Combinatorial Optimization - Lecture 14 - TSP EPFL 2012 Plan Simple heuristics Alternative approaches Best heuristics: local search Lower bounds from LP Moats Simple Heuristics Nearest Neighbor (NN) Greedy

More information

Solving lexicographic multiobjective MIPs with Branch-Cut-Price

Solving lexicographic multiobjective MIPs with Branch-Cut-Price Solving lexicographic multiobjective MIPs with Branch-Cut-Price Marta Eso (The Hotchkiss School) Laszlo Ladanyi (IBM T.J. Watson Research Center) David Jensen (IBM T.J. Watson Research Center) McMaster

More information

Advanced Use of GAMS Solver Links

Advanced Use of GAMS Solver Links Advanced Use of GAMS Solver Links Michael Bussieck, Steven Dirkse, Stefan Vigerske GAMS Development 8th January 2013, ICS Conference, Santa Fe Standard GAMS solve Solve william minimizing cost using mip;

More information

MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg

MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg MVE165/MMG630, Integer linear programming algorithms Ann-Brith Strömberg 2009 04 15 Methods for ILP: Overview (Ch. 14.1) Enumeration Implicit enumeration: Branch and bound Relaxations Decomposition methods:

More information

Handling first-order linear constraints with SCIP

Handling first-order linear constraints with SCIP Handling first-order linear constraints with SCIP James Cussens, University of York KU Leuven, 2015-02-16 James Cussens, University of York FO with SCIP KU Leuven, 2015-02-16 1 / 18 MIP Mixed integer programs

More information

SCIP. 1 Introduction. 2 Model requirements. Contents. Stefan Vigerske, Humboldt University Berlin, Germany

SCIP. 1 Introduction. 2 Model requirements. Contents. Stefan Vigerske, Humboldt University Berlin, Germany SCIP Stefan Vigerske, Humboldt University Berlin, Germany Contents 1 Introduction.................................................. 673 2 Model requirements..............................................

More information

Exploiting Degeneracy in MIP

Exploiting Degeneracy in MIP Exploiting Degeneracy in MIP Tobias Achterberg 9 January 2018 Aussois Performance Impact in Gurobi 7.5+ 35% 32.0% 30% 25% 20% 15% 14.6% 10% 5.7% 7.9% 6.6% 5% 0% 2.9% 1.2% 0.1% 2.6% 2.6% Time limit: 10000

More information

The Gurobi Solver V1.0

The Gurobi Solver V1.0 The Gurobi Solver V1.0 Robert E. Bixby Gurobi Optimization & Rice University Ed Rothberg, Zonghao Gu Gurobi Optimization 1 1 Oct 09 Overview Background Rethinking the MIP solver Introduction Tree of Trees

More information

Welcome to the Webinar. What s New in Gurobi 7.5

Welcome to the Webinar. What s New in Gurobi 7.5 Welcome to the Webinar What s New in Gurobi 7.5 Speaker Introduction Dr. Tobias Achterberg Director of R&D at Gurobi Optimization Formerly a developer at ILOG, where he worked on CPLEX 11.0 to 12.6 Obtained

More information

Mathematical Tools for Engineering and Management

Mathematical Tools for Engineering and Management Mathematical Tools for Engineering and Management Lecture 8 8 Dec 0 Overview Models, Data and Algorithms Linear Optimization Mathematical Background: Polyhedra, Simplex-Algorithm Sensitivity Analysis;

More information

DETERMINISTIC OPERATIONS RESEARCH

DETERMINISTIC OPERATIONS RESEARCH DETERMINISTIC OPERATIONS RESEARCH Models and Methods in Optimization Linear DAVID J. RADER, JR. Rose-Hulman Institute of Technology Department of Mathematics Terre Haute, IN WILEY A JOHN WILEY & SONS,

More information

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs Introduction to Mathematical Programming IE496 Final Review Dr. Ted Ralphs IE496 Final Review 1 Course Wrap-up: Chapter 2 In the introduction, we discussed the general framework of mathematical modeling

More information

Outline. Modeling. Outline DMP204 SCHEDULING, TIMETABLING AND ROUTING. 1. Models Lecture 5 Mixed Integer Programming Models and Exercises

Outline. Modeling. Outline DMP204 SCHEDULING, TIMETABLING AND ROUTING. 1. Models Lecture 5 Mixed Integer Programming Models and Exercises Outline DMP204 SCHEDULING, TIMETABLING AND ROUTING 1. Lecture 5 Mixed Integer Programming and Exercises Marco Chiarandini 2. 3. 2 Outline Modeling 1. Min cost flow Shortest path 2. Max flow Assignment

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

Column Generation Based Primal Heuristics

Column Generation Based Primal Heuristics Column Generation Based Primal Heuristics C. Joncour, S. Michel, R. Sadykov, D. Sverdlov, F. Vanderbeck University Bordeaux 1 & INRIA team RealOpt Outline 1 Context Generic Primal Heuristics The Branch-and-Price

More information

DM515 Spring 2011 Weekly Note 7

DM515 Spring 2011 Weekly Note 7 Institut for Matematik og Datalogi Syddansk Universitet May 18, 2011 JBJ DM515 Spring 2011 Weekly Note 7 Stuff covered in Week 20: MG sections 8.2-8,3 Overview of the course Hints for the exam Note that

More information

The SCIP Optimization Suite 3.2

The SCIP Optimization Suite 3.2 The SCIP Optimization Suite 3.2 Gerald Gamrath 1, Tobias Fischer 2, Tristan Gally 2, Ambros M. Gleixner 1, Gregor Hendel 1, Thorsten Koch 1, Stephen J. Maher 1, Matthias Miltenberger 1, Benjamin Müller

More information

Column Generation Method for an Agent Scheduling Problem

Column Generation Method for an Agent Scheduling Problem Column Generation Method for an Agent Scheduling Problem Balázs Dezső Alpár Jüttner Péter Kovács Dept. of Algorithms and Their Applications, and Dept. of Operations Research Eötvös Loránd University, Budapest,

More information

Combinatorial Optimization Lab No. 10 Traveling Salesman Problem

Combinatorial Optimization Lab No. 10 Traveling Salesman Problem Combinatorial Optimization Lab No. 10 Traveling Salesman Problem Industrial Informatics Research Center http://industrialinformatics.cz/ May 29, 2018 Abstract In this lab we review various ways how to

More information

Algorithms II MIP Details

Algorithms II MIP Details Algorithms II MIP Details What s Inside Gurobi Optimizer Algorithms for continuous optimization Algorithms for discrete optimization Automatic presolve for both LP and MIP Algorithms to analyze infeasible

More information

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

February 19, Integer programming. Outline. Problem formulation. Branch-andbound Olga Galinina olga.galinina@tut.fi ELT-53656 Network Analysis and Dimensioning II Department of Electronics and Communications Engineering Tampere University of Technology, Tampere, Finland February 19,

More information

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998 56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998 Part A: Answer any four of the five problems. (15 points each) 1. Transportation problem 2. Integer LP Model Formulation

More information

How to use your favorite MIP Solver: modeling, solving, cannibalizing. Andrea Lodi University of Bologna, Italy

How to use your favorite MIP Solver: modeling, solving, cannibalizing. Andrea Lodi University of Bologna, Italy How to use your favorite MIP Solver: modeling, solving, cannibalizing Andrea Lodi University of Bologna, Italy andrea.lodi@unibo.it January-February, 2012 @ Universität Wien A. Lodi, How to use your favorite

More information

A Generic Separation Algorithm and Its Application to the Vehicle Routing Problem

A Generic Separation Algorithm and Its Application to the Vehicle Routing Problem A Generic Separation Algorithm and Its Application to the Vehicle Routing Problem Presented by: Ted Ralphs Joint work with: Leo Kopman Les Trotter Bill Pulleyblank 1 Outline of Talk Introduction Description

More information

Benders in a nutshell Matteo Fischetti, University of Padova

Benders in a nutshell Matteo Fischetti, University of Padova Benders in a nutshell Matteo Fischetti, University of Padova ODS 2017, Sorrento, September 2017 1 Benders decomposition The original Benders decomposition from the 1960s uses two distinct ingredients for

More information

12.1 Formulation of General Perfect Matching

12.1 Formulation of General Perfect Matching CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Perfect Matching Polytope Date: 22/02/2008 Lecturer: Lap Chi Lau Scribe: Yuk Hei Chan, Ling Ding and Xiaobing Wu In this lecture,

More information

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods 5.8J Integer Programming and Combinatorial Optimization Fall 9 A knapsack problem Enumerative Methods Let s focus on maximization integer linear programs with only binary variables For example: a knapsack

More information

5.3 Cutting plane methods and Gomory fractional cuts

5.3 Cutting plane methods and Gomory fractional cuts 5.3 Cutting plane methods and Gomory fractional cuts (ILP) min c T x s.t. Ax b x 0integer feasible region X Assumption: a ij, c j and b i integer. Observation: The feasible region of an ILP can be described

More information

Exact solutions to mixed-integer linear programming problems

Exact solutions to mixed-integer linear programming problems Exact solutions to mixed-integer linear programming problems Dan Steffy Zuse Institute Berlin and Oakland University Joint work with Bill Cook, Thorsten Koch and Kati Wolter November 18, 2011 Mixed-Integer

More information

Last topic: Summary; Heuristics and Approximation Algorithms Topics we studied so far:

Last topic: Summary; Heuristics and Approximation Algorithms Topics we studied so far: Last topic: Summary; Heuristics and Approximation Algorithms Topics we studied so far: I Strength of formulations; improving formulations by adding valid inequalities I Relaxations and dual problems; obtaining

More information

Integer Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University

Integer Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University Integer Programming Xi Chen Department of Management Science and Engineering International Business School Beijing Foreign Studies University Xi Chen (chenxi0109@bfsu.edu.cn) Integer Programming 1 / 42

More information

Solutions to Assignment# 4

Solutions to Assignment# 4 Solutions to Assignment# 4 Liana Yepremyan 1 Nov.12: Text p. 651 problem 1 Solution: (a) One example is the following. Consider the instance K = 2 and W = {1, 2, 1, 2}. The greedy algorithm would load

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A 4 credit unit course Part of Theoretical Computer Science courses at the Laboratory of Mathematics There will be 4 hours

More information

Applied Mixed Integer Programming: Beyond 'The Optimum'

Applied Mixed Integer Programming: Beyond 'The Optimum' Applied Mixed Integer Programming: Beyond 'The Optimum' 14 Nov 2016, Simons Institute, Berkeley Pawel Lichocki Operations Research Team, Google https://developers.google.com/optimization/ Applied Mixed

More information

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I Instructor: Shaddin Dughmi Announcements Posted solutions to HW1 Today: Combinatorial problems

More information

A constant-factor approximation algorithm for the asymmetric travelling salesman problem

A constant-factor approximation algorithm for the asymmetric travelling salesman problem A constant-factor approximation algorithm for the asymmetric travelling salesman problem London School of Economics Joint work with Ola Svensson and Jakub Tarnawski cole Polytechnique F d rale de Lausanne

More information

Solutions for the Exam 6 January 2014

Solutions for the Exam 6 January 2014 Mastermath and LNMB Course: Discrete Optimization Solutions for the Exam 6 January 2014 Utrecht University, Educatorium, 13:30 16:30 The examination lasts 3 hours. Grading will be done before January 20,

More information

On Mixed-Integer (Linear) Programming and its connection with Data Science

On Mixed-Integer (Linear) Programming and its connection with Data Science On Mixed-Integer (Linear) Programming and its connection with Data Science Andrea Lodi Canada Excellence Research Chair École Polytechnique de Montréal, Québec, Canada andrea.lodi@polymtl.ca January 16-20,

More information

The Gurobi Optimizer. Bob Bixby

The Gurobi Optimizer. Bob Bixby The Gurobi Optimizer Bob Bixby Outline Gurobi Introduction Company Products Benchmarks Gurobi Technology Rethinking MIP MIP as a bag of tricks 8-Jul-11 2010 Gurobi Optimization 2 Gurobi Optimization Incorporated

More information

Algorithms for Integer Programming

Algorithms for Integer Programming Algorithms for Integer Programming Laura Galli November 9, 2016 Unlike linear programming problems, integer programming problems are very difficult to solve. In fact, no efficient general algorithm is

More information

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen University of Copenhagen Outline Motivation and Background Minimum-Weight Spanner Problem Greedy Spanner Algorithm Exact Algorithm:

More information

Integer Programming Chapter 9

Integer Programming Chapter 9 1 Integer Programming Chapter 9 University of Chicago Booth School of Business Kipp Martin October 30, 2017 2 Outline Branch and Bound Theory Branch and Bound Linear Programming Node Selection Strategies

More information

Algorithms for Euclidean TSP

Algorithms for Euclidean TSP This week, paper [2] by Arora. See the slides for figures. See also http://www.cs.princeton.edu/~arora/pubs/arorageo.ps Algorithms for Introduction This lecture is about the polynomial time approximation

More information

Column Generation and its applications

Column Generation and its applications Column Generation and its applications Murat Firat, dept. IE&IS, TU/e BPI Cluster meeting Outline Some real-life decision problems Standard formulations Basics of Column Generation Master formulations

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 29 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/7/2016 Approximation

More information

Assignment 3b: The traveling salesman problem

Assignment 3b: The traveling salesman problem Chalmers University of Technology MVE165 University of Gothenburg MMG631 Mathematical Sciences Linear and integer optimization Optimization with applications Emil Gustavsson Assignment information Ann-Brith

More information

Machine Learning for Software Engineering

Machine Learning for Software Engineering Machine Learning for Software Engineering Introduction and Motivation Prof. Dr.-Ing. Norbert Siegmund Intelligent Software Systems 1 2 Organizational Stuff Lectures: Tuesday 11:00 12:30 in room SR015 Cover

More information

A List Heuristic for Vertex Cover

A List Heuristic for Vertex Cover A List Heuristic for Vertex Cover Happy Birthday Vasek! David Avis McGill University Tomokazu Imamura Kyoto University Operations Research Letters (to appear) Online: http://cgm.cs.mcgill.ca/ avis revised:

More information

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS Subhas C. Nandy (nandysc@isical.ac.in) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 70010, India. Organization Introduction

More information

Unit.9 Integer Programming

Unit.9 Integer Programming Unit.9 Integer Programming Xiaoxi Li EMS & IAS, Wuhan University Dec. 22-29, 2016 (revised) Operations Research (Li, X.) Unit.9 Integer Programming Dec. 22-29, 2016 (revised) 1 / 58 Organization of this

More information

Dual-fitting analysis of Greedy for Set Cover

Dual-fitting analysis of Greedy for Set Cover Dual-fitting analysis of Greedy for Set Cover We showed earlier that the greedy algorithm for set cover gives a H n approximation We will show that greedy produces a solution of cost at most H n OPT LP

More information

lpsymphony - Integer Linear Programming in R

lpsymphony - Integer Linear Programming in R lpsymphony - Integer Linear Programming in R Vladislav Kim October 30, 2017 Contents 1 Introduction 2 2 lpsymphony: Quick Start 2 3 Integer Linear Programming 5 31 Equivalent and Dual Formulations 5 32

More information

A LARGE SCALE INTEGER AND COMBINATORIAL OPTIMIZER

A LARGE SCALE INTEGER AND COMBINATORIAL OPTIMIZER A LARGE SCALE INTEGER AND COMBINATORIAL OPTIMIZER By Qun Chen A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy (Industrial Engineering) at the

More information

Computational Integer Programming. Lecture 12: Branch and Cut. Dr. Ted Ralphs

Computational Integer Programming. Lecture 12: Branch and Cut. Dr. Ted Ralphs Computational Integer Programming Lecture 12: Branch and Cut Dr. Ted Ralphs Computational MILP Lecture 12 1 Reading for This Lecture Wolsey Section 9.6 Nemhauser and Wolsey Section II.6 Martin Computational

More information

to the Traveling Salesman Problem 1 Susanne Timsj Applied Optimization and Modeling Group (TOM) Department of Mathematics and Physics

to the Traveling Salesman Problem 1 Susanne Timsj Applied Optimization and Modeling Group (TOM) Department of Mathematics and Physics An Application of Lagrangian Relaxation to the Traveling Salesman Problem 1 Susanne Timsj Applied Optimization and Modeling Group (TOM) Department of Mathematics and Physics M lardalen University SE-721

More information

The Heuristic (Dark) Side of MIP Solvers. Asja Derviskadic, EPFL Vit Prochazka, NHH Christoph Schaefer, EPFL

The Heuristic (Dark) Side of MIP Solvers. Asja Derviskadic, EPFL Vit Prochazka, NHH Christoph Schaefer, EPFL The Heuristic (Dark) Side of MIP Solvers Asja Derviskadic, EPFL Vit Prochazka, NHH Christoph Schaefer, EPFL 1 Table of content [Lodi], The Heuristic (Dark) Side of MIP Solvers, Hybrid Metaheuristics, 273-284,

More information

val(y, I) α (9.0.2) α (9.0.3)

val(y, I) α (9.0.2) α (9.0.3) CS787: Advanced Algorithms Lecture 9: Approximation Algorithms In this lecture we will discuss some NP-complete optimization problems and give algorithms for solving them that produce a nearly optimal,

More information

Primal Heuristics for Branch-and-Price Algorithms

Primal Heuristics for Branch-and-Price Algorithms Primal Heuristics for Branch-and-Price Algorithms Marco Lübbecke and Christian Puchert Abstract In this paper, we present several primal heuristics which we implemented in the branch-and-price solver GCG

More information

Exact Algorithms for NP-hard problems

Exact Algorithms for NP-hard problems 24 mai 2012 1 Why do we need exponential algorithms? 2 3 Why the P-border? 1 Practical reasons (Jack Edmonds, 1965) For practical purposes the difference between algebraic and exponential order is more

More information

Two-layer Network Design by Branch-and-Cut featuring MIP-based Heuristics

Two-layer Network Design by Branch-and-Cut featuring MIP-based Heuristics Two-layer Network Design by Branch-and-Cut featuring MIP-based Heuristics Sebastian Orlowski, Zuse Institute Berlin, Takustr. 7, D-14195 Berlin, orlowski@zib.de Arie M.C.A. Koster, Zuse Institute Berlin,

More information

Practice Final Exam 2: Solutions

Practice Final Exam 2: Solutions lgorithm Design Techniques Practice Final Exam 2: Solutions 1. The Simplex lgorithm. (a) Take the LP max x 1 + 2x 2 s.t. 2x 1 + x 2 3 x 1 x 2 2 x 1, x 2 0 and write it in dictionary form. Pivot: add x

More information

Cloud Branching MIP workshop, Ohio State University, 23/Jul/2014

Cloud Branching MIP workshop, Ohio State University, 23/Jul/2014 Cloud Branching MIP workshop, Ohio State University, 23/Jul/2014 Timo Berthold Xpress Optimization Team Gerald Gamrath Zuse Institute Berlin Domenico Salvagnin Universita degli Studi di Padova This presentation

More information

Integer Programming Theory

Integer Programming Theory Integer Programming Theory Laura Galli October 24, 2016 In the following we assume all functions are linear, hence we often drop the term linear. In discrete optimization, we seek to find a solution x

More information

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?) P vs. NP What now? Attribution These slides were prepared for the New Jersey Governor s School course The Math Behind the Machine taught in the summer of 2011 by Grant Schoenebeck Large parts of these

More information

Tutorial on Integer Programming for Visual Computing

Tutorial on Integer Programming for Visual Computing Tutorial on Integer Programming for Visual Computing Peter Wonka and Chi-han Peng November 2018 1 1 Notation The vector space is denoted as R,R n,r m n,v,w Matricies are denoted by upper case, italic,

More information

The Subtour LP for the Traveling Salesman Problem

The Subtour LP for the Traveling Salesman Problem The Subtour LP for the Traveling Salesman Problem David P. Williamson Cornell University November 22, 2011 Joint work with Jiawei Qian, Frans Schalekamp, and Anke van Zuylen The Traveling Salesman Problem

More information

Integer Programming! Using linear programming to solve discrete problems

Integer Programming! Using linear programming to solve discrete problems Integer Programming! Using linear programming to solve discrete problems Solving Discrete Problems Linear programming solves continuous problem! problems over the reai numbers.! For the remainder of the

More information

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP 1 Primal Dual Schema Approach to the Labeling Problem with Applications to TSP Colin Brown, Simon Fraser University Instructor: Ramesh Krishnamurti The Metric Labeling Problem has many applications, especially

More information

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs Integer Programming ISE 418 Lecture 7 Dr. Ted Ralphs ISE 418 Lecture 7 1 Reading for This Lecture Nemhauser and Wolsey Sections II.3.1, II.3.6, II.4.1, II.4.2, II.5.4 Wolsey Chapter 7 CCZ Chapter 1 Constraint

More information

The SCIP Optimization Suite 4.0

The SCIP Optimization Suite 4.0 Zuse Institute Berlin Takustrasse 7 D-14195 Berlin-Dahlem Germany STEPHEN J. MAHER, TOBIAS FISCHER, TRISTAN GALLY, GERALD GAMRATH, AMBROS GLEIXNER, ROBERT LION GOTTWALD, GREGOR HENDEL, THORSTEN KOCH, MARCO

More information

3 INTEGER LINEAR PROGRAMMING

3 INTEGER LINEAR PROGRAMMING 3 INTEGER LINEAR PROGRAMMING PROBLEM DEFINITION Integer linear programming problem (ILP) of the decision variables x 1,..,x n : (ILP) subject to minimize c x j j n j= 1 a ij x j x j 0 x j integer n j=

More information

CSE 417 Branch & Bound (pt 4) Branch & Bound

CSE 417 Branch & Bound (pt 4) Branch & Bound CSE 417 Branch & Bound (pt 4) Branch & Bound Reminders > HW8 due today > HW9 will be posted tomorrow start early program will be slow, so debugging will be slow... Review of previous lectures > Complexity

More information

Integer Programming and Network Modeis

Integer Programming and Network Modeis H.A. Eiselt C.-L. Sandblom Integer Programming and Network Modeis With Contributions by K. Spielberg, E. Richards, B.T. Smith, G. Laporte, B.T. Boffey With 165 Figures and 43 Tables &m Springer CONTENTS

More information

Modern Benders (in a nutshell)

Modern Benders (in a nutshell) Modern Benders (in a nutshell) Matteo Fischetti, University of Padova (based on joint work with Ivana Ljubic and Markus Sinnl) Lunteren Conference on the Mathematics of Operations Research, January 17,

More information

7KH9HKLFOH5RXWLQJSUREOHP

7KH9HKLFOH5RXWLQJSUREOHP 7K9KO5RXWJSUREOP Given a set of vehicles with a certain capacity located at a depot and a set of customers with different demands at various locations, the vehicle routing problem (VRP) is how to satisfy

More information

A Steady-State Genetic Algorithm for Traveling Salesman Problem with Pickup and Delivery

A Steady-State Genetic Algorithm for Traveling Salesman Problem with Pickup and Delivery A Steady-State Genetic Algorithm for Traveling Salesman Problem with Pickup and Delivery Monika Sharma 1, Deepak Sharma 2 1 Research Scholar Department of Computer Science and Engineering, NNSS SGI Samalkha,

More information

Benders Decomposition

Benders Decomposition Benders Decomposition Using projections to solve problems thst@man.dtu.dk DTU-Management Technical University of Denmark 1 Outline Introduction Using projections Benders decomposition Simple plant location

More information

Outline. 1 The matching problem. 2 The Chinese Postman Problem

Outline. 1 The matching problem. 2 The Chinese Postman Problem Outline The matching problem Maximum-cardinality matchings in bipartite graphs Maximum-cardinality matchings in bipartite graphs: The augmenting path algorithm 2 Let G = (V, E) be an undirected graph.

More information

Heuristics in MILP. Group 1 D. Assouline, N. Molyneaux, B. Morén. Supervisors: Michel Bierlaire, Andrea Lodi. Zinal 2017 Winter School

Heuristics in MILP. Group 1 D. Assouline, N. Molyneaux, B. Morén. Supervisors: Michel Bierlaire, Andrea Lodi. Zinal 2017 Winter School Heuristics in MILP Group 1 D. Assouline, N. Molyneaux, B. Morén Supervisors: Michel Bierlaire, Andrea Lodi Zinal 2017 Winter School 0 / 23 Primal heuristics Original paper: Fischetti, M. and Lodi, A. (2011).

More information

Algorithms for Decision Support. Integer linear programming models

Algorithms for Decision Support. Integer linear programming models Algorithms for Decision Support Integer linear programming models 1 People with reduced mobility (PRM) require assistance when travelling through the airport http://www.schiphol.nl/travellers/atschiphol/informationforpassengerswithreducedmobility.htm

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 18 All-Integer Dual Algorithm We continue the discussion on the all integer

More information

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Decision Problems Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Definition: The class of problems that can be solved by polynomial-time

More information

Lecture 14: Linear Programming II

Lecture 14: Linear Programming II A Theorist s Toolkit (CMU 18-859T, Fall 013) Lecture 14: Linear Programming II October 3, 013 Lecturer: Ryan O Donnell Scribe: Stylianos Despotakis 1 Introduction At a big conference in Wisconsin in 1948

More information

Modelling of LP-problems (2WO09)

Modelling of LP-problems (2WO09) Modelling of LP-problems (2WO09) assignor: Judith Keijsper room: HG 9.31 email: J.C.M.Keijsper@tue.nl course info : http://www.win.tue.nl/ jkeijspe Technische Universiteit Eindhoven meeting 1 J.Keijsper

More information

sbb COIN-OR Simple Branch-and-Cut

sbb COIN-OR Simple Branch-and-Cut sbb COIN-OR Simple Branch-and-Cut John Forrest Lou Hafer lou@cs.sfu.ca CORS/INFORMS Joint Meeting Banff, May 2004 p.1/12 Outline Basic Branch-and-Bound Branching Node Selection Cuts and Heuristics Using

More information

Martin W.P. Savelsbergh. Georgia Institute of Technology. School of Industrial and Systems Engineering

Martin W.P. Savelsbergh. Georgia Institute of Technology. School of Industrial and Systems Engineering A MINTO short course 1 Martin W.P. Savelsbergh George L. Nemhauser Introduction Georgia Institute of Technology School of Industrial and Systems Engineering Atlanta, GA 30332-0205 (February 1, 1995) MINTO

More information

Gurobi Guidelines for Numerical Issues February 2017

Gurobi Guidelines for Numerical Issues February 2017 Gurobi Guidelines for Numerical Issues February 2017 Background Models with numerical issues can lead to undesirable results: slow performance, wrong answers or inconsistent behavior. When solving a model

More information

Solutions for Operations Research Final Exam

Solutions for Operations Research Final Exam Solutions for Operations Research Final Exam. (a) The buffer stock is B = i a i = a + a + a + a + a + a 6 + a 7 = + + + + + + =. And the transportation tableau corresponding to the transshipment problem

More information

56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997

56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997 56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997 Answer #1 and any five of the remaining six problems! possible score 1. Multiple Choice 25 2. Traveling Salesman Problem 15 3.

More information