welcome to the webinar - gurobi - the fastest solver - gurobi

32
Welcome to the Webinar What’s New in Gurobi 7.5

Upload: others

Post on 05-Jun-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Welcome to the WebinarWhat’s New in Gurobi 7.5

Page 2: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.2

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 his degree in mathematics and computer science from the Technical University of Berlin and the Zuse Institute Berlin, then finished doctorate in mathematics with Prof. Martin Grötschel in 2007

• Dr. Achterberg is the author of SCIP which is regarded as the best academic MIP solver

Page 3: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.3

What's New?

• New features in Gurobi 7.5• Improved Python interface• Multi-objective improvements• JavaDoc documentation• Support new versions of Python, R, Visual Studio• Compute Server communication statistics• New parameters• Additional minor enhancements

• Performance improvements

Page 4: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.4

Python Modeling Enhancements

Page 5: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.5

Python Modeling Enhancements

• Significant simplification of our Python API• Simpler implementation of mathematical models

• Model.addConstr: handles general constraints, range constraints and indicator constraints• Model.addConstrs: allows you to use Python generator expressions over all constraint types• GCHelper: helper functions for handling general constraints

• Python models become more concise and easier to read

Page 6: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.6

Python Modeling Enhancements – addConstr()

• Integrated algebraic interface for adding constraints• Old:

• model.addQConstr( x*x + y*y <= 2.0, ’c1’)• model.addRange( x+y, 1.0, 2.0, ’c2’)• model.addGenConstrIndicator( x, True, y+z == 1.0, ’c3’)• model.addGenConstrMax( x, [y,z], 2.0, ’c4’)

• New:• model.addConstr( x*y + y*y <= 2.0, ’c1’)• model.addConstr( x+y == [1.0,2.0], ’c2’)• model.addConstr((x == 1) >> (y+z == 1.0), ’c3’)• model.addConstr( x == max_(y,z,2.0), ’c4’)

Page 7: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.7

Python Modeling Enhancements – Helper Functions

• General constraint helper functions:• We introduced functions max_(), min_(), abs_(), and_(), or_() to simplify construction of

general constraints• model.addConstr(x == abs_(y))• model.addConstr(x == or_(y,z,w))• Note: any_() can be used as a synonym for or_()

• Integrate general constraints with addConstrs()• The new syntax allows you to add sets of general constraints in batches• Old:

• New:

X, Y, Gcons = model.addVars(10), model.addVars(10), {}for i in X:Gcons[i] = model.addGenConstrMin(X[i], [Y[i], 10], name=’Gc’)

X, Y = model.addVars(10), model.addVars(10)Gcons = model.addConstrs((X[i] == min_(Y[i],10) for i in X), name=’Gc’)

Page 8: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.8

Python Modeling Enhancements – remove()

• We extended model.remove() to handle lists, tuples and dictionaries of objects• Old:

• New:

for i in model.getConstrs():model.remove(i)

model.remove(model.getConstrs())

Page 9: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.9

Enhanced Multi-Objective API

Page 10: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.10

Enhanced Multi-Objective API

• Easier definition of multiple objectives• We introduced model.setObjectiveN(LinExpr, index, ...)

Old (Gurobi 7.0):

coef1 = [0, 1, 2, 3, 4]coef2 = [4, 3, 2, 1, 0]x = model.addVars(5)

model.NumObj = 2model.Params.ObjNumber = 0model.ObjNPriority = 2model.ObjNWeight = 1model.setAttr(GRB.Attr.ObjN, x, coef1)model.Params.ObjNumber = 1model.ObjNPriority = 1model.ObjNWeight = 1model.setAttr(GRB.Attr.ObjN, x, coef2)

New (Gurobi 7.5):

coef1 = [0, 1, 2, 3, 4]coef2 = [4, 3, 2, 1, 0]x = model.addVars(5)

model.setObjectiveN(x.prod(coef1), 0,priority=2, weight=1)

model.setObjectiveN(x.prod(coef2), 1,priority=1, weight=1)

Or equivalently:

x = model.addVars(5)model.setObjectiveN(x[1]+2*x[2]+3*x[3]+4*x[4],

0, priority=2, weight=1)model.setObjectiveN(4*x[0]+3*x[1]+2*x[2]+x[3],

1, priority=1, weight=1)

Page 11: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.11

Enhanced Multi-Objective API

• Enhanced termination control for multi-objective optimization• We introduced model.getMultiobjEnv():

• Allows for fine-grained control of each multi-objective optimization pass• Algorithmic choices• Termination criteria

• One optimization pass per objective priority level• Settings for additional objectives of same priority level are ignored

• Use MIP starts for first priority level objective solve

env0 = model.getMultiobjEnv(0)env1 = model.getMultiobjEnv(1)

env0.setParam(‘TimeLimit’,100)env1.setParam(‘TimeLimit’,10)

model.optimize()model.discardMultiobjEnvs()

Page 12: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.12

Other Enhancements

Page 13: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.13

JavaDoc Documentation

• Contains our full documentation• Can be used in any IDE that supports JavaDoc, e.g. Eclipse• Provided as gurobi-javadoc.jar

Page 14: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.14

Platforms

• Added support for Python 3.6• Plus a Mac Anaconda 3.6 package

• Added support for Visual Studio 2017 on Windows• Added support for R 3.4

Page 15: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.15

Compute Server Statistics

• When remote environment is freed, we print communication statistics to the log:

Compute Server communication statistics: Sent: 8.3 MBytes in 244 msgs and 0.76s (10.92 MB/s) Received: 7.2 MBytes in 304603 msgs and 1.53s (4.71 MB/s)

• Useful to assess overhead of Compute Server or cloud communication

Page 16: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.16

New Parameters

• We added two additional parameters:

• IgnoreNames: Discard all user-provided names: constraint, variable and problem names• User request to satisfy security concern when application is deployed in the cloud or using Compute Server• Also useful to generate recording file to send to Gurobi support if sending names is a security concern

• StartNodeLimit: Provides additional control over how much work is performed to complete a partial MIP start

Page 17: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.17

Additional Enhancements• Improved performance of .NET expression building• No longer use "using" keyword in C++ header files• Python:

• Raise AttributeError instead of GurobiError if attributes are used incorrectly• printQuality() also shows which variable/constraint is the maximally violated one

• Added Callback.useSolution()• add solution immediately, and check if it is feasible

• Automatically flush pending changes when GRBpresolvemodel() is called• Well-defined meaning of setting NodeLimit to 0• Support file compression for recording files• Improved numerics in

• piece-wise linear simplex• presolve aggregator• presolve fixing of variables with almost identical bounds• min/max calculation of constraint activities in presolve• Gomory cuts• reduced number of cases where solution exhibits small constraint violations

• Setting user cutoff equal to optimal value will always lead to finding such solution instead of a cutoff status

Page 18: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.18

Performance Improvements

Page 19: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.19

Two Kinds of Benchmarks

• Internal benchmarks• Most important: compare Gurobi version-over-version• Based on internal library of 4538 models

• External, competitive benchmarks• Conducted by Hans Mittelmann, Arizona State University

• http://plato.asu.edu/bench.html• For MIP largely based upon MIPLIB 2010

Page 20: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.20

Internal Benchmarks

Page 21: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.21

Gurobi MIP Library

(4538 models)

1

10

100

1000

10000

100000

1000000

10000000

100000000

1E+09

1 10 100 1000 10000 100000 1000000 10000000 100000000

Col

umns

Rows

100,000

1,000,000

Page 22: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.22

Performance Improvements in Gurobi 7.5

ProblemClass

>1s >100s

# Wins Losses Speedup # Wins Losses Speedup

LP: concur. 449 120 122 1.15x 149 62 42 1.47x

primal 450 109 132 1.15x 201 63 55 1.28x

dual 440 134 115 1.19x 168 71 49 1.42x

barrier 458 113 141 1.09x 155 67 48 1.34x

QCP/SOCP 93 18 9 1.17x 9 3 0 3.03x

MIP 2103 1027 636 1.33x 901 526 259 1.70x

MIQP 120 71 25 3.22x 65 44 12 7.66xMIQCP 244 70 111 0.91x 62 28 24 0.97x

• Gurobi 7.0 vs. 7.5: > 1.00x means that Gurobi 7.5 is faster than Gurobi 7.0

Page 23: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.23

Continual Performance Improvements

538

456

371335

286

200

92

46

0

100

200

300

400

500

600

v1.1 v2.0 v3.0 v4.0 v5.0 v6.0 v7.0 v7.5

Number of unsolved models

Time limit: 10000 sec.Intel Xeon CPU E3-1240 v3 @ 3.40GHz4 cores, 8 hyper-threads32 GB RAM

MIP test set has 3420 models:- 217 discarded due to inconsistent answers- 788 discarded that none of the versions can solve

Page 24: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.24

Where do the MIP improvements come from?

Page 25: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.25

MIP Improvements in Gurobi 7.5

• Presolve 7.8%• Improved multi-row reductions 2.0%• More efficient GUB usage and improved lifting 0.7%• Improved domain propagation 0.4%• Improved cancelation and fill handling 1.5%• More lifting of knapsack constraints 0.5%• Improved work limits 1.1%• Extract common sub-expressions 0.4%• Euclidian reductions in bound strengthening 1.0%

• Node presolve 4.2%• Improved work limits in probing 0.3%• Dual propagation for probing 0.8%• Propagate dual bound 1.0%• Improved conflict analysis 1.3%• Exploit cliques for reduced cost strengthening 0.7%

Page 26: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.26

MIP Improvements in Gurobi 7.5

• Symmetry 7.0%• Improved symmetry detection performance 4.1%• Apply orbital probing to non-binary variables 0.7%• Flip and split variables to induce symmetry 2.1%

• LP 17.5%• Use concurrent simplex for root solve 2.6%• Automatically select simplex and pricing strategy 2.5%• General LP solving improvements 11.7%

• Cuts 14.3%• Better root node control 6.3%• Improved sub-MIP cut separation 1.0%• Improved MIR and flow cover cuts 1.9%• Special odd-cycle cuts 1.3%• Improved aggregation 2.8%• Better clique cut separation 0.3%

Page 27: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.27

MIP Improvements in Gurobi 7.5

• Branching 2.8%• Improved default branching strategy 2.8%

• Heuristics 4.6%• Improved heuristics working on original model 0.9%• Improved heuristics run in parallel to root cut loop 1.1%• Improved work load balancing 1.4%• Improved automatic adjustment of RINS fixing rate 0.5%• More aggressive fix-and-dive heuristics 0.6%

• SOS constraints 11.4% on SOS models• Improved SOS presolve 2.4%• Node probing on SOS constraints 7.3%• Improved SOS branching rules 1.4%

Page 28: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.28

External Benchmarks

Hans Mittelmann: http://plato.asu.edu/bench.html

Page 29: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.29

MIP Solve Times• Gurobi 7.5 vs. Competition: Solve times

• > 1.0 means Gurobi faster

• Number of solved models in “solvable set”• P=12: Gurobi 210, Cplex 207, Xpress 197• P=48: Gurobi 211, Cplex 214, Xpress 200

• Complete test data available here (data from July 20, 2017):• http://plato.asu.edu/ftp/milpc.html: "Optimality", time limit 7200 sec.• http://plato.asu.edu/ftp/feas_bench.html: "Feasibility", time limit 3600 sec., time to first solution• http://plato.asu.edu/ftp/infeas.html: "Infeasibility", time limit 3600 sec.• http://plato.asu.edu/ftp/solvable.html: "Solvable", time limit 7200 sec.

Benchmark #CPLEX 12.7.1 XPRESS 8.2.1

P=1 P=4 P=12 P=48 P=1 P=4 P=12 P=48

Optimality 87 1.31x 1.37x 1.17x - 1.91x 1.60x 1.46x -

Feasibility 35 - 1.20x - - - 2.93x - -

Infeasibility 19 - 1.15x - - - 1.71x - -

"Solvable" Optim. 218 - - 1.10x 1.05x - - 1.95x 1.78x

Page 30: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.30

LP Solve Times

• Gurobi 7.5 vs. Competition: Solve times• > 1.0 means Gurobi faster

• Complete test data available here (data from July 20, 2017):• http://plato.asu.edu/ftp/lpsimp.html: Simplex, time limit 25000 sec., 8 threads• http://plato.asu.edu/ftp/lpcom.html: Barrier and concurrent, time limit 25000 sec., 8 threads

Benchmark # CPLEX 12.7.1

XPRESS 8.2.1

Mosek8.0

Simplex 40 1.91x 1.22x 3.65x

Barrier 45 1.84x 1.03x 2.33x

Concurrent 45 2.39x 1.15x -

Page 31: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.31

Quadratic Model Solve Times

• Gurobi 7.5 vs. Competition: Solve times• > 1.0 means Gurobi faster

• Complete test data available here (data from July 20, 2017):• http://plato.asu.edu/ftp/socp.html: SOCP, time limit 3600 sec., 8 threads• http://plato.asu.edu/ftp/misocp.html: MISOCP, time limit 7200 sec., 8 threads• http://plato.asu.edu/ftp/qplib.html: binary QP, time limit 3600 sec., 8 threads• http://plato.asu.edu/ftp/convex.html: convex discrete, time limit 7200 sec., 8 threads

Benchmark # CPLEX 12.7.1 XPRESS 8.2.1 Mosek 8.0

SOCP 18 3.99x 1.26x 1.02x

MISOCP 47 3.19x 1.12x 8.98x

Binary QP 57 1.37x 2.13x -

Convex discrete 19 1.15x 2.84x 4.94x

Page 32: Welcome to the Webinar - Gurobi - The fastest solver - Gurobi

Copyright 2017, Gurobi Optimization, Inc.32

Next Steps

• 7.5 upgrades for existing Gurobi users• Visit the What's New in Gurobi page and follow instructions in the bottom:

http://www.gurobi.com/products/whats-new/whats-new-in-the-latest-version

• For additional questions, or to request a free trial, contact us at [email protected]