22
1 Copyright © 2012 Maximal Software, Inc. All rights reserved INFORMS Phoenix 2012 Achieving Optimal Solution Performance for Your Optimization Modeling Project Presented by Sandip Pindoria Maximal Software, Inc.

Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

1Copyright © 2012 Maximal Software, Inc. All rights reserved

INFORMS Phoenix 2012

Achieving Optimal Solution Performance

for Your Optimization Modeling Project

Presented by

Sandip PindoriaMaximal Software, Inc.

Page 2: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

2Copyright © 2012 Maximal Software, Inc. All rights reserved

Presentation Overview

Many Different Factors can Affect the Overall Best Solution Performance for Optimization Projects

Modeling• Modeling Languages• Model Formulation

Data• Data Management• Data Sources

Solvers• Solver Performance • Solver Tuning

Machine Hardware (CPU)

Page 3: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

3Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Speed is not everything…Connectivity

Flexibility

Scalability

Productivity

but can still be quite important!Data Management

Large-scale models

Real-time optimization

Applications for end-users

Page 4: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

4Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Modeling LanguagesIndependent Languages (GAMS, AMPL, AIMMS, MPL)

Solver Based Languages (OPL, MOSEL, LINGO)

Modeling Languages vs. Callable Libraries

Memory based vs. File based

Parsing speed

Memory Management

Model FormulationIndex sets (numeric vs. named)

Compound sets (set of sets)

Data computations

Modeling pitfalls

Page 5: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

5Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Formulating Compound Sets

PalCapRoute[route,truck IN ExistTrckRt]:

SUM(cust IN setDeliveryShip: Pal* XCust) <= CapTruck * XTruck;

PalCapRoutes[route,truck] WHERE dtExistTrckRt:

SUM(cust: Pal* XCust WHERE dtsetDeliveryShip) <= CapTruck * XTruck;

Using IN Statements

Using WHERE Statements

Page 6: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

6Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Data SourcesText Files

Binary Files

Spreadsheets

Databases

ERP Systems

XML Files

Data ManagementImporting vs. Exporting Data

Local vs. Network

ODBC vs. Native Drivers

Flexibility vs. Speed

Page 7: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

7Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Importing Data (50K)

0

0.1

0.2

0.3

0.4

0.5

0.6

Text Access Access No Trans

ExcelODBC

50K

Page 8: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

8Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Exporting Data

0

50

100

150

200

Text Access No Trans

30K

300K

3000K

Page 9: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

9Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Solver CategoriesHigh-end Solvers

Mid-range Solvers

Open Source Solvers

Nonlinear Solvers

Solver PerformanceNewest Release

Algorithms (Primal/Dual vs. Barrier)

Parallel Solvers

Local Machine vs. Server

Grid Computing

Page 10: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

10Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Solver Tuning (specifically CPLEX MIP)Cuts (Automatic vs. Aggressive)

Variable Selection (Pseudo Cost vs. Strong)

Probing/Heuristics

Emphasis (Feasibility vs. Optimality)

Tolerance Gaps

Automatic Tuning

Page 11: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

11Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

No single tuning parameter gives always the best results

  harp2 mas74 mzzv11 10teams aflow30a air04 air05 TOTAL

Defaults 124.2 284.7 120.3 4.75 13.531 9.016 9.203 565.8

Prob1 81.0 280.4 122.6 5.172 12.641 10.531 10.781 523.1

Prob2 106.4 284.2 36.2 5.328 12.688 10.25 10.765 465.8

Prob3 102.3 278.9 104.1 5.234 12.641 87.093 88.172 678.5

PsuedoCost 126.7 279.5 120.4 6.266 13.422 9 8.906 564.2

StrongBranch 126.8 279.9 120.4 5.985 13.406 8.984 8.719 564.2

PsuedoRedCost 126.4 277.6 120.1 5.25 13.391 9 9.078 560.8

Optimality 135.1 311.3 215.5 34.937 13.922 22.891 23.078 756.7

AggressiveCut 126.8 279.5 120.3 5.188 13.328 8.906 8.954 563.0

NoCuts 207.4 271.2 166.2 30.188 125.39 17.297 18.657 836.3

Combination 126.9 280.1 120.2 5.218 13.39 8.86 8.953 563.6

AVERAGE 126.4 282.5 124.2 10.3 13.2 11.5 11.7 596.3

MAX 207.4 311.3 215.5 34.9 125.4 87.1 88.2 836.3

MIN 81.0 271.2 36.2 4.8 12.6 8.9 8.7 465.8

DIFF 126.4 40.1 179.3 30.2 112.7 78.2 79.5 370.6

Page 12: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

12Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Model Formulation improvementsUsually MIP models can improved by tinkering with the

formulation

Modeling Presolve

Strategic vs. Detailed decisions

Identifying Global cuts

Tightening constraints/bounds

Reformulating constraints

Page 13: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

13Copyright © 2012 Maximal Software, Inc. All rights reserved

Presolve

Principal aim of Presolve is:

• Reduce the scope of the problem

• Eliminate constraints and variables• Tighten Bounds, RHS values• Modify matrix coefficients to tighten constraints

• High end solvers have very good Presolvers but:

• Computationally expensive• Not always comprehensive

Page 14: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

14Copyright © 2012 Maximal Software, Inc. All rights reserved

Presolve

Eliminating binary/integer variables

SWITCHMINMAXE[plant,modes2,t]:

SUM(modes: BIN_SWITCH[modes:=modes2,modes2:=modes])

+ SUM(modes IN m_plant_mode: BIN_SWITCHEX[modes,modes2])

=

BIN_SWITCH_MIN + BIN_SWITCH_MAX;

Can change the type of variable to continuous for BIN_SWITCH_MIN or BIN_SWITCH_MAX

Page 15: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

15Copyright © 2012 Maximal Software, Inc. All rights reserved

Tightening the formulation

Try to get the formulation as close as possible to the convex hull of the integer feasible solutions

Page 16: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

16Copyright © 2012 Maximal Software, Inc. All rights reserved

Big M

BigM Reduction• Reduce the size of the Big M value in logical constraints.• Seeing formulations with arbitrary Big M is still common:

SUM(stream: Prod_Reservere) <= 99999 * Bin_UseReserve;

BigM often linked to a data parameter which will be much smaller:

SUM(stream: Prod_Reservere) <= limitInput_reserves * Bin_UseReserve;

Page 17: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

17Copyright © 2012 Maximal Software, Inc. All rights reserved

Cuts

These are essentially redundant constraints that cut off part of the LP relaxed solution

• Tightens the formulation

• Increases model size

Cuts can be either:

• Local

• Global

Formulation stand point aim is to identify global cuts

Page 18: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

18Copyright © 2012 Maximal Software, Inc. All rights reserved

Clique Cuts

A good global cut to seek out are clique cuts

Set of pairwise incompatible variables

BIN_OVERMODE + BIN_UNDERMODE <= 1;

BIN_OVERMODE + BIN_SWITCHMODE <= 1;

BIN_SWITCHMODE + BIN_UNDERMODE <= 1;

From the above one can imply the following cut:

BIN_OVERMODE + BIN_UNDERMODE + BIN_SWITCHMODE <= 1;

Page 19: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

19Copyright © 2012 Maximal Software, Inc. All rights reserved

Reformulation

Constraint or a set of constraints that are stated to do a function in the model can be re done that may aid the solving process

DICE_EQ2[plant,mode,mode2,t,t2]:

BIN_SWITCH <= BIN_INSTANTAITE;

VARIABLES

BIN_SWITCH[plant,mode,mode2,t,t2];

BIN_INSTANTAITE[plant,mode,t];

Page 20: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

20Copyright © 2012 Maximal Software, Inc. All rights reserved

Reformulation

Due to the indexing difference, reformulated by:

DICE_EQ2[plant,mode,t]:

SUM(mode2,t2: BIN_SWITCH)

<= DATSWITCH * BIN_INSTANTAITE;

Where DATSWITCH is a data scalar

DATA

DATSWITCH = COUNT(mode2) * COUNT(t2);

• Formulation becomes less tighter

• Reduces the number of constraints

Page 21: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

21Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

HardwarePC vs. Unix

Windows vs. Linux

Intel vs. AMD

Duo Core vs. Quad Core

CPU Speed (GHz)

Overclocking

Level2 Cache

Random Memory

Page 22: Maximal: Achieving Optimal Solution Performance for your Optimization Modeling Project - Oct 2012

22Copyright © 2012 Maximal Software, Inc. All rights reserved

Achieving Optimal Solution Performance

Which Factors Can Best Help Achieve the Overall Optimal Solution Performance?

Model Formulation• Fast modeling language• Use compound indexes

Data Sources• Store data locally• Binary or text files

Solving• Newest version of fast, high-end solver• Aggressive solver tuning

Machine Hardware• Fastest/newest multi-core CPU