Upload
bjarni-kristjansson
View
206
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
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.
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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;
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
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;
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];
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
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
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