Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
What’s new in IBM ILOG CPLEX Optimization Studio 12.7 Ferenc Katai, Ph.D., Offering Manager, CPLEX optimization Studio Xavier Nodet, Development Lead, CPLEX optimization Studio © 2016 IBM Corporation What’s new at a glance New features (and their consequences on performance) (automatic) Benders decomposition algorithm Variability tester for CPLEX/CPO (in the interactive) Modeling Assistance in CPLEX PWL in C, Python and file forma CP Optimizer’s new functions/features • Interactive for CP Optimizer (a la CPLEX) • Variability tester in the interactive • File format for starting points (aka warm-start) for CP Optimizer Performance CPLEX CPO 2 © 2016 IBM Corporation BENDERS METHOD 3 © 2016 IBM Corporation Benders decomposition – a short view Benders’ decomposition method is well-known in the math programming profession since the 1962, when Jacque Benders published it. It’s a kind of 2 stage method with sub-problems and master problem It works well when the model is very block-structured and in this case the speed up can be very significant (in some cases even +20x) The problem types where Benders works/speeds up well include e.g. • Especially Stochastic-related problems where there are many scenarios • Facility location problems (aka network design, like LNP) • In fact anything with some possibility to block-triangulation Use Novice use (switch type) • where the user simply say that Benders should be performed but gives no indication about the blocks themselves. In this case CPLEX will figure out how to separate the problem and performs the Benders accordingly advanced use (familiarity with Benders, therefore more knowledge provided by the user) • The user can define which variables are belonging to what stage of Benders (sub/master) thru an API 4 © 2016 IBM Corporation Principle of the Benders decomposition Iterative approach Complete problem decomposed into a single master (MIP) problem, and a series of LP subproblems. Master problem defined by a set of variables, and contains all the constraints that involve these variables. Given a solution of the master problem, the sub-problems allow to generate: • An optimality cut that refines their contribution to the objective value, or • A feasibility cut if that solution is not feasible for a sub-problem • Cuts derive from duality arguments, hence the need for the sub-problems to be LPs Master SP1 SP2 SP3 5 © 2016 IBM Corporation Typical use cases The complete model is big, but the sub-problems decompose into manageable pieces. Example: scenario-based stochastic problems No decomposition for the sub-problem, but the master and the sub-problem have a much simpler structure. Example: facility location, where Benders decomposition turns tons of variable upper bounds (99% of the constraints in the model) into simple bounds. In the complete problem: 𝑦𝑖𝑗 ≤ 𝑥𝑖 These constraints disappear from the master model, and appear in the sub-problem as 𝑦𝑖𝑗 ≤ 0,1 , depending on the solution for 𝑥𝑖 in the master problem Similar to above, when master can enumerate much faster than the complete model and yet the bounds that it provides are not much worse. Example: some network design models. 6 © 2016 IBM Corporation Annotations Annotations provide information to CPLEX that doesn’t belong to the definition of the model Example: defining the block structure for Benders decomposition algorithm All elements of a model (objective, variables, constraints) can be annotated A given annotation is defined by a name (the key), a type (for the value), and a default value For a given model element, and a given key, a single value can be attached For Benders: Key is “cpxBendersPartition” Type is long Value 0: this variable is a master variable Value k>0: this variable belongs to sub-problem k. 7 © 2016 IBM Corporation benders strategy parameter benders strategy 1: user-specified decomposition CPLEX will use the decomposition specified as is benders strategy 2: CPLEX refines user’s decomposition The master variables are left Each sub-problem will be further decomposed if possible User can simply specify the master variables, and let CPLEX do the rest benders strategy 3: full automatic decomposition A user-specified decomposition is ignored Integer variables go into the master problem Continuous variables in a sub-problem Decompose this sub-problem if possible benders strategy 0 (default) If a decomposition was specified: refine it, and run benders algorithm Otherwise, run regular Brand-and-Bound 8 © 2016 IBM Corporation Computational results Benders B&C compared to “regular” B&C 1.06x 0.94 0.8 0.6 1.48x 0.40 5.47x 0.2 5.69x 0.18 0.18 stochastic non stochastic all models 3.07x 3.57x 0.28 0.4 0.68 2.53x 6.40x 0.16 0.33 1 5.41x 0.18 0 >1s >10s >100s Stochastic # models # wins/losses Non stochastic # timeout # models # wins/losses (regular B&C / Benders B&C) 9 # timeout (regular B&C / Benders B&C) > 1sec 168 130/37 76/17 152 61/80 6/4 > 10 secs 163 126/37 76/17 86 52/32 6/4 > 100 secs 149 117/32 76/17 44 30/13 6/4 Date: Testset: Machine: Timelimit: 6 November 2016 390 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads 10,000 sec © 2016 IBM Corporation PERFORMANCE VARIABILITY 10 © 2016 IBM Corporation Performance variability: seemingly neutral changes lead to a big variation in solution time By now a well known issue in MIP: Danna (MIP workshop, 2008) Koch et al. (Math. Prog. Comp. 2011) Fischetti and Monaci (Op. Res. 2014) Achterberg and Wunderling (Facets of Comb. Optimization, 2013) Lodi and Tramontani (INFORMS 2013 Tutorial) MIP solver ingredients Heuristics Cutting planes Branching variable selection ... Changes in platform, code, parameter settings … → may have (big) impact on any ingredient → on the whole solution process → (sometimes) hard to get robust performance 11 © 2016 IBM Corporation Performance variability exists and has massive effects 3 instances from MIPLIB2010 test set, run on 5 different random seeds model map14 rococoB10011000 neos911880 12 seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 © 2016 IBM Corporation Performance variability exists and has massive effects 3 instances from MIPLIB2010 test set, run on 5 different random seeds model seed 1 map14 rococoB10011000 neos911880 seed 2 seed 3 seed 4 seed 5 min max max/min 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 All solvable instances, run on 5 different seeds, max/min truncated at 1000, log scale 1000 100 10 1 13 © 2016 IBM Corporation Performance variability exists and has massive effects 3 instances from MIPLIB2010 test set, run on 5 different random seeds model seed 1 map14 rococoB10011000 neos911880 seed 2 seed 3 seed 4 seed 5 min max max/min 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 All solvable instances, run on 5 different seeds, max/min truncated at 1000, log scale 1000 rough classification 100 10 ≤2 ok 131 ]2, 4] shaky 53 >4 bad 28 1 14 © 2016 IBM Corporation Performance variability exists and has massive effects 3 instances from MIPLIB2010 test set, run on 5 different random seeds model map14 rococoB10011000 neos911880 seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 To assess performance variability with CPLEX: 15 new command in the interactive: tools→runseeds run one model with different random seeds surrogate for random perturbation of the model © 2016 IBM Corporation CPLEX> read beasleyC3.mps 16 1. Read model © 2016 IBM Corporation CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 17 1. Read model 2. Set parameters (if any) parameters set here apply to every run! © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds 18 1. Read model 2. Set parameters (if any) 3. Launch runs model with different random seeds default is 30 random seeds each solve starts from scratch CPLEX compiles statistics for each run © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> . . . 19 read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Exit codes: 0 : No error Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 20 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Exit codes: 0 : No error Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 21 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 Exit codes: 0 : No error solution information, should be consistent otherwise → modeling assistance Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 22 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Exit codes: 0 : No error solution effort, indicates variability Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 23 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Exit codes: 0 : No error Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 24 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds . . . 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait 5. Inspect results ====== runseeds statistics of 30 runs exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Exit codes: 0 : No error Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 25 © 2016 IBM Corporation CPLEX> CPLEX> CPLEX> CPLEX> read beasleyC3.mps set mip tolerance mipgap 0 set mip tolerance absmipgap 0 tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch . . . 4. Wait Statistics per run ====== runseeds statistics of 30 runs 5. Inspect results exit sol run code stat 1 0 101 2 0 101 3 0 101 . . . 30 0 101 objective value 754 754 754 gap (%) 0.00 0.00 0.00 iteration count 478311 378060 421786 node count 4051 3991 4021 runtime seconds 10.68 8.91 10.04 dettime ticks 6941.20 5653.56 6489.83 754 0.00 413233 3969 9.06 5775.45 node count runtime seconds dettime ticks 4009 43 10.84 1.07 7021.98 779.37 Failed runs Exit codes: 0 : No error Aggregated statistics Optimization status codes: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 754 0.00 459225 std dev: 1.87205e-10 0.00 66658 26 © 2016 IBM Corporation Some example results aflow30a A stable model objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 1158 0.00 110298 std dev: 0 0.00 24585 27 node count runtime seconds dettime ticks 3980 779 3.19 0.30 1883.01 181.44 © 2016 IBM Corporation Some example results aflow30a A stable model objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 1158 0.00 110298 std dev: 0 0.00 24585 runtime seconds dettime ticks 3980 779 3.19 0.30 1883.01 181.44 node count runtime seconds dettime ticks gmu-35-40 A model with high variability objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: -2.40673e+06 0.00 36824708 std dev: 0 0.00 94077727 28 node count 4624403 12739496 566.02 339839.59 1607.25 935535.50 © 2016 IBM Corporation Some example results aflow30a A stable model objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 1158 0.00 110298 std dev: 0 0.00 24585 runtime seconds dettime ticks 3980 779 3.19 0.30 1883.01 181.44 node count runtime seconds dettime ticks A model with high variability objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: -2.40673e+06 0.00 36824708 std dev: 0 0.00 94077727 node count 4624403 12739496 566.02 339839.59 1607.25 935535.50 Hurink_edata_mt06_lazy A suspicious model objective gap iteration node value (%) count count 101 : integer optimal solution (30 times) average: 49.2667 0.00 499151265 72138619 std dev: 5.52695 0.00 532709392 107808642 runtime seconds dettime ticks 5946.96 3269407.19 7681.00 4400455.20 standard deviation in objective → indicator for numerical problems → modeling assistance 29 © 2016 IBM Corporation MODELING ASSISTANCE 30 © 2016 IBM Corporation Modeling assistance detect problems in model data (small numbers, …) detect bad modeling constructs (big-M, ...) → improve numerical robustness 31 issues collected from years of CPLEX support and development issues with problem data issues in the model formulation issues with parameter settings issues during the solution process CPLEX scans your model and looks for these issues for each issue found a warning is printed enabled by parameter setting (disabled by default) © 2016 IBM Corporation Modeling assistance detect problems in model data (small numbers, …) detect bad modeling constructs (big-M, ...) → improve numerical robustness issues collected from years of CPLEX support and development issues with problem data issues in the model formulation issues with parameter settings issues during the solution process CPLEX scans your model and looks for these issues for each issue found a warning is printed enabled by parameter setting (disabled by default) CPX_PARAM_DATACHECK 0 – off input 32 solve © 2016 IBM Corporation Modeling assistance detect problems in model data (small numbers, …) detect bad modeling constructs (big-M, ...) → improve numerical robustness issues collected from years of CPLEX support and development issues with problem data issues in the model formulation issues with parameter settings issues during the solution process CPLEX scans your model and looks for these issues for each issue found a warning is printed enabled by parameter setting (disabled by default) CPX_PARAM_DATACHECK 0 – off 1 – check for invalid data (dup indices, NaNs, ...) input & check 33 solve © 2016 IBM Corporation Modeling assistance detect problems in model data (small numbers, …) detect bad modeling constructs (big-M, ...) → improve numerical robustness issues collected from years of CPLEX support and development issues with problem data issues in the model formulation issues with parameter settings issues during the solution process CPLEX scans your model and looks for these issues for each issue found a warning is printed enabled by parameter setting (disabled by default) CPX_PARAM_DATACHECK 0 – off modeling assistance 1 – check for invalid data (dup indices, NaNs, ...) 2 – check for common modeling issues input & check solve modeling assistance 34 © 2016 IBM Corporation Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) 35 © 2016 IBM Corporation Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) Solution quality: CPLEX> display solution quality MILP objective MILP solution norm |x| (Total, Max) MILP solution error (Ax=b) (Total, Max) MILP x bound error (Total, Max) MILP x integrality error (Total, Max) MILP slack bound error (Total, Max) 36 2.1961300000e+05 4.22897e+06 5.34130e+05 1.02709e-09 4.36557e-11 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 3.55271e-15 2.22045e-16 © 2016 IBM Corporation Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) Solution quality: CPLEX> display solution quality MILP objective MILP solution norm |x| (Total, Max) MILP solution error (Ax=b) (Total, Max) MILP x bound error (Total, Max) MILP x integrality error (Total, Max) MILP slack bound error (Total, Max) 2.1961300000e+05 4.22897e+06 5.34130e+05 1.02709e-09 4.36557e-11 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 3.55271e-15 2.22045e-16 Kappa statistics: track condition number of basis matrices CPLEX> set mip strategy kappa 2 CPLEX> optimize … CPLEX> display solution kappa Max condition number: 2.7435e+13 Percentage (number) of stable bases: 77.51% (11908) Percentage (number) of suspicious bases: 19.31% (2966) Percentage (number) of unstable bases: 3.18% (489) Percentage (number) of ill-posed bases: 0.00% (0) Attention level: 0.011480 37 © 2016 IBM Corporation Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) Solution quality: CPLEX> display solution quality MILP objective MILP solution norm |x| (Total, Max) MILP solution error (Ax=b) (Total, Max) MILP x bound error (Total, Max) MILP x integrality error (Total, Max) MILP slack bound error (Total, Max) 2.1961300000e+05 4.22897e+06 5.34130e+05 1.02709e-09 4.36557e-11 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 3.55271e-15 2.22045e-16 Kappa statistics: track condition number of basis matrices Max condition number: Percentage (number) of stable bases: Percentage (number) of suspicious bases: usually no problem Percentage (number) of unstable bases: double check Percentage (number) of ill-posed bases: be concerned Attention level: 38 © 2016 IBM Corporation Issues with problem formulation: aTx ≤ My y used to model availability of a resource 39 big-M constraints y binary, M huge y = 0 → aTx ≤ 0 y = 1 → aTx ≤ M resource not available resource available © 2016 IBM Corporation Issues with problem formulation: aTx ≤ My y used to model availability of a resource big-M constraints y binary, M huge y = 0 → aTx ≤ 0 y = 1 → aTx ≤ M resource not available resource available Typically M is much larger than ai → wide range of coefficients in the coefficient matrix causes numerical trouble 40 © 2016 IBM Corporation Issues with problem formulation: aTx ≤ My y used to model availability of a resource big-M constraints y binary, M huge y = 0 → aTx ≤ 0 y = 1 → aTx ≤ M resource not available resource available Typically M is much larger than ai → wide range of coefficients in the coefficient matrix causes numerical trouble → use indicator constraints y = 0 → aTx ≤ 0 y = 1 → aTx ≤ M often one of the two can be expressed as bound on a variable 41 © 2016 IBM Corporation Issues with problem formulation: big-M constraints AFALL_12_3 model with big-M constraints Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 42 1.6814e+13 stable bases: 8.06% suspicious bases: 89.66% unstable bases: 2.28% ill-posed bases: 0.00% 0.015804 © 2016 IBM Corporation Issues with problem formulation: big-M contraints AFALL_12_3 model with big-M constraints Max condition number: 1.6814e+13 CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is Percentage (number) of stable bases: 8.06% linked with variableof'x2079' having ratio 89.66% 1e+06. Percentage (number) suspicious bases: Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% c1109: 1000000 x257 + x2079 ≤ 0 Attention level: 0.015804 x257 binary, x2079 ≥ 0 43 © 2016 IBM Corporation Issues with problem formulation: big-M constraints AFALL_12_3 model with big-M constraints Max condition number: 1.6814e+13 CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is Percentage (number) of stable bases: 8.06% linked with variableof'x2079' having ratio 89.66% 1e+06. Percentage (number) suspicious bases: Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% c1109: 1000000 x257 + x2079 ≤ 0 x257 = 0 → x2079 = 0 Attention level: 0.015804 x257 = 1 → x2079 ≤ 1000000 x257 binary, x2079 ≥ 0 44 © 2016 IBM Corporation Issues with problem formulation: big-M constraints AFALL_12_3 model with big-M constraints Max condition number: 1.6814e+13 CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is Percentage (number) of stable bases: 8.06% linked with variableof'x2079' having ratio 89.66% 1e+06. Percentage (number) suspicious bases: Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% c1109: 1000000 x257 + x2079 ≤ 0 x257 = 0 → x2079 = 0 Attention level: 0.015804 x2079 ≤ 1000000 x257 binary, x2079 ≥ 0 45 © 2016 IBM Corporation Issues with problem formulation: big-M constraints AFALL_12_3 model with big-M constraints Max condition number: 1.6814e+13 CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is Percentage (number) of stable bases: 8.06% linked with variableof'x2079' having ratio 89.66% 1e+06. Percentage (number) suspicious bases: Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% c1109: 1000000 x257 + x2079 ≤ 0 x257 = 0 → x2079 = 0 Attention level: 0.015804 x2079 ≤ 1000000 x257 binary, x2079 ≥ 0 Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.6814e+13 stable bases: 8.06% suspicious bases: 89.66% unstable bases: 2.28% ill-posed bases: 0.00% 0.015804 2.2289e+13 80.15% 19.83% 0.02% 0.00% 0.002048 → numerics improve significantly 46 © 2016 IBM Corporation Issues with problem data: Single precision input data CPLEX uses IEEE double precision arithmetic (quad precision in some places) not every rational number has an exact representation → round-off error will occur Consider fraction 1/k and a simple constraint ∑i in {1, ..., k} 1/k xi = 1 47 © 2016 IBM Corporation Issues with problem data: Single precision input data CPLEX uses IEEE double precision arithmetic (quad precision in some places) not every rational number has an exact representation → round-off error will occur Consider fraction 1/k and a simple constraint ∑i in {1, ..., k} 1/k xi = 1 ∆ to exact value only 1/k in single rest in double! single double 1/k Δ Δ(∑) Δ Δ(∑) 1/3 9.9e-9 3.0e-8 1.9e-17 5.6e-17 1/5 3.0e-9 1.5e-8 1.1e-17 5.6e-17 1/6 5.0e-9 3.0e-8 9.3e-18 5.6e-17 xi exact integer →infeasible by at least 1e-8 with single precision data →in practice often a lot worse 48 © 2016 IBM Corporation Issues with problem data: Single precision input data xi exact integer →infeasible by at least 1e-8 with single precision data →in practice often a lot worse Obvious warning CPLEX Warning 1036: Coefficient for %s in %s looks like %d/%d in single precision → Fix data generation 49 © 2016 IBM Corporation Issues with problem data: Single precision input data xi exact integer →infeasible by at least 1e-8 with single precision data →in practice often a lot worse Obvious warning CPLEX Warning 1036: Coefficient for %s in %s looks like %d/%d in single precision → Fix data generation But also CPLEX Warning 1047: Coefficients in %s are fractions and can be scaled with %d/%d → scale row to get exact values ∑i in {1, ..., k} 1/k xi = 1 50 → ∑i in {1, ..., k} xi = k © 2016 IBM Corporation Issues with problem data: Single precision input data ns2118727.mps.gz A model with single precision data Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 51 1.0978e+14 stable bases: 67.59% suspicious bases: 31.28% unstable bases: 0.97% ill-posed bases: 0.16% 0.007666 © 2016 IBM Corporation Issues with problem data: Single precision input data A model with single precision data Max condition number: 1.0978e+14 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' Percentage (number) of stable bases: 67.59% looks like 1/24 in single precision.bases: 31.28% Percentage (number) of suspicious Percentage (number) of unstable bases: 0.97% Percentage (number) ill-posed bases: 0.16% R1024: C0017 C0700 - of C0926 + C2957 + C5189 C5190 - 0.0416667 C7932 = 0 Attention level: 0.007666 definitely looks truncated/rounded 52 © 2016 IBM Corporation Issues with problem data: Single precision input data A model with single precision data Max condition number: 1.0978e+14 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' Percentage (number) of stable bases: 67.59% looks like 1/24 in single precision.bases: 31.28% Percentage (number) of suspicious Percentage (number) of unstable bases: 0.97% Percentage (number) ill-posed bases: 0.16% R1024: C0017 C0700 - of C0926 + C2957 + C5189 C5190 - 0.0416667 C7932 = 0 Attention level: 0.007666 definitely looks truncated/rounded Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 53 1.0978e+14 stable bases: 67.59% suspicious bases: 31.28% unstable bases: 0.97% ill-posed bases: 0.16% 0.007666 8.7299e+06 100.00% 0.00% 0.00% 0.00% © 2016 IBM Corporation Issues with problem data: Single precision input data A model with single precision data Max condition number: 1.0978e+14 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' Percentage (number) of stable bases: 67.59% looks like 1/24 in single precision.bases: 31.28% Percentage (number) of suspicious Percentage (number) of unstable bases: 0.97% Percentage (number) ill-posed bases: 0.16% R1024: C0017 C0700 - of C0926 + C2957 + C5189 C5190 - 0.0416667 C7932 = 0 Attention level: 0.007666 definitely looks truncated/rounded Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.0978e+14 stable bases: 67.59% suspicious bases: 31.28% unstable bases: 0.97% ill-posed bases: 0.16% 0.007666 solution time from 120 seconds 54 8.7299e+06 100.00% 0.00% 0.00% 0.00% 90 seconds © 2016 IBM Corporation Issues with problem data: Single precision input data A model with single precision data Max condition number: 1.0978e+14 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' Percentage (number) of stable bases: 67.59% looks like 1/24 in single precision.bases: 31.28% Percentage (number) of suspicious Percentage (number) of unstable bases: 0.97% Percentage (number) ill-posed bases: 0.16% R1024: C0017 C0700 - of C0926 + C2957 + C5189 C5190 - 0.0416667 C7932 = 0 Attention level: 0.007666 Attention blindly changing coefficients may change feasible region → may end up solving a different model Max condition number:model generation, not 1.0978e+14 → change model Percentage (number) of stable bases: 67.59% Percentage (number) of suspicious bases: 31.28% Percentage (number) of unstable bases: 0.97% Percentage (number) of ill-posed bases: 0.16% Attention level: 0.007666 solution time from 120 seconds 55 definitely looks truncated/rounded 8.7299e+06 100.00% 0.00% 0.00% 0.00% 90 seconds © 2016 IBM Corporation Issues with problem data: extreme numbers Numbers below CPLEX default tolerances → essentially 0 → Fix numbers or tighten tolerance parameters feasibility tolerance optimality tolerance numerical emphasis ... Numbers too small for the solver (smaller than 1e-13) → essentially 0 → Fix numbers Numbers larger than CPX_INFBOUND → CPLEX will consider them as infinity → Fix numbers or, e.g., remove constraints with right-hand side > CPX_INFBOUND 56 © 2016 IBM Corporation Issues with parameter settings: relative MIP gap (in CPLEX): relative MIP gap best integer – best objective 1e-10 + |best integer| 57 CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value © 2016 IBM Corporation Issues with parameter settings: relative MIP gap (in CPLEX): relative MIP gap best integer – best objective 1e-10 + |best integer| 58 CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value (default 1e-4) Objective: min aTx + K gap: aTx* + K – (aTx' + K) 1e-10 + |aTx* + K| → aTx* – aTx' 1e-10 + |aTx* + K| © 2016 IBM Corporation Issues with parameter settings: relative MIP gap (in CPLEX): relative MIP gap best integer – best objective 1e-10 + |best integer| 59 CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value Objective: min aTx + K gap: aTx* + K – (aTx' + K) 1e-10 + |aTx* + K| → aTx* – aTx' 1e-10 + |aTx* + K| K huge → gap small, independent of aTx* and aTx' © 2016 IBM Corporation Issues with parameter settings: relative MIP gap (in CPLEX): relative MIP gap best integer – best objective 1e-10 + |best integer| CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value Objective: min aTx + K gap: aTx* + K – (aTx' + K) 1e-10 + |aTx* + K| → aTx* – aTx' 1e-10 + |aTx* + K| K huge → gap small, independent of aTx* and aTx' modeling assistance warning CPLEX Warning 1037: Solution optimal within relative optimality tolerance of %g, but not optimal if objective offset of value %g is removed → fix K or adapt CPX_PARAM_EPGAP related CPLEX Warning 1038: Solution optimal within relative optimality tolerance of %g, but not optimal within absolute optimality tolerance of value %g 60 © 2016 IBM Corporation Issues during solve: big condition numbers Numerical trouble while solving the problem → Can you trust the results? How much can you trust them? CPLEX tracks condition number of basis matrices in LP solve. Large number of bases with large condition number → potential numerical problems → inexact/incorrect answers Solving ns2034125 CPLEX Warning CPLEX Warning 1033: Detected 1277 suspicious condition number(s) >= 1e+07. 1034: Detected 30 unstable condition number(s) >= 1e+10. → Check/fix data, check solution quality, use numerical emphasis, tighten tolerances 61 © 2016 IBM Corporation Overview of modeling assistance warnings Potential issues in problem data Potential issues in problem formulation Potential issues in parameter settings Potential issues in solve BIGM_COEF one very big coefficient in row ██ BIGM_TO_IND constraint can be replaced by indicator ██ BIGM_VARBOUND variable bound constraint with very large bound ██ EPGAP_LARGE solution optimal only due to large CPX_PARAM_EPGAP ███ EPGAP_OBJOFFSET solution optimal only due to large objective offset ██ FRACTION_SCALING rows can be scaled to get exact value ██ *_LARGE_NUM suspiciously large number ██ *_SMALL_NUM suspiciously small number █ CANCEL_TOL non-zero less than cancel tolerance ███ FEAS_TOL rhs smaller than feasibility tolerance ███ OPT_TOL objective coefficient smaller than optimality tolerance ███ QOPT_TOL quadratic objective coefficient smaller than optimality tolerance ███ SINGLE_PRECISION single precision data █ SYMMETRY_BREAKING_INEQ chain of symmetry breaking inequalities ██ WIDE_COEFF_RANGE wide range of coefficients ██ KAPPA_* bad kappa values detected during solve 62 ████ © 2016 IBM Corporation Combining modeling assistance and runseeds momentum1.mps.gz (absolute and relative MIP gap 0): runseeds on original model: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 std dev: 0.000312912 0.00 27028241 63 node count 1128777 726250 runtime seconds dettime ticks 2881.88 1725072.05 1807.30 1071736.66 © 2016 IBM Corporation Combining modeling assistance and runseeds momentum1.mps.gz (absolute and relative MIP gap 0): runseeds on original model: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 std dev: 0.000312912 0.00 27028241 fix modeling assistance warnings: 64 node count 1128777 726250 runtime seconds dettime ticks 2881.88 1725072.05 1807.30 1071736.66 big-M constraints Single precision data scaled rows wide coefficient ranges © 2016 IBM Corporation Combining modeling assistance and runseeds momentum1.mps.gz (absolute and relative MIP gap 0): runseeds on original model: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 std dev: 0.000312912 0.00 27028241 fix modeling assistance warnings runseeds on model with all warnings fixed: objective gap iteration value (%) count 101 : integer optimal solution (30 times) average: 109143 0.00 34108977 std dev: 0.000580749 0.00 20783473 node count 1128777 726250 node count 921646 564391 runtime seconds dettime ticks 2881.88 1725072.05 1807.30 1071736.66 runtime seconds dettime ticks 2310.04 1400198.34 1237.40 750744.53 → iteration count, solution time, number of nodes reduced → variability in iteration count, solution time, number of nodes reduced 65 © 2016 IBM Corporation Be careful when auto-fixing warnings Model ns2122603 from “unstable” MIPLIB 2010 testset gives these warnings: Detected constraint with wide range of coefficients. In constraint 'R12374' the ratio of largest and smallest (in absolute value) coefficients is 2.4e+09 Coefficient for variable 'C10462' in constraint 'R12374' looks like 1/24 in single precision. 66 © 2016 IBM Corporation Be careful when auto-fixing warnings Model ns2122603 from “unstable” MIPLIB 2010 testset gives these warnings: Detected constraint with wide range of coefficients. In constraint 'R12374' the ratio of largest and smallest (in absolute value) coefficients is 2.4e+09 Coefficient for variable 'C10462' in constraint 'R12374' looks like 1/24 in single precision. Solve original model: Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.7025e+20 stable bases: 0.00% (0) suspicious bases: 0.00% (0) unstable bases: 0.00% (0) ill-posed bases: 100.00% (1) 1.000000 CPLEX stops at root with sub-optimal solution 67 © 2016 IBM Corporation Be careful when auto-fixing warnings Model ns2122603 from “unstable” MIPLIB 2010 testset gives these warnings: Detected constraint with wide range of coefficients. In constraint 'R12374' the ratio of largest and smallest (in absolute value) coefficients is 2.4e+09 → replace by indicator Coefficient for variable 'C10462' in constraint 'R12374' looks like 1/24 in single precision. → recompute coefficients Solve original model: Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.7025e+20 stable bases: 0.00% (0) suspicious bases: 0.00% (0) unstable bases: 0.00% (0) ill-posed bases: 100.00% (1) 1.000000 CPLEX stops at root with sub-optimal solution 68 Solve fixed 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 not too bad © 2016 IBM Corporation Be careful when auto-fixing warnings Model ns2122603 from “unstable” MIPLIB 2010 testset gives these warnings: Detected constraint with wide range of coefficients. In constraint 'R12374' the ratio of largest and smallest (in absolute value) coefficients is 2.4e+09 → replace by indicator Coefficient for variable 'C10462' in constraint 'R12374' looks like 1/24 in single precision. → recompute coefficients Solve original model: Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.7025e+20 stable bases: 0.00% (0) suspicious bases: 0.00% (0) unstable bases: 0.00% (0) ill-posed bases: 100.00% (1) 1.000000 CPLEX stops at root with sub-optimal solution but: 69 Solve fixed 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 not too bad fixed model gives super-optimal solutions! solutions are infeasible in original model! © 2016 IBM Corporation Be careful when auto-fixing warnings Model ns2122603 from “unstable” MIPLIB 2010 testset gives these warnings: Detected constraint with wide range of coefficients. In constraint 'R12374' the ratio of largest and smallest (in absolute value) coefficients is 2.4e+09 → replace by indicator Coefficient for variable 'C10462' in constraint 'R12374' looks like 1/24 in single precision. → recompute coefficients Solve original model: Max condition number: Percentage (number) of Percentage (number) of Percentage (number) of Percentage (number) of Attention level: 1.7025e+20 stable bases: 0.00% (0) suspicious bases: 0.00% (0) unstable bases: 0.00% (0) ill-posed bases: 100.00% (1) 1.000000 CPLEX stops at root with sub-optimal solution but: 70 fixed model gives super-optimal solutions! solutions are infeasible in original model! Solve fixed 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 not too bad careful! © 2016 IBM Corporation PIECEWISE LINEAR 71 © 2016 IBM Corporation PWL functions in the engine Before 12.7, piecewise linear functions were available through Concert In C++, Java, .NET, but not C, Python and file formats 400 Version 12.7 fixes that 2 Example of LP file format: 240 Minimize 0.5 [...] Subject To [...] Pwl f: y = x 0.5 (20,240) (40,400) 2.0 20 End 40 This specifies that y = f(x), where f is defined by the two points (20, 240) and (40, 400), has a slope before the first point equal to 0.5, and a slope after the last point of 2.0. 72 © 2016 IBM Corporation ‘NO CHECK’ MIP STARTS 73 © 2016 IBM Corporation ‘No check’ MIP Start level In can take time to check the validity of a MIP start, even when it indeed defines a complete feasible solution: CPLEX has to solve a fixed LP. When the model has lazy constraints, checking the MIP start has to be delayed up to the end of the root node: may hurt performance Version 12.7 introduces a new effort level: CPX_MIPSTART_NOCHECK When used, CPLEX just assumes that he solution given is complete and feasible. Behavior is undefined otherwise. 74 © 2016 IBM Corporation Other new CPO features Interactive for CP Optimizer (a la CPLEX) File format for starting points (aka warm-start) for CP Optimizer Variability tester in the interactive 75 © 2016 IBM Corporation CPLEX MILP performance evolution 700 50 45 600 1000 sec 35 30 400 100 sec 25 300 20 200 10 sec total speedup number of timeouts 500 40 15 10 100 5 0 0 10.0 (2006) 76 Date: Testset: Machine: Timelimit: 11.0 (2007) 12.1 (2009) 12.2 (2010) 12.4 (2011) 6 November 2016 MILP: 3893 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec 12.5.0 (2012) 12.6.0 (2013) 12.6.1 (2014) 12.6.3 (2015) 12.7.0 (2016) © 2016 IBM Corporation CPLEX 12.6.3 vs.12.7.0: LP performance improvement 1.01x 1.03x 1.07x 0.6 CPLEX 12.6.3 0.93 1.00 0.97 1.00 0.99 0.8 1.00 1 0.4 LP barrier (12 threads) CPLEX 12.7.0 Time limits: 1/0 0.2 0 >1s >10s 626 models 299 models 1.05x 1.09x >100s 123 models 1.21x CPLEX 12.6.3 0.83 0.6 1.00 0.92 1.00 0.95 0.8 1.00 1 0.4 LP barrier with Xover (12 threads) CPLEX 12.7.0 Time limits: 3/3 0.2 0 >1s >10s 696 models 355 models 77 Date: Testset: Machine: Timelimit: >100s 165 models 6 November 2016 LP: 2271 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec © 2016 IBM Corporation CPLEX 12.6.3 vs.12.7.0: MILP performance improvement 1.08x 1.11x 1.18x CPLEX 12.6.3 0.85 1.00 0.90 0.6 1.00 0.92 0.8 1.00 1 0.4 Deterministic parallel MILP (12 threads) CPLEX 12.7.0 Time limits: 55 / 24 0.2 0 >1s 2048 models >10s 1254 models >100s 667 models MILP improvements summary Root presolve: 2% Propagation of implications in node presolve: 3% Root and node probing: 3% Node cuts (separation and filtering): 3% Heuristics: 2% Branching: 3% 78 Date: Testset: Machine: Timelimit: 6 November 2016 MILP: 4256 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec © 2016 IBM Corporation CPLEX 12.6.3 vs.12.7.0: MIQP performance improvement 1.07x 1.13x 1.18x CPLEX 12.6.3 0.85 1.00 1.00 0.89 0.6 0.94 0.8 1.00 1 0.4 Convex MIQP (12 threads) CPLEX 12.7.0 Time limits: 3/0 0.2 0 >0s >1s 263 models 123 models >10s 84 models MIQP improvements summary Node cuts (separation and filtering): 7% Tuning of node probing effort: 6% 79 Date: Testset: Machine: Timelimit: 6 November 2016 MIQP: 365 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec © 2016 IBM Corporation CPLEX 12.6.3 vs.12.7.0: MIQCP performance improvement 1.09x 1.15x 1.29x CPLEX 12.6.3 1.00 Convex MIQCP (12 threads) CPLEX 12.7.0 0.78 1.00 0.87 0.6 0.92 0.8 1.00 1 0.4 Time limits: 5/1 0.2 0 >0s >1s 259 models 154 models >10s 88 models MIQCP improvements summary (all for Outer Approximation, OA) More aggressive reliability branching: 4% Better synchronization of cone cuts in the tree: 2% Better integration between cone cuts and QCP relaxation: • Repeatedly solve QCP relaxation at the root, to refine OA with cone cuts: 4% • Solve QCP relaxation in the tree, to refine the OA with cone cuts: 10% 80 Date: Testset: Machine: Timelimit: 6 November 2016 MIQCP: 326 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec © 2016 IBM Corporation CPLEX 12.6.3 vs.12.7.0: Global (MI)QP performance improvement 1.27x 1.65x 2.83x 1.00 1.00 0.2 Non-convex (MI)QP (12 threads) CPLEX 12.7.0 0.35 0.4 CPLEX 12.6.3 0.61 0.6 0.79 0.8 1.00 1 Time limits: 12 / 1 0 >0s >1s 447 models 157 models >10s 79 models All the improvement comes from newly added cutting planes: Cuts from ReformulationLinearization Techniques (RLT-cuts) H. D. Sherali and A. Alameddine, “A new reformulation-linearization technique for bilinear programming problems”, Journal of Global Optimization 2, 379-410, 1992. Implemented in CPLEX within the FP7-PEOPLE-2012-ITN Marie Curie EU Project MINO, see also: • P. Bonami, A. Lodi, J. Schweiger, A. Tramontani, "Solving standard quadratic programming by cutting planes", Techical Report DS4DM-2016-001, 2016. 81 Date: Testset: Machine: Timelimit: 6 November 2016 Non-convex (MI)QP: 742 models Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic 10,000 sec © 2016 IBM Corporation CPO performance improvements On integer constraint programming models: +10% On Scheduling constraint programming models: +20% 82 © 2016 IBM Corporation