the gurobi optimizerpython programs are typically stored in text files with .py extension ! most...

87
The Gurobi Optimizer

Upload: others

Post on 12-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

The Gurobi Optimizer

Page 2: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 2

Agenda

}  3:00-3:10 Introduction - Bob Bixby }  3:10-3:25 What's New in Gurobi 6.5 - Bob Bixby

}  3:25-4:00 Modeling with the Gurobi Python Interface - Renan Garcia }  4:00-4:15 Reformulation and Cutting Planes for MIQCP - Chris Maes

}  4:15-4:30 Break

}  4:30-5:00 Gurobi Instant Cloud - Chris Maes }  5:00-5:30 Benchmarks and Roadmap - Bob Bixby

Page 3: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 3

}  Gurobi Optimization, founded July 2008 }  Zonghao Gu, Ed Rothberg, Bob Bixby

}  Gurobi Version 1.0 released May 2009

}  History of continuing, significant innovations }  Free academic licenses }  First cloud offering }  Compute server for client-server applications }  Distributed algorithms

}  History of rapid, significant performance improvements }  Close to 2x average speedup year-over-year

Gurobi History

Page 4: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 4

Over 1,200 companies have made Gurobi their

solver of choice

Page 5: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 5

Why Companies Choose Gurobi

The most experienced development team focused 100% on delivering the best solver and user experience Performance Leader

End-to-End Offering Powerful modeling and development environments, flexible deployment options

Outstanding Support Direct access to PhD-level optimization experts for fast answers to your questions

No surprises Flexible licensing and transparent pricing to meet a full range of business situations

Page 6: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 6

}  Gurobi Solvers ◦  Mixed-Integer Programming (MIP, MIQP, MIQCP)

�  Deterministic, parallel

◦  Linear and Quadratic Programming �  Dual and primal simplex; Parallel Barrier

◦  Second-Order Cone Programming �  Parallel Barrier

}  APIs ◦  C, C++, Java, .NET, Python programming interfaces ◦  Simple command-line interface ◦  Python interactive interface ◦  Python modeling interface ◦  Gurobi Compute Server ◦  R and MATLAB matrix interfaces ◦  All standard modeling languages ◦  A variety of free-software projects

}  Commercial and Academic Licenses ◦  Licensing options and pricing available at www.gurobi.com

}  Cloud offering ◦  Amazon EC2 and our own Instant Cloud

}  Distributed Optimization offering

Gurobi Products Overview

Page 7: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 7

Very Strong Academic Offering

}  Free Named-user academic licenses ◦  Full-featured university version of Gurobi that can be installed on a single physical

machine.

}  Free multi-user academic site licenses ◦  Full-featured university version that can be installed on a university’s local-area

network.

}  Take Gurobi with You program ◦  First year free, including free support, for qualified recent graduates

Page 8: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 8

What's New in Gurobi 6.5

Page 9: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 9

Gurobi 6.5 Enhancements

}  Performance improvements }  Gurobi Instant Cloud

}  Variable hints }  API recorder and replay

Page 10: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 10

Gurobi 6.5 Enhancements -- Other

}  Python modeling ◦  Significant improvement in performance of expression building ◦  Ability to release Gurobi resources when you are done with a model

}  APIs ◦  IIS support in MATLAB ◦  R interface extensions

}  Licensing ◦  Password protection for token servers ◦  Single-use licenses without token server ◦  New command to provide location of current license file

}  Distributed ◦  Distributed MIP logging

}  Platforms ◦  Support for clang++ on Mac (libc++) ◦  Support for Visual Studio 2015 ◦  Compute Server encryption routines moved to a separate library

}  Other ◦  UpdateMode parameter ◦  BarX attribute to query the best barrier iterate ◦  OPB file format reader

Page 11: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 11

Variable Hints

}  Provide hints to the solver about which variable should take which value

}  Guides heuristics and branching }  VarHintVal attribute: ◦  Specifies value for variable

}  VarHintPri attribute: ◦  Specifies level of confidence in this particular variable value

}  Comparison to MIP starts: ◦  MIP start is used to provide an initial feasible solution to the solver

�  Is evaluated prior to starting the solution process �  Provides incumbent if feasible �  Does not influence solution process if it is not feasible

◦  Variable Hints guide the search �  High quality hints should lead to a high quality solution quickly

�  Either through heuristics or through branching �  Affects the whole solution process

Page 12: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 12

API Recorder

}  Setting Record parameter to 1 will produce recording000.grbr file ◦  Tracks all Gurobi API calls

}  Use gurobi_cl recording000.grbr to replay file ◦  Replay Gurobi execution independently from your own application

}  Use cases: ◦  Debug performance issues

�  Measures time spent in API calls (e.g., model building) and algorithms (solving) ◦  Identify cases where your program leaks Gurobi models or environments

�  Lists number of models and environments that were never freed by your program ◦  Relay exact sequence of commands your program issues to Gurobi

technical support in case you run into a question or issue that is difficult to reproduce �  Just send recording file, instead of having to send the whole application

Page 13: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Modeling with the Python Modeling Interface

Page 14: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 14

Goals for this tutorial

}  Understand the basics of modeling with the Gurobi Python Interface

}  Introduce new Python-related features added in version 6.5

}  Review detailed examples that highlight best modeling practices

}  Explore additional Python packages designed to increase productivity

Page 15: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 15

Example: LP model

A linear program (LP) is an optimization problem of the form

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

Page 16: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 16

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Decision variables

Page 17: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 17

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Objective function

Page 18: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 18

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Constraints

Page 19: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 19

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Data coefficients

Page 20: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 20

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Index sets

Page 21: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 21

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Subscripts

Page 22: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 22

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Arithmetic operators

Page 23: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 23

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Constraint operators

Page 24: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 24

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

For-all operators

Page 25: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 25

cj ⋅ x jj∈J∑

aij ⋅ x jj∈J∑ = bi ∀i ∈ I

l j ≤ x j ≤ uj ∀j ∈ J

minimize

subject to

LP model elements

Aggregate sum operators

Page 26: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 26

General optimization modeling constructs

}  Decision variables }  Objective function }  Constraints

}  Built with: ◦  Coefficients ◦  Indices and subscripts ◦  Operators

�  Basic arithmetic (+, -, ×, ÷) �  Constraint (≤, =, ≥) �  For-all �  Aggregate sum

Page 27: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 27

Building optimization models with Gurobi

}  Option 1 – use a modeling language ◦  Very easy to build models

�  Optimization modeling constructs built into language ◦  Attractive choice for non-programmers ◦  Alternatives: AMPL, GAMS, Pyomo, …

}  Option 2 – use a full programming language ◦  Much more powerful and flexible development environment

�  Complete access to solver functionality �  Richer set of language features

◦  Natural choice when deploying models and/or integrating them into applications for others to use

◦  Alternatives: C, C++, C#, Java, MATLAB, Python, R, VB

}  But what if users didn't have to choose between easy and powerful?

Page 28: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 28

Gurobi Python Environment

}  High-level optimization modeling constructs embedded in Python programming language ◦  Combines expressiveness of a modeling language with the power and

flexibility of a programming language

}  Design goals: ◦  Require minimal programming skills to get started ◦  Bring "feel" of a modeling language to the Python interface ◦  Allow for code that is easy to write and maintain ◦  Maintain unified design across all of our interfaces ◦  Remain lightweight and efficient (memory & CPU) when compared with

solver alone ◦  Support all solver and programming needs

}  Consistently earns high praise from our users

Page 29: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 29

Why Python?

}  Fast, powerful and easy-to-use

}  Extendible with vast library of prewritten modules (over 50,000) ◦  Statistical analysis, visualization, GUIs, web development, web services,

data connections, file compression, data encryption, …

}  One of top-10 most popular programming languages, according to TIOBE Programming Community Index ◦  http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html ◦  Large and rapidly growing Python community with great training resources

}  Interactive shell is useful for prototyping

}  Can be deployed to create full-featured optimization applications ◦  GUI, server, web, …

}  Free and open source with license that's business-friendly

Page 30: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 30

Getting started with Python

}  Don't need to be an expert to start modeling in Python

}  Nothing extra to buy or install ◦  Gurobi distribution includes Python interpreter and basic modules

}  Gurobi Interactive Shell is Python shell with Gurobi extensions ◦  Powerful environment for interacting with existing models

}  To launch the shell: ◦  Windows

�  Double-click the Gurobi icon on the desktop �  Or run gurobi from a Command Prompt window

◦  Linux �  Run the gurobi.sh command from a terminal

◦  Mac �  Click on the Gurobi icon in the Launchpad �  Or run the gurobi.sh command from a terminal

Page 31: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 31

Programming in Python

}  Python is a cross-platform, high-level programming language ◦  Object-oriented ◦  Interpreted ◦  Dynamically typed ◦  Automatic memory management ◦  Includes a large standard library ◦  Documentation tightly integrated with the code

}  Python programs are typically stored in text files with .py extension

}  Most functionality in Python is provided by modules ◦  To use a module in Python programs, include an import statement

}  To use the Gurobi interface, import the gurobipy module: from gurobipy import *

Page 32: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 32

Editing and running Python programs

}  Any text editor can be used to work with .py files ◦  Most programming editors have Python mode with syntax highlighting,

etc.

}  To run a program: ◦  Windows

�  At a Command Prompt window, enter gurobi [program_name]

◦  Linux/Mac �  At a terminal, enter

gurobi.sh [program_name]

}  Many IDEs available ◦  https://wiki.python.org/moin/IntegratedDevelopmentEnvironments ◦  Easy to install Gurobi in other Python distributions

Page 33: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 33

Essential Gurobi modeling constructs

}  Model a model }  Var a decision variable }  Constr a constraint

}  Overloaded operators ◦  Basic arithmetic (+, -, ×, ÷) ◦  Constraint (≤, =, ≥)

}  Aggregate sum operator (quicksum)

}  Python provides the rest!

Page 34: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 34

Typical steps for building a model

}  Create empty Model object with Model() constructor

}  Add variables with Model.addVar()

}  Call Model.update() once to process pending model updates ◦  Gurobi provides efficient "lazy updates" ◦  Only call Model.update() when necessary to reference new elements

}  Call Model.setObjective() to set objective function

}  Add constraints with Model.addConstr()

}  Solve the model with Model.optimize()◦  Will process any pending model updates

Page 35: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 35

Example: simple model

# Create empty Model

m = Model()

# Add variables

x = m.addVar(vtype=GRB.BINARY)

y = m.addVar(vtype=GRB.BINARY)

z = m.addVar(vtype=GRB.BINARY)

# Process pending updates

m.update()

Page 36: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 36

Example: simple model

# Set objective function

m.setObjective(x + y + 2*z, GRB.MAXIMIZE)

# Add constraints

m.addConstr(x + 2*y + 3*z <= 4)

m.addConstr(x + y >= 1)

# Solve model

m.optimize()

Page 37: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 37

Indices and subscripts in Python

}  List is a mutable sequence of elements ◦  Useful when representing index sets ◦  Elements of any type (integers, strings, …) indexed by integers (0 to n-1) ◦  Ex: cities=['CHI', 'NYC', 'ATL']; cities.append('MIA'); cities[2]='BOS'; cities.remove('NYC'); cities.sort()

}  Tuple is an immutable, compound grouping of elements ◦  Ideal for representing multidimensional subscripts ◦  Ex: arc=('CHI','NYC'); j=arc[1]

}  Dictionary is a mutable mapping from keys to values ◦  Useful when representing coefficients or variables indexed by subscripts ◦  Keys must be immutable (integers, strings, tuples, …) ◦  Ex: cost={('CHI','NYC'):100, ('ATL','MIA'):150}; cost[('NYC','MIA')]=200; c=cost['ATL','MIA']

Page 38: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 38

Iterating in Python and aggregate sums }  Loops iterate over collections of elements (list, dictionary, …) ◦  Useful when representing the for-all modeling construct ◦  Ex: for c in cities:

print c # must indent all statements in loop

}  List comprehension efficiently builds lists via set notation ◦  Ex: penaltyarcs=[a for a in arcs if cost[a]>1000]

}  quicksum() is direct replacement for Python's sum() function ◦  Gurobi feature that is more efficient when working with Var objects ◦  Ex: obj=quicksum(cost[a]*x[a] for a in arcs)

}  Combining loops with sums is ideal when building constraints Ex: can be built with for i in I: m.addConstr(quicksum(x[i,j] for j in J) <= 5)

xijj∈J∑ ≤ 5,∀i ∈ I

Page 39: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 39

Interactive Examples

Page 40: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 40

Latest Python-related enhancements in v6.5

}  Interactive examples for commonly faced business problems ◦  http://www.gurobi.com/resources/examples/example-models-overview

}  Expression building is more than 4X faster

}  Lazy update mode ◦  Set new UpdateMode parameter to 1 ◦  Refer to new variables and constraints without calling Model.update()

}  More control over when Gurobi environments are created/released ◦  Default environment not created until first used ◦  Released with new disposeDefaultEnv() method

}  New Conda package simplifies installation for the Anaconda Python distribution $ conda config --add channels http://conda.anaconda.org/gurobi$ conda install gurobi

Page 41: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 41

Jupyter Demo

Page 42: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 42

References

}  Visit http://www.gurobi.com/documentation/ for more information on the Gurobi Python Interface ◦  Quick Start Guide ◦  Reference Manual

}  Explore our functional code examples to learn more about advanced features ◦  Working with sparse models: netflow, workforce ◦  Accessing data sources (databases, spreadsheets, …): diet

}  Visit https://docs.python.org/ learn more about Python ◦  Official Python website ◦  Tutorials, documentation, examples, …

}  Visit https://www.continuum.io to get started with the Anaconda Python distribution, which includes iPython and Jupyter

Page 43: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Reformulation and Cutting Planes for MIQCP

Page 44: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 44

MIQCP/MISOCP Improvements

}  6.5 has many performance improvements in MIQCP/MISOCP }  We will cover some of the ideas behind these improvements ◦  Stay tuned for performance benchmarks

}  Reformulation ◦  Cone disaggregation ◦  Cone strengthening ◦  Other presolve improvements

}  Cutting planes ◦  Use of integer variables information to strengthen cone cuts ◦  Better control of cone cuts

}  General MIP improvements ◦  Changing tie-breaking threshold in branching

Page 45: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 45

Cone Disaggregation

}  Reformulation ◦  Replace the large cone x1

2 + x22 + … + xn

2 ≤ y2 (1) y ≥ 0 with xi

2 ≤ ziy, i = 1, 2, …, n (2) n rotated cones z1 + z2 + … + zn ≤ y (3) 1 linear constraint y ≥ 0, z1, z2, …, zn ≥ 0 n new variables

}  Proof of valid reformulation ◦  Constraints (2) + (3) => (1) ◦  Solution to (1) => solution to (2) and (3) by setting

zi = xi2 / y , if y > 0

= 0, if y = 0

}  See Vielma, Dunning, Huchette, Lubin (2015) on Extended Formulations

Page 46: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 46

Cone Disaggregation

}  Objective gap between LP with cone cuts and SOCP ◦  Disaggregation speeds up gap closing on our internal MISOCP set ◦  Disaggregation should see same improvement on continuous

SOCP models �  But slower gap closing on our internal SOCP set

}  Cone constraint violations ◦  All solvers must have tolerances for constraint violations ◦  Gurobi’s default feasibility tolerance is 10-6

}  Suppose we have small violations on the disagg. cones ◦  xi

2 = y zi + e, i=1, …, n with z1 + z2 + … + zn = y ◦  Then x1

2 + x22 + … + xn

2 ≤ y2 + ne ◦  Violation on original cone is n times the violation of disagg. cones ◦  Using appropriate scaling is important

Page 47: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 47

Cone Strengthening

}  Consider the following x2 ≤ y (1) y ≤ u*z (2) x, y ≥ 0 and continuous z binary variable

}  Strengthening x2 ≤ y*z (3)

}  Proof of valid reformulation ◦  If z = 1, y*z = y ◦  If z = 0, (2) => y = 0, so y*z = 0 = y

}  Observe in a fractional solution: y*z ≤ y, since z ≤ 1 }  Cuts off fractional solution (x, y, z) = (1, 1, 0.5) with u = 2

}  See Günlük and Linderoth (2011) on Perspective Reformulations

Page 48: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 48

Cone Cut Strengthening }  Consider the following

x2 ≤ y y is a general integer LP relaxation solution (x, y) = (0.5, 0)

}  Cone cut ◦  Increase y to satisfy x2 = y, we get (x’, y’) = (0.5, 0.25) ◦  Cone cut: 2 x’ (x – x’) ≤ y – y’, x – y ≤ 0.25 (1)

}  Strengthened cone cut ◦  Let y = floor(0.25) = 0 and y = ceil(0.25) = 1 ◦  Using x2 = y, we get two points: (0, 0) and (1, 1) ◦  The line passing the two points defines the strengthened cut x – y ≤ 0 (2) ◦  (2) is clearly stronger than (1)

Page 49: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 49

Other Improvements

}  Extended more presolve reductions to MISOCP ◦  Now perform more aggregations on quadratic variables

}  Better control of cone cuts ◦  When many conic constraints are violated, which cone cuts should

be added?

}  General MIP improvements ◦  Changing tie-breaking threshold in branching

Page 50: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 50

Computation

}  Internal MISOCP sets ◦  323 models, time limit 10000s, Xeon E3-1240 ◦  >1s, 190 models, 2.78X vs 6.0 ◦  >100s, 86 models, 6.49X

}  Where does the performance come from (internal set) ◦  Cone disaggregation ◦  Cone strengthening and other presolve reductions ◦  Cone cuts ◦  MIP improvements, e.g. changing branching threshold

}  Mittelmann MISOCP (45 models) ◦  CPLEX: 1.9X ◦  XPRESS: 5.28X ◦  MOSEK: 19.7X

Page 51: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Gurobi Instant Cloud

Page 52: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 52

Gurobi: Leader in Optimization on the Cloud

}  First with enterprise-grade optimization on the cloud ◦  Over 5 years of experience with optimization on the cloud

}  Moving to the cloud requires no changes in your code ◦  Full Gurobi API, with all Gurobi supported languages & platforms

}  Introducing the next step in the Gurobi Cloud ◦  Gurobi Instant Cloud ◦  More flexible pricing

}  Gurobi Cloud for AWS is still available for experienced Amazon EC2 users

Page 53: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 53

The Cloud isn’t for Everyone

}  Before you get started it’s important to understand if the Cloud is right for you

}  In some cases, data transmission may be a bottleneck

}  You may not be ready to trust others to manage your computers

}  It may be cheaper to own than to rent ◦  Long-term applications that run (nearly) 24/7

}  Most customers continue to use traditional licenses

Page 54: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 54

Why use the Cloud for Optimization?

}  Pay just for what you use ◦  Short-term projects ◦  Occasional use ◦  Meet a peak in demand

}  No software or hardware to purchase or configure

}  Get many fast computers quickly ◦  Especially valuable for distributed optimization

}  Increased robustness ◦  Get computers in multiple locations ◦  World-class management of computer center

Page 55: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 55

Gurobi Instant Cloud

}  Gurobi Instant Cloud makes it fast and easy to use the cloud for optimization.

}  No need to be an expert in cloud computing! }  Simply install Gurobi Optimizer on your client computers

}  Visit the Instant Cloud website: https://cloud.gurobi.com ◦  Or access directly via REST API

}  Launch a fast cloud machine to quickly solve your model }  Run from Windows, Mac, or Linux clients

}  Communication between your client and your cloud server encrypted with 256-bit AES

}  Gurobi does not have the ability to access your models or your data

Page 56: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 56

Distributed Optimization on the Instant Cloud

}  Distributed Optimization is a great fit for the Instant Cloud }  Quickly get access to a cluster of machines in the Cloud

☁ + = 😀

Page 57: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 57

Demonstration: Gurobi Instant Cloud

Page 58: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 58

Gurobi Instant Cloud API

}  Simple HTTPS API ◦  List your licenses ◦  List your running machines ◦  Launch a set of machines ◦  Kill a set of machine

}  API calls authenticated by signing with secret key

}  Embed access id and secret key in your client programs ◦  Revoke secret key if necessary

Page 59: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 59

Gurobi Instant Cloud API

}  Open source API clients available on GitHub: ◦  Python - https://github.com/Gurobi/instantcloud-python ◦  C - https://github.com/Gurobi/instantcloud-c ◦  C# - https://github.com/Gurobi/instantcloud-dotnet ◦  Java - https://github.com/Gurobi/instantcloud-python

}  Use them to start and stop cloud machines from the command-line

}  Or as a library for controlling cloud machines from your own programs

Page 60: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 60

Instant Cloud Pricing

}  Cloud pricing has two components: ◦  Machine Price: what you pay for the machine ◦  License Price: what you pay for Gurobi software

}  Allows you to choose the best machine for your needs

}  Different licenses for light and heavy/advanced users ◦  You only pay for the features you use

}  Frequent cloud users automatically receive savings

Page 61: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 61

Gurobi Instant Cloud Licenses

Light License Full License Multiple Jobs ✖ ✔

Job Queuing ✖ ✔

Load Balancing ✖ ✔

Distributed Optimization ✖ ✔

}  Light License ◦  Equivalent to Single-Use license ◦  Perfect if you are solving a single model at a time

}  Full License ◦  Equivalent to Compute Server license with Distributed Optimization add on ◦  Perfect for solving multiple models from multiple users ◦  Perfect for Distributed Optimization

Page 62: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 62

Automatic License Savings

Light License Full License Hourly Price $10/hr $20/hr

Monthly Price Cap $1500 $3000

}  Price cap lets you run a machine 24 hrs/day for ~750hrs in a month

Page 63: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 63

Distributed Workers

}  When you perform distributed optimization you need: ◦  A manager machine with a Full license ◦  A cluster of distributed workers

}  No license charge for distributed workers

}  Add as many as you need to your cluster

}  Pay only the cost of running the worker machines

Page 64: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 64

Gurobi Instant Cloud Machines

Machine vCPU RAM (GB) Price East-1 ($/hr)

c4.large 2 3.75 0.11 c4.2xlarge 8 15 0.46 c4.4xlarge 16 30 0.88 c4.8xlarge 36 60 1.86 r3.8xlarge 32 244 2.80

}  Includes Amazon’s latest compute optimized c4 machines }  Includes a machine with 244 GB of RAM for your largest models

}  Machine prices vary by region (prices shown are for US-East-1)

Page 65: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 65

References

}  Visit www.gurobi.com for more details on the Instant Cloud

}  Commercial clients, ask your account representative for a free trial

}  Get started using the Instant Cloud today

Page 66: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Performance Benchmarks

Page 67: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 67

Two Kinds of Benchmarks

}  Internal benchmarks ◦  Most important: compare Gurobi version-over-version ◦  Use internal Library of some 10,000 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 68: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 68

Internal Benchmarks

Page 69: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Gurobi MIP Library (3842 models)

1

10

100

1000

10000

100000

1000000

10000000

100000000

1E+09

1 10 100 1000 10000 100000 1000000 10000000 100000000

Colu

mns

Rows

100,000

1,000,000

Page 70: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 70

Performance Improvements in Gurobi 6.5

}  Gurobi 6.0 vs. 6.5: > 1.00x means that Gurobi 6.5 is faster }  MIQP: big speedup from 5 models of a single source }  QP not included: only 16 models > 1s

ProblemClass

>1s >100s

# Wins Losses Speedup # Wins Losses Speedup

LP 409 122 50 1.16x 148 55 30 1.32x

primal 390 111 66 1.03x 169 61 34 1.02x

dual 362 103 57 1.11x 131 47 27 1.24x

barrier 408 120 41 1.12x 133 61 23 1.25x

QCP/SOCP 78 15 11 1.16x 20 6 2 1.97x

MILP 1851 982 407 1.37x 832 514 215 1.72x

MIQP 95 57 22 1.99x 36 24 9 4.98x MIQCP 190 130 44 2.78x 86 67 17 6.49x

Page 71: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 71

-

5.0

10.0

15.0

20.0

25.0

30.0

35.0

40.0

45.0

50.0

0.00

0.50

1.00

1.50

2.00

2.50

3.00

1.0 -> 2.0 2.0 -> 3.0 3.0 -> 4.0 4.0 -> 5.0 5.0 -> 6.0 6.0 -> 6.5

Cum

ulat

ive

Spee

dup

Vers

ion-

to-V

ersi

on S

peed

up

Version to Version Speedup Cumulative Speedup

Gurobi Keeps Getting Better

71

48.7x improvement

(six years)

Gurobi Version-to-Version Pairs

Page 72: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 72

Where does the MIP Performance come from?

}  Cuts 24.1% ◦  …

}  Presolve 15.6% ◦  …

}  Branching 7.7% ◦  …

Page 73: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 73

Where does the MIP Performance come from?

}  MIP/LP integration 7.5% ◦  …

}  Heuristics 3.5% ◦  …

}  Node presolve 3.9% ◦  …

}  Compiler 2.0% ◦  …

Page 74: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 74

Where does the LP Performance come from?

}  LP default, concurrent ◦  Speedup of barrier and dual simplex

}  Barrier (mainly in crossover) ◦  More aggressive reduction of superbasic variables in crossover ◦  Detecting numerically challenging models and adjusting numeric settings

}  Dual simplex ◦  Better and faster handling of degenerate pivots ◦  More aggressive on starting basis crash

}  Presolve ◦  Improve implied bound handling and reduce extra iterations after uncrush ◦  More aggressive on dependent row reduction

}  Compiler ◦  Switched to Intel 2016 compiler

Page 75: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 75

External Benchmarks(Hans Mittelmann, http://plato.asu.edu/bench.html)

Page 76: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 76

LP

Benchmarks

Page 77: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 77

}  Complete test data available here: http://plato.asu.edu/ftp/lpcom.html }  40 models, time limit 25000 sec., 8 threads

2.04 1.97

2.48

0.97 1.09

1.28

2.48

2.01 1.92

0.00

0.50

1.00

1.50

2.00

2.50

3.00

Dual Barrier Concurrent

Gurobi 6.5 CPLEX 12.6.2 XPress 7.9 Mosek 7.1

Low

er is

bet

ter

LP Solve Times

Page 78: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 78

MILP Benchmarks

Page 79: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 79

§  Gurobi 6.5 vs. Competition: Solve times (> 1.0 means Gurobi faster)

Benchmark CPLEX XPRESS

P=1 P=4 P=12 P=1 P=4 P=12 Optimality 1.16X 1.26X 1.21X 1.07X 0.96X 1.36X

Optimality, 5 permuted 1.09X - - 1.36X - -

Feasibility - 1.10X - - 4.62X -

Infeasibility - 1.05X - - 1.67X -

“Easy” Optimality - - 1.16X - - 1.96X

Mittelmann (MIPLIB 2010): MIP Solve Times

Page 80: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 80

§  Gurobi 6.5 vs. Competition: Solve times (> 1.0 means Gurobi faster)

Benchmark CPLEX XPRESS

P=1 P=4 P=12 P=1 P=4 P=12 Optimality 1.21X 1.12X

Optimality, 5 permuted 1.09X - - 1.36X - -

Feasibility - 1.10X - - 4.62X -

Infeasibility - 1.05X - - 1.67X -

Mittelmann (MIPLIB 2010): MIP Solve Times

“Easy” Optimality - - 1.16X - - 1.96X “Easy” Optimality (-87) - - 1.13X - - 2.55X

Page 81: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 81

Gurobi 6.5 vs. Competition: Hit time limit

Benchmark Gurobi CPLEX XPRESS Optimality 2 4 2 Feasibility 0 0 3 Infeasibility 0 0 0 “Easy” -- Optimality 11 12 38

Mittelmann: MILP Solvability

Page 82: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 82

Benchmarks – Open Source MIP

}  Mittelmann MIPLIB2010 tests, P=1 (>1X means Gurobi wins):

January 2012

January 2013

January 2015

October 2015 % Solved

CBC 10X 13X 17X 21.2X 55%

SCIP 6X 7X 7X 7.1X 80%

GLPK 22X 27X - - 1%

LPSOLVE 19X 24X - - 6%

}  Open source MIP solvers continue falling further behind

Page 83: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 83

QP

Benchmarks

Page 84: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 84

§  Gurobi 6.5 vs. Competition: Solve times (> 1.0 means Gurobi is faster)

Benchmark CPLEX XPRESS

MIQP 1.29X 1.36X - MIQCP 1.45X 1.61X - MISOCP 1.91X 5.28X 19.7X SOCP 2.52X 1.22X 0.97X

Mittelmann: QP Solve Times

Page 85: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

Projected Roadmap

Page 86: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 86

Projected Roadmap

}  Performance }  Parallelism ◦  Improve performance on 12+ core systems ◦  Improve distributed MIP performance and scalability

}  Enhanced Gurobi Cloud offering

}  Piecewise-linear extensions ◦  PWL objective in MIP ◦  PWL constraint coefficients in MIP

}  Automatic linearization of common logical constraints

Page 87: The Gurobi OptimizerPython programs are typically stored in text files with .py extension ! Most functionality in Python is provided by modules To use a module in Python programs,

© 2015 Gurobi Optimization 87

Thank You

}  New academic users should visit our Academic Licensing page to get free academic versions of Gurobi ◦  http://www.gurobi.com/products/licensing-and-pricing/academic-

licensing

}  New commercial users should request a free evaluation version of Gurobi by emailing [email protected].

}  For any general questions email [email protected].