Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

IBM CPLEX Optimization Studio 12.7 - Benders, Modeling Assistance, etc.

3,676 views

Published on

New features and performance improvements in IBM CPLEX Optimization Studio 12.7:
- Performance improvements [CPLEX and CP Optimizer]
- Automated Benders decomposition [CPLEX]
- Modeling Assistance [CPLEX]
- Runseeds [CPLEX and CP Optimizer]
- Interactive [CP Optimizer]
- Improved Python Modeling API

Published in: Software
  • thanks for the nice presentation, I am wondering if CPLEX implements some of the acceleration strategies that enhances the convergence of Benders. For instance, what kind of cuts does CPLEX implement out of the subproblem? If the subproblem might be infeasible or unbounded in some cases, does CPLEX do some tricks to get a subproblem formulation that is always bounded and feasible?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

IBM CPLEX Optimization Studio 12.7 - Benders, Modeling Assistance, etc.

  1. 1. © 2016 IBM Corporation IBM CPLEX Optimizer 12.7 Benders decomposition, Modeling Assistance, … Xavier Nodet, Program Manager, CPLEX Optimization Studio
  2. 2. © 2016 IBM Corporation2 PERFORMANCE
  3. 3. © 2016 IBM Corporation3 0 5 10 15 20 25 30 35 40 45 50 0 100 200 300 400 500 600 700 10.0 (2006) 11.0 (2007) 12.1 (2009) 12.2 (2010) 12.4 (2011) 12.5.0 (2012) 12.6.0 (2013) 12.6.1 (2014) 12.6.3 (2015) 12.7.0 (2016) totalspeedup numberoftimeouts CPLEX MILP performance evolution ³10 sec ³100 sec ³1000 sec Date: 6 November 2016 Testset: MILP: 3893 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec
  4. 4. © 2016 IBM Corporation4 0 0,2 0,4 0,6 0,8 1 >1s >10s >100s 1,00 1,00 1,00 0,99 0,97 0,93 CPLEX 12.6.3 CPLEX 12.7.0 Date: 6 November 2016 Testset: LP: 2271 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec CPLEX 12.6.3 vs.12.7.0: LP performance improvement LP barrier (12 threads) 626 models 123 models Time limits: 1 / 0 1.01x 1.07x 0 0,2 0,4 0,6 0,8 1 >1s >10s >100s 1,00 1,00 1,00 0,95 0,92 0,83 CPLEX 12.6.3 CPLEX 12.7.0 LP barrier with Xover (12 threads) 696 models 165 models Time limits: 3 / 3 1.05x 1.21x 1.03x 1.09x 299 models 355 models
  5. 5. © 2016 IBM Corporation5 0 0,2 0,4 0,6 0,8 1 >1s >10s >100s 1,00 1,00 1,00 0,92 0,90 0,85 CPLEX 12.6.3 CPLEX 12.7.0 Date: 6 November 2016 Testset: MILP: 4256 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec Deterministic parallel MILP (12 threads) 2048 models 667 models Time limits: 55 / 24 1.08x 1.18x1.11x 1254 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% CPLEX 12.6.3 vs.12.7.0: MILP performance improvement
  6. 6. © 2016 IBM Corporation6 0 0,2 0,4 0,6 0,8 1 >0s >1s >10s 1,00 1,00 1,00 0,94 0,89 0,85 CPLEX 12.6.3 CPLEX 12.7.0 Date: 6 November 2016 Testset: MIQP: 365 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec CPLEX 12.6.3 vs.12.7.0: MIQP performance improvement Convex MIQP (12 threads) 263 models 84 models Time limits: 3 / 0 1.07x 1.18x1.13x 123 models § MIQP improvements summary -Node cuts (separation and filtering): 7% -Tuning of node probing effort: 6%
  7. 7. © 2016 IBM Corporation7 0 0,2 0,4 0,6 0,8 1 >0s >1s >10s 1,00 1,00 1,00 0,92 0,87 0,78 CPLEX 12.6.3 CPLEX 12.7.0 Date: 6 November 2016 Testset: MIQCP: 326 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec CPLEX 12.6.3 vs.12.7.0: MIQCP performance improvement Convex MIQCP (12 threads) 259 models 88 models Time limits: 5 / 1 1.09x 1.29x1.15x 154 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%
  8. 8. © 2016 IBM Corporation8 0 0,2 0,4 0,6 0,8 1 >0s >1s >10s 1,00 1,00 1,00 0,79 0,61 0,35 CPLEX 12.6.3 CPLEX 12.7.0 Date: 6 November 2016 Testset: Non-convex (MI)QP: 742 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads, deterministic Timelimit: 10,000 sec Non-convex (MI)QP (12 threads) 447 models 79 models Time limits: 12 / 1 1.27x 2.83x1.65x 157 models § All the improvement comes from newly added cutting planes: Cuts from Reformulation- Linearization Techniques (RLT-cuts) - H. D. Sherali and A. Alameddine, “Anew 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. CPLEX 12.6.3 vs.12.7.0: Global (MI)QP performance improvement
  9. 9. © 2016 IBM Corporation9 BENDERS DECOMPOSITION
  10. 10. © 2016 IBM Corporation10 Principle of the Benders decomposition § Iterative approach § Complete problem decomposed into a single master (MIP) problem, and a series of LP sub- problems. § 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 SP2 SP3 SP1
  11. 11. © 2016 IBM Corporation11 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.
  12. 12. © 2016 IBM Corporation12 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.
  13. 13. © 2016 IBM Corporation13 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
  14. 14. © 2016 IBM Corporation14 Computational results § Benders decomposition is not a silver bullet! § Full automatic decomposition, on our MIP library, models solved in 10 sec or more, threshold of 2x ratio, Benders is better on 5% of the models. § But it can really shine! § Specific benchmark set of 329 models for Benders, some with manual decomposition § Timeouts: 7 instead of 85 § 3x on all models § 10x on 100 sec or more
  15. 15. © 2016 IBM Corporation15 0 0,2 0,4 0,6 0,8 1 >1s >10s >100s 0,18 0,18 0,16 0,94 0,68 0,33 0,40 0,28 0,18 stochastic non stochastic Benders B&C compared to “regular” B&C Date: 6 November 2016 Testset: 390 models Machine: Intel X5650 @ 2.67GHz, 24 GB RAM, 12 threads Timelimit: 10,000 sec 5.69x 6.40x5.47x 2.53x 3.57x 5.41x Stochastic Non stochastic # models # wins/losses # timeout (regular B&C / Benders B&C) # models # wins/losses # 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 1.06x 1.48x 3.07x Computational results
  16. 16. © 2016 IBM Corporation16 RUNSEEDS, MODELING ASSISTANCE
  17. 17. © 2016 IBM Corporation17 Performance variability: seemingly neutral changes lead to a big variation in solution time By now a well known issue in MIP: l Danna (MIP workshop, 2008) l Koch et al. (Math. Prog. Comp. 2011) l Fischetti and Monaci (Op. Res. 2014) l Achterberg and Wunderling (Facets of Comb. Optimization, 2013) l Lodi and Tramontani (INFORMS 2013 Tutorial) MIP solver ingredients l Heuristics l Cutting planes l Branching variable selection l ... Changes in platform, code, parameter settings … → may have (big) impact on any ingredient → on the whole solution process → (sometimes) hard to get robust performance
  18. 18. © 2016 IBM Corporation18 model seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min map14 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 rococoB10- 011000 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 neos- 911880 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 3 instances from MIPLIB2010 test set, run on 5 different random seeds Performance variability exists and has massive effects
  19. 19. © 2016 IBM Corporation19 1 10 100 1000 model seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min map14 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 rococoB10- 011000 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 neos- 911880 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 3 instances from MIPLIB2010 test set, run on 5 different random seeds Performance variability exists and has massive effects All solvable instances, run on 5 different seeds, max/min truncated at 1000, log scale
  20. 20. © 2016 IBM Corporation20 1 10 100 1000 model seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min map14 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 rococoB10- 011000 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 neos- 911880 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 Performance variability exists and has massive effects ≤ 2 ok 131 ]2, 4] shaky 53 > 4 bad 28 rough classification All solvable instances, run on 5 different seeds, max/min truncated at 1000, log scale 3 instances from MIPLIB2010 test set, run on 5 different random seeds
  21. 21. © 2016 IBM Corporation21 To assess performance variability with CPLEX: model seed 1 seed 2 seed 3 seed 4 seed 5 min max max/min map14 65.41 61.77 62.82 62.35 64.96 61.77 65.41 1.06 rococoB10- 011000 1582.72 811.05 844.39 2223.25 740.78 740.78 2223.25 3.00 neos- 911880 315.22 10000.14 354.19 1.71 27.40 1.71 10000.14 5848.04 3 instances from MIPLIB2010 test set, run on 5 different random seeds l run one model with different random seeds l new command in the interactive: tools→runseeds Performance variability exists and has massive effects l surrogate for random perturbation of the model
  22. 22. © 2016 IBM Corporation22 CPLEX> read beasleyC3.mps 1. Read model
  23. 23. © 2016 IBM Corporation23 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 1. Read model 2. Set parameters (if any) l parameters set here apply to every run!
  24. 24. © 2016 IBM Corporation24 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch l runs model with different random seeds l default is 30 random seeds l each solve starts from scratch l CPLEX compiles statistics for each run
  25. 25. © 2016 IBM Corporation25 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . .
  26. 26. © 2016 IBM Corporation26 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results
  27. 27. © 2016 IBM Corporation27 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results
  28. 28. © 2016 IBM Corporation28 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results solution information, should be consistent otherwise → modeling assistance
  29. 29. © 2016 IBM Corporation29 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results solution effort, indicates variability
  30. 30. © 2016 IBM Corporation30 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results
  31. 31. © 2016 IBM Corporation31 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect results
  32. 32. © 2016 IBM Corporation32 CPLEX> read beasleyC3.mps CPLEX> set mip tolerance mipgap 0 CPLEX> set mip tolerance absmipgap 0 CPLEX> tools runseeds 1. Read model 2. Set parameters (if any) 3. Launch 4. Wait. . . ====== runseeds statistics of 30 runs exit sol objective gap iteration node runtime dettime run code stat value (%) count count seconds ticks 1 0 101 754 0.00 478311 4051 10.68 6941.20 2 0 101 754 0.00 378060 3991 8.91 5653.56 3 0 101 754 0.00 421786 4021 10.04 6489.83 . . . 30 0 101 754 0.00 413233 3969 9.06 5775.45 Optimization status codes: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 754 0.00 459225 4009 10.84 7021.98 std dev: 1.87205e-10 0.00 66658 43 1.07 779.37 Exit codes: 0 : No error 5. Inspect resultsStatistics per run Failed runs Aggregated statistics
  33. 33. © 2016 IBM Corporation33 aflow30a Some example results objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 1158 0.00 110298 3980 3.19 1883.01 std dev: 0 0.00 24585 779 0.30 181.44 l A stable model
  34. 34. © 2016 IBM Corporation34 gmu-35-40 aflow30a Some example results objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 1158 0.00 110298 3980 3.19 1883.01 std dev: 0 0.00 24585 779 0.30 181.44 l A stable model objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: -2.40673e+06 0.00 36824708 4624403 566.02 339839.59 std dev: 0 0.00 94077727 12739496 1607.25 935535.50 l A model with high variability
  35. 35. © 2016 IBM Corporation35 Hurink_edata_mt06_lazy aflow30a objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 49.2667 0.00 499151265 72138619 5946.96 3269407.19 std dev: 5.52695 0.00 532709392 107808642 7681.00 4400455.20 Some example results objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 1158 0.00 110298 3980 3.19 1883.01 std dev: 0 0.00 24585 779 0.30 181.44 l A stable model l A suspicious model l A model with high variability standard deviation in objective → indicator for numerical problems → modeling assistance objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: -2.40673e+06 0.00 36824708 4624403 566.02 339839.59 std dev: 0 0.00 94077727 12739496 1607.25 935535.50
  36. 36. © 2016 IBM Corporation36 Modeling assistance
  37. 37. © 2016 IBM Corporation37 Modeling assistance l detect problems in model data (small numbers, …) l detect bad modeling constructs (big-M, ...) → improve numerical robustness l issues collected from years of CPLEX support and development l issues with problem data l issues in the model formulation l issues with parameter settings l issues during the solution process l CPLEX scans your model and looks for these issues l for each issue found a warning is printed l enabled by parameter setting (disabled by default)
  38. 38. © 2016 IBM Corporation38 Modeling assistance l detect problems in model data (small numbers, …) l detect bad modeling constructs (big-M, ...) l issues collected from years of CPLEX support and development l issues with problem data l issues in the model formulation l issues with parameter settings l issues during the solution process l CPLEX scans your model and looks for these issues l for each issue found a warning is printed l enabled by parameter setting (disabled by default) l CPX_PARAM_DATACHECK 0 – off solveinput → improve numerical robustness
  39. 39. © 2016 IBM Corporation39 Modeling assistance l detect problems in model data (small numbers, …) l detect bad modeling constructs (big-M, ...) l issues collected from years of CPLEX support and development l issues with problem data l issues in the model formulation l issues with parameter settings l issues during the solution process l CPLEX scans your model and looks for these issues l for each issue found a warning is printed l enabled by parameter setting (disabled by default) l CPX_PARAM_DATACHECK 0 – off solve input & check 1 – check for invalid data (dup indices, NaNs, ...) → improve numerical robustness
  40. 40. © 2016 IBM Corporation40 Modeling assistance l detect problems in model data (small numbers, …) l detect bad modeling constructs (big-M, ...) l issues collected from years of CPLEX support and development l issues with problem data l issues in the model formulation l issues with parameter settings l issues during the solution process l CPLEX scans your model and looks for these issues l for each issue found a warning is printed l enabled by parameter setting (disabled by default) l CPX_PARAM_DATACHECK 0 – off 2 – check for common modeling issues solve modeling assistance modeling assistance input & check 1 – check for invalid data (dup indices, NaNs, ...) → improve numerical robustness
  41. 41. © 2016 IBM Corporation41 Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP)
  42. 42. © 2016 IBM Corporation42 Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) l Solution quality: CPLEX> display solution quality MILP objective 2.1961300000e+05 MILP solution norm |x| (Total, Max) 4.22897e+06 5.34130e+05 MILP solution error (Ax=b) (Total, Max) 1.02709e-09 4.36557e-11 MILP x bound error (Total, Max) 0.00000e+00 0.00000e+00 MILP x integrality error (Total, Max) 0.00000e+00 0.00000e+00 MILP slack bound error (Total, Max) 3.55271e-15 2.22045e-16
  43. 43. © 2016 IBM Corporation43 Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) l Solution quality: CPLEX> display solution quality MILP objective 2.1961300000e+05 MILP solution norm |x| (Total, Max) 4.22897e+06 5.34130e+05 MILP solution error (Ax=b) (Total, Max) 1.02709e-09 4.36557e-11 MILP x bound error (Total, Max) 0.00000e+00 0.00000e+00 MILP x integrality error (Total, Max) 0.00000e+00 0.00000e+00 MILP slack bound error (Total, Max) 3.55271e-15 2.22045e-16 l 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
  44. 44. © 2016 IBM Corporation44 Modeling assistance Quick reminder: Assessing numerics in CPLEX (for MIP) l Solution quality: CPLEX> display solution quality MILP objective 2.1961300000e+05 MILP solution norm |x| (Total, Max) 4.22897e+06 5.34130e+05 MILP solution error (Ax=b) (Total, Max) 1.02709e-09 4.36557e-11 MILP x bound error (Total, Max) 0.00000e+00 0.00000e+00 MILP x integrality error (Total, Max) 0.00000e+00 0.00000e+00 MILP slack bound error (Total, Max) 3.55271e-15 2.22045e-16 l Kappa statistics: track condition number of basis matrices Max condition number: Percentage (number) of stable bases: Percentage (number) of suspicious bases: Percentage (number) of unstable bases: Percentage (number) of ill-posed bases: Attention level: usually no problem double check be concerned
  45. 45. © 2016 IBM Corporation45 aT x ≤ My y binary, M huge y = 0 → aT x ≤ 0 y = 1 → aT x ≤ M y used to model availability of a resource Issues with problem formulation: big-M constraints resource not available resource available
  46. 46. © 2016 IBM Corporation46 aT x ≤ My y binary, M huge y = 0 → aT x ≤ 0 y = 1 → aT x ≤ M y used to model availability of a resource Typically M is much larger than ai → wide range of coefficients in the coefficient matrix causes numerical trouble Issues with problem formulation: big-M constraints resource not available resource available
  47. 47. © 2016 IBM Corporation47 aT x ≤ My y binary, M huge y = 0 → aT x ≤ 0 y = 1 → aT x ≤ M y used to model availability of a resource Typically M is much larger than ai → wide range of coefficients in the coefficient matrix causes numerical trouble → use indicator constraints y = 0 → aT x ≤ 0 y = 1 → aT x ≤ M Issues with problem formulation: big-M constraints resource not available resource available often one of the two can be expressed as bound on a variable
  48. 48. © 2016 IBM Corporation48 FALL_12_3 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 Issues with problem formulation: big-M constraints A model with big-M constraints
  49. 49. © 2016 IBM Corporation49 FALL_12_3 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 Issues with problem formulation: big-M contraints CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is linked with variable 'x2079' having ratio 1e+06. c1109: - 1000000 x257 + x2079 ≤ 0 x257 binary, x2079 ≥ 0 A model with big-M constraints
  50. 50. © 2016 IBM Corporation50 FALL_12_3 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 Issues with problem formulation: big-M constraints CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is linked with variable 'x2079' having ratio 1e+06. c1109: - 1000000 x257 + x2079 ≤ 0 x257 binary, x2079 ≥ 0 x257 = 0 → x2079 = 0 x257 = 1 → x2079 ≤ 1000000 A model with big-M constraints
  51. 51. © 2016 IBM Corporation51 FALL_12_3 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 Issues with problem formulation: big-M constraints CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is linked with variable 'x2079' having ratio 1e+06. c1109: - 1000000 x257 + x2079 ≤ 0 x257 binary, x2079 ≥ 0 x257 = 0 → x2079 = 0 x2079 ≤ 1000000 A model with big-M constraints
  52. 52. © 2016 IBM Corporation52 FALL_12_3 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 Issues with problem formulation: big-M constraints CPLEX Warning 1042: In constraint 'c1109', binary variable 'x257' is linked with variable 'x2079' having ratio 1e+06. c1109: - 1000000 x257 + x2079 ≤ 0 x257 binary, x2079 ≥ 0 x257 = 0 → x2079 = 0 x2079 ≤ 1000000 Max condition number: 1.6814e+13 Percentage (number) of stable bases: 8.06% Percentage (number) of suspicious bases: 89.66% Percentage (number) of unstable bases: 2.28% Percentage (number) of ill-posed bases: 0.00% Attention level: 0.015804 2.2289e+13 80.15% 19.83% 0.02% 0.00% 0.002048 → numerics improve significantly A model with big-M constraints
  53. 53. © 2016 IBM Corporation53 l CPLEX uses IEEE double precision arithmetic (quad precision in some places) l not every rational number has an exact representation → round-off error will occur ∑i in {1, ..., k} 1/k xi = 1 Issues with problem data: Single precision input data Consider fraction 1/k and a simple constraint
  54. 54. © 2016 IBM Corporation54 l CPLEX uses IEEE double precision arithmetic (quad precision in some places) l not every rational number has an exact representation → round-off error will occur ∑i in {1, ..., k} 1/k xi = 1 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 only 1/k in single rest in double! xi exact integer →infeasible by at least 1e-8 with single precision data →in practice often a lot worse Issues with problem data: Single precision input data Consider fraction 1/k and a simple constraint ∆ to exact value
  55. 55. © 2016 IBM Corporation55 l Obvious warning → Fix data generation 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 CPLEX Warning 1036: Coefficient for %s in %s looks like %d/%d in single precision
  56. 56. © 2016 IBM Corporation56 CPLEX Warning 1036: Coefficient for %s in %s looks like %d/%d in single precision l Obvious warning → Fix data generation l 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} xi = k∑i in {1, ..., k} 1/k xi = 1 → 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
  57. 57. © 2016 IBM Corporation57 Issues with problem data: Single precision input data ns2118727.mps.gz Max condition number: 1.0978e+14 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 A model with single precision data
  58. 58. © 2016 IBM Corporation58 Issues with problem data: Single precision input data Max condition number: 1.0978e+14 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 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' looks like 1/24 in single precision. R1024: C0017 - C0700 - C0926 + C2957 + C5189 - C5190 - 0.0416667 C7932 = 0 definitely looks truncated/rounded A model with single precision data
  59. 59. © 2016 IBM Corporation59 Issues with problem data: Single precision input data Max condition number: 1.0978e+14 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 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' looks like 1/24 in single precision. R1024: C0017 - C0700 - C0926 + C2957 + C5189 - C5190 - 0.0416667 C7932 = 0 8.7299e+06 100.00% 0.00% 0.00% 0.00% definitely looks truncated/rounded Max condition number: 1.0978e+14 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 A model with single precision data
  60. 60. © 2016 IBM Corporation60 Issues with problem data: Single precision input data Max condition number: 1.0978e+14 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 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' looks like 1/24 in single precision. R1024: C0017 - C0700 - C0926 + C2957 + C5189 - C5190 - 0.0416667 C7932 = 0 8.7299e+06 100.00% 0.00% 0.00% 0.00% solution time from 120 seconds definitely looks truncated/rounded Max condition number: 1.0978e+14 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 90 seconds A model with single precision data
  61. 61. © 2016 IBM Corporation61 Issues with problem data: Single precision input data Max condition number: 1.0978e+14 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 CPLEX Warning 1036: Coefficient for variable 'C7932' in constraint 'R1024' looks like 1/24 in single precision. R1024: C0017 - C0700 - C0926 + C2957 + C5189 - C5190 - 0.0416667 C7932 = 0 8.7299e+06 100.00% 0.00% 0.00% 0.00% solution time from 120 seconds definitely looks truncated/rounded Max condition number: 1.0978e+14 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 90 seconds A model with single precision data Attention blindly changing coefficients may change feasible region → may end up solving a different model → change model generation, not model
  62. 62. © 2016 IBM Corporation62 l Numbers below CPLEX default tolerances → essentially 0 → Fix numbers or tighten tolerance parameters l Numbers too small for the solver (smaller than 1e-13) → essentially 0 → Fix numbers l Numbers larger than CPX_INFBOUND → CPLEX will consider them as infinity → Fix numbers or, e.g., remove constraints with right-hand side > CPX_INFBOUND Issues with problem data: extreme numbers l feasibility tolerance l optimality tolerance l numerical emphasis l ...
  63. 63. © 2016 IBM Corporation63 l CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value l relative MIP gap (in CPLEX): best integer – best objective 1e-10 + |best integer| Issues with parameter settings: relative MIP gap
  64. 64. © 2016 IBM Corporation64 l CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value (default 1e-4) l relative MIP gap (in CPLEX): best integer – best objective 1e-10 + |best integer| l Objective: min aT x + K aT x* + K – (aT x' + K) aT x* – aT x' 1e-10 + |aT x* + K| 1e-10 + |aT x* + K| Issues with parameter settings: relative MIP gap →gap:
  65. 65. © 2016 IBM Corporation65 l CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value l relative MIP gap (in CPLEX): best integer – best objective 1e-10 + |best integer| l Objective: min aT x + K aT x* + K – (aT x' + K) aT x* – aT x' 1e-10 + |aT x* + K| 1e-10 + |aT x* + K| l K huge → gap small, independent of aT x* and aT x' Issues with parameter settings: relative MIP gap →gap:
  66. 66. © 2016 IBM Corporation66 l CPX_PARAM_EPGAP: stop if relative MIP gap drops below a value l relative MIP gap (in CPLEX): best integer – best objective 1e-10 + |best integer| l Objective: min aT x + K aT x* + K – (aT x' + K) aT x* – aT x' 1e-10 + |aT x* + K| 1e-10 + |aT x* + K| l K huge → gap small, independent of aT x* and aT x' CPLEX Warning 1037: Solution optimal within relative optimality tolerance of %g, but not optimal if objective offset of value %g is removed l related l modeling assistance warning CPLEX Warning 1038: Solution optimal within relative optimality tolerance of %g, but not optimal within absolute optimality tolerance of value %g Issues with parameter settings: relative MIP gap →gap: → fix K or adapt CPX_PARAM_EPGAP
  67. 67. © 2016 IBM Corporation67 l CPLEX tracks condition number of basis matrices in LP solve. l Large number of bases with large condition number → potential numerical problems → inexact/incorrect answers l Numerical trouble while solving the problem → Can you trust the results? How much can you trust them? → Check/fix data, check solution quality, use numerical emphasis, tighten tolerances Issues during solve: big condition numbers CPLEX Warning 1033: Detected 1277 suspicious condition number(s) >= 1e+07. CPLEX Warning 1034: Detected 30 unstable condition number(s) >= 1e+10. l Solving ns2034125
  68. 68. © 2016 IBM Corporation68 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 █ █ █ █ Potential issues in problem data Potential issues in problem formulation Potential issues in parameter settings Potential issues in solve Overview of modeling assistance warnings
  69. 69. © 2016 IBM Corporation69 l momentum1.mps.gz (absolute and relative MIP gap 0): Combining modeling assistance and runseeds l runseeds on original model: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 1128777 2881.88 1725072.05 std dev: 0.000312912 0.00 27028241 726250 1807.30 1071736.66
  70. 70. © 2016 IBM Corporation70 l momentum1.mps.gz (absolute and relative MIP gap 0): Combining modeling assistance and runseeds l runseeds on original model: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 1128777 2881.88 1725072.05 std dev: 0.000312912 0.00 27028241 726250 1807.30 1071736.66 l big-M constraints l Single precision data l scaled rows l wide coefficient ranges l fix modeling assistance warnings:
  71. 71. © 2016 IBM Corporation71 l momentum1.mps.gz (absolute and relative MIP gap 0): Combining modeling assistance and runseeds → iteration count, solution time, number of nodes reduced → variability in iteration count, solution time, number of nodes reduced l runseeds on original model: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 109143 0.00 40986027 1128777 2881.88 1725072.05 std dev: 0.000312912 0.00 27028241 726250 1807.30 1071736.66 l runseeds on model with all warnings fixed: objective gap iteration node runtime dettime value (%) count count seconds ticks 101 : integer optimal solution (30 times) average: 109143 0.00 34108977 921646 2310.04 1400198.34 std dev: 0.000580749 0.00 20783473 564391 1237.40 750744.53 l fix modeling assistance warnings
  72. 72. © 2016 IBM Corporation72 Be careful when auto-fixing warnings l Model ns2122603 from “unstable” MIPLIB 2010 testset l 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.
  73. 73. © 2016 IBM Corporation73 Be careful when auto-fixing warnings l Model ns2122603 from “unstable” MIPLIB 2010 testset l 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. l Solve original model: Max condition number: 1.7025e+20 Percentage (number) of stable bases: 0.00% (0) Percentage (number) of suspicious bases: 0.00% (0) Percentage (number) of unstable bases: 0.00% (0) Percentage (number) of ill-posed bases: 100.00% (1) Attention level: 1.000000 CPLEX stops at root with sub-optimal solution
  74. 74. © 2016 IBM Corporation74 Be careful when auto-fixing warnings l Model ns2122603 from “unstable” MIPLIB 2010 testset l 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. → replace by indicator → recompute coefficients l Solve original model: Max condition number: 1.7025e+20 Percentage (number) of stable bases: 0.00% (0) Percentage (number) of suspicious bases: 0.00% (0) Percentage (number) of unstable bases: 0.00% (0) Percentage (number) of ill-posed bases: 100.00% (1) Attention level: 1.000000 CPLEX stops at root with sub-optimal solution 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 l Solve fixed not too bad
  75. 75. © 2016 IBM Corporation75 Be careful when auto-fixing warnings l Model ns2122603 from “unstable” MIPLIB 2010 testset l 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. → replace by indicator → recompute coefficients l Solve original model: Max condition number: 1.7025e+20 Percentage (number) of stable bases: 0.00% (0) Percentage (number) of suspicious bases: 0.00% (0) Percentage (number) of unstable bases: 0.00% (0) Percentage (number) of ill-posed bases: 100.00% (1) Attention level: 1.000000 CPLEX stops at root with sub-optimal solution 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 l Solve fixed not too bad l but: l fixed model gives super-optimal solutions! l solutions are infeasible in original model!
  76. 76. © 2016 IBM Corporation76 Be careful when auto-fixing warnings l Model ns2122603 from “unstable” MIPLIB 2010 testset l 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. → replace by indicator → recompute coefficients l Solve original model: Max condition number: 1.7025e+20 Percentage (number) of stable bases: 0.00% (0) Percentage (number) of suspicious bases: 0.00% (0) Percentage (number) of unstable bases: 0.00% (0) Percentage (number) of ill-posed bases: 100.00% (1) Attention level: 1.000000 CPLEX stops at root with sub-optimal solution 3.4594e+15 0.55% (17) 93.47% (2906) 5.92% (184) 0.06% (2) 0.027745 l Solve fixed not too bad l but: l fixed model gives super-optimal solutions! l solutions are infeasible in original model! careful!
  77. 77. © 2016 IBM Corporation77 PIECEWISE LINEAR
  78. 78. © 2016 IBM Corporation78 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 § Version 12.7 fixes that § Example of LP file format: § 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. Minimize [...] Subject To [...] Pwl f: y = x 0.5 (20,240) (40,400) 2.0 End
  79. 79. © 2016 IBM Corporation79 ‘NO CHECK’ MIP STARTS
  80. 80. © 2016 IBM Corporation80 ‘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.
  81. 81. © 2016 IBM Corporation CPLEX Optimization Studio 12.7 What’s new in CP Optimizer
  82. 82. © 2016 IBM Corporation82 CP Optimizer performance enhancements V12.5.1 06/2013 V12.6 10/2013 V12.6.1 9/2014 V12.6.2 5/2015 V12.6.3 11/2015 V12.7 10/2016 0% 10% 20% 30% 40% 50% 60% 70% Progress factor between CP Optimizer releases Integer Scheduling
  83. 83. © 2016 IBM Corporation83 CP Optimizer Interactive ■Equivalent of CPLEX interative for CP Optimizer > cpoptimizer Welcome to IBM(R) ILOG(R) CP Interactive Optimizer 12.7.0.0 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5725-A06 5725-A29 Copyright IBM Corp. 1990, 2016. All Rights Reserved Type 'help' for a list of available commands Type 'help' followed by a command name for more information on commands CP-Optimizer>
  84. 84. © 2016 IBM Corporation84 CP Optimizer Interactive ■Main functionalities o Read a problem instance as a .cpo file CP-Optimizer> read myProblem.cpo o Change parameters of the current problem CP-Optimizer> set Workers 1 CP-Optimizer> set TemporalRelaxation Off o Write the current problem (including parameter changes) CP-Optimizer> write model myModifiedProblem.cpo
  85. 85. © 2016 IBM Corporation85 CP Optimizer Interactive ■Main functionalities o Launch CP Optimizer optimization on the current problem CP-Optimizer> optimize ! --------------------------------------------------------------- ! Minimization problem - 465 variables, 435 constraints ... ! --------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 2145 901 0.15s 1 - ... ! --------------------------------------------------------------- ! Search terminated by abort, 6 solutions found. ! Best objective : 2075 ... ! Search speed (br. / s) : 123617.5 ! ---------------------------------------------------------------- Solution found with objective 2075, search terminated by abort.
  86. 86. © 2016 IBM Corporation86 CP Optimizer Interactive ■Main functionalities o Display all or some variables in a solution CP-Optimizer> display solution J27O7 J27O7[1: 809 -- 57 --> 866]
  87. 87. © 2016 IBM Corporation87 CP Optimizer Interactive ■Main functionalities o Launch initial propagation at root node CP-Optimizer> propagate Propagation succeeded. o Display all or some variables domain after propagation CP-Optimizer> display solution J27O7 J27O7[1: 431..IloIntervalMax-355 -- 57 --> 488..IloIntervalMax-298]
  88. 88. © 2016 IBM Corporation88 CP Optimizer Interactive ■Main functionalities o Launch conflict refiner on an infeasible problem CP-Optimizer> tools conflict ! ---------------------------------------------------------------------------- ! Conflict refining - 64 constraints, 60 variables ! ---------------------------------------------------------------------------- ! Iteration Number of constraints * 1 64 ... * 9 1 ! Conflict refining terminated ! ---------------------------------------------------------------------------- ! Conflict status : Terminated normally, conflict found ! Conflict size : 1 constraint ! Number of iterations : 9 ! Total memory usage : 965.3 kB ! Conflict computation time : 0.15s ! ---------------------------------------------------------------------------- Conflict found.
  89. 89. © 2016 IBM Corporation89 CP Optimizer Interactive ■Main functionalities o Display current conflict CP-Optimizer> display conflict // ------ Conflict members: --------------------------------------------------- #line 116 "../../../examples/src/cpp/sched_conflict.cpp" 12 >= RES1; o Write current conflict as a .cpo file CP-Optimizer> write conflict conflict.cpo
  90. 90. © 2016 IBM Corporation90 CP Optimizer Interactive ■Main functionalities o Optimizes the current problem using different seeds and displays some statistics CP-Optimizer> tools runseeds 5 Benchmarking current problem on 5 runs... Run Solution Proof Time (s) Objective --------------------------------------------------------- 1 1 1 5.727 930 2 1 1 4.94 930 3 1 1 6.39 930 4 1 1 5.59 930 5 1 1 4.068 930 --------------------------------------------------------- All runs complete Average 100 % 100 % 5.343 930 Std dev 0.8793 0 Min 4.068 930 Max 6.39 930
  91. 91. © 2016 IBM Corporation91 CPO file format ■CPO file format is low-level specification of optimization problem. ■CP Optimizer can both read and write .cpo files. // Decision variables: Belgium = intVar(1..4); Denmark = intVar(1..4); France = intVar(1..4); Germany = intVar(1..4); Luxembourg = intVar(1..4); Netherlands = intVar(1..4); /* Constraints: */ Belgium != France; Belgium != Germany; Belgium != Netherlands; Belgium != Luxembourg; Denmark != Germany; France != Germany; France != Luxembourg; Germany != Luxembourg; Germany != Netherlands; parameters { SearchType = DepthFirst; }
  92. 92. © 2016 IBM Corporation92 New: Starting point in CPO file format ■User can specify an initial solution to speed up search. ■The solution can specify ranges and can omit some variables. // Decision variables: Belgium = intVar(1..4); Denmark = intVar(1..4); France = intVar(1..4); Germany = intVar(1..4); Luxembourg = intVar(1..4); Netherlands = intVar(1..4); /* Constraints: */ Belgium != France; Belgium != Germany; Belgium != Netherlands; Belgium != Luxembourg; Denmark != Germany; France != Germany; France != Luxembourg; Germany != Luxembourg; Germany != Netherlands;parameters { SearchType = DepthFirst; } startingPoint { France = 1..3; Belgium = 2; }
  93. 93. © 2016 IBM Corporation93 Syntax of starting point in CPO file format Integer variables x = intVar(1..10); y = intVar(1..10); z = intVar(1..10); startingPoint { x = 1; y = 2..5; z = intVar(2..5); } Interval variables (scheduling) a = intervalVar(optional, length=5); b = intervalVar(optional, length=2); c = intervalVar(optional); d = intervalVar(optional); startingPoint { a = (present, start=1, end=6); b = (present, start=10..15); c = intervalVar(absent); d = absent; }
  94. 94. © 2016 IBM Corporation94 New warnings for starting point (examples) § Starting point value 1 is not in the domain of integer variable 'x'. § Starting point range 1..5 is partly outside of the domain of integer variable 'y'. § Starting point specifies attributes of absent interval variable 'a'. § Starting point for interval variable 'a' is inconsistent with its initial domain.
  95. 95. © 2016 IBM Corporation95 Modeling with Python for CP Optimizer 12.6.3 § All CPO modeling function are available from Python § Python operators overloaded for most common arithmetic and logical operations. § Solving is done transparently by submitting the model to a CPO solver available on DOcloud: o No CPO solver to install locally. o Free trial available at https://developer.ibm.com/docloud/try-docloud-free/ § Single Python package docplex for both CPO and CPLEX. § try “pip install docplex” !
  96. 96. © 2016 IBM Corporation96 Python modeling example: Golomb ruler A Golomb ruler is a set of marks at integer positions along an imaginary ruler such that no two pairs of marks are the same d from docplex.cp.model import CpoModel # Create model mdl = CpoModel() # Create an array of variables for positions of ruler marks ORDER = 6 marks = mdl.integer_var_list(ORDER, 0, (ORDER - 1) ** 2, "M") # Force all marks distances to be different mdl.add(mdl.all_diff([marks[i] - marks[j] for i in range(1, ORDER) for j in range(0, i)])) # Avoid symmetric and mirror solutions for i in range(1, ORDER): mdl.add(marks[i] > marks[i - 1]) mdl.add((marks[1] - marks[0]) < (marks[ORDER - 1] - marks[ORDER - 2])) # Minimize ruler size (position of the last mark) mdl.add(mdl.minimize(marks[ORDER - 1])) # Solve model msol = mdl.solve() print("Solution: " + ' '.join(str(msol[v]) for v in marks)) > python golomb_ruler.py Solution: 0 1 4 10 12 17
  97. 97. © 2016 IBM Corporation97 Improvements to the Python API in CP Optimizer 12.7.0 § Local solve, using CP Optimizer interactive as back-end § With local solve only: o propagation (available soon also on DOcloud), o conflict refiner, o retrieve multiple solutions with start/next implemented as iterator. § With local and DOcloud solve: o warm start § Support of numpy types and arrays o support of numpy arrays and numeric types § Integration in DOcloud Python worker o allows to submit directly a Python source to DOcloud o all functions become available as for local solve.
  98. 98. © 2016 IBM Corporation98 Python new feature: Propagation § Constraint propagation is the process of communicating the domain reduction of a decision variable to all of the constraints that are stated over this variable. § Result is a partial solution with a reduced domain for each variable. from docplex.cp.model import CpoModel # Create model mdl = CpoModel() # Create an array of variables for positions of ruler marks ORDER = 6 marks = mdl.integer_var_list(ORDER, 0, (ORDER - 1) ** 2, "M") # Force all marks distances to be different mdl.add(mdl.all_diff([marks[i] - marks[j] for i in range(1, ORDER) for j in range(0, i)])) # Avoid symmetric and mirror solutions for i in range(1, ORDER): mdl.add(marks[i] > marks[i - 1]) mdl.add((marks[1] - marks[0]) < (marks[ORDER - 1] - marks[ORDER - 2])) # Minimize ruler size (position of the last mark) mdl.add(mdl.minimize(marks[ORDER - 1])) # Propagate constraints msol = mdl.propagate() print("Solution: " + ' '.join(str(msol[v]) for v in marks)) > python golomb_ruler.py Solution: ((0, 20),) ((1, 21),) ((2, 22),) ((3, 23),) ((4, 24),) ((5, 25),)
  99. 99. © 2016 IBM Corporation99 Python new feature: Conflict refiner § The conflict refiner is used to find an explanation for the infeasibility of a model. § Result is a list of constraints and/or variable that are a primer failing cause. from docplex.cp.model import CpoModel # Create model mdl = CpoModel() # Create an array of variables for positions of ruler marks ORDER = 4 # Number of marks MAX_LENGTH = 4 # Max rule length, voluntarily TOO SHORT to have an infeasible model marks = mdl.integer_var_list(ORDER, 0, MAX_LENGTH, "M") # Force all marks distances to be different mdl.add(mdl.all_diff([marks[i] - marks[j] for i in range(1, ORDER) for j in range(0, i)])) # Avoid symmetric and mirror solutions for i in range(1, ORDER): mdl.add(marks[i] > marks[i - 1]) mdl.add((marks[1] - marks[0]) < (marks[ORDER - 1] - marks[ORDER - 2])) # Minimize ruler size (position of the last mark) mdl.add(mdl.minimize(marks[ORDER - 1])) # Call conflict refiner to identify failing causes rsol = mdl.refine_conflict() rsol.print_conflict() > python golomb_ruler.py Conflict refiner result: Member constraints: _CTR_3 = M2 > M1 _CTR_2 = M1 > M0 _CTR_1 = alldiff([M1 - M0, M2 - M0, M2 - M1, M3 - M0, M3 - M1, M3 - M2]) _CTR_4 = M3 > M2
  100. 100. © 2016 IBM Corporation100 Python new feature: Solution iteration from docplex.cp.model import CpoModel from docplex.cp.solver.solver import CpoSolver # Create model . . . . . (see above) . . . . . # Minimize ruler size (position of the last mark) minexpr = mdl.minimize(marks[ORDER - 1]) mdl.add(minexpr) # First solve the model to find the smallest ruler length msol = mdl.solve() rsize = msol[marks[ORDER - 1]] print("Shortest ruler for order {} has length {}".format(ORDER, rsize)) # Update the model to remove minimization and force last mark position mdl.remove(minexpr) mdl.add(marks[ORDER - 1] == rsize) # Request all solutions print("List of all possible rulers:") for msol in CpoSolver(mdl, SearchType='DepthFirst', Workers=1): print(' '.join(str(msol[v]) for v in marks)) > python golomb_ruler.py Shortest ruler for order 6 has length 17 List of all possible rulers for length 17: 0 1 4 10 12 17 0 1 8 11 13 17 0 1 8 12 14 17 0 1 4 10 15 17 § With our Golomb ruler example, suppose we would like to retrieve ALL possible rulers that have a minimal length. § We first solve the initial model to get the minimal ruler size, force the last mark to this size, and then iterate on all solutions :
  101. 101. © 2016 IBM Corporation101 Python new feature: Warm start § Warm start allows to initialize the solver with a partial solution that can speed-up the search of the solution. § This function is available when solving locally or with DOcloud. from docplex.cp.model import CpoModel from docplex.cp.solution import CpoModelSolution # Create model . . . . . (as above) . . . . . # Add starting point sp = CpoModelSolution() sp.add_integer_var_solution(marks[1], 1) sp.add_integer_var_solution(marks[2], 4) mdl.set_starting_point(sp) # Solve model msol = mdl.solve() print("Solution: " + ' '.join(str(msol[v]) for v in marks)) > python golomb_ruler.py Solution: 0 1 4 10 12 17
  102. 102. © 2016 IBM Corporation102 V12.5.1 06/2013 V12.6 10/2013 V12.6.1 9/2014 V12.6.2 5/2015 V12.6.3 11/2015 V12.7 10/2016 0% 10% 20% 30% 40% 50% 60% 70% Progress factor between CP Optimizer releases Integer Scheduling
  103. 103. © 2016 IBM Corporation104 Legal Disclaimer • © IBM Corporation 2015.All Rights Reserved. • The information contained in this publication is provided for informational purposes only.While efforts were made to verify the completeness and accuracy of the information contained in this publication,itis provided AS IS withoutwarranty of any kind, express or implied.In addition,this information is based on IBM’s current productplans and strategy, which are subjectto change by IBM withoutnotice. IBM shall notbe responsible for any damages arising outof the use of, or otherwise related to, this publication or any other materials.Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors,or altering the terms and conditions of the applicable license agreementgoverning the use of IBM software. • References in this presentation to IBM products, programs,or services do not imply that they will be available in all countries in which IBM operates.Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying thatany activities undertaken by you will result in any specific sales, revenue growth or other results. • Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughputor performance that any user will experience will vary depending upon many factors, including considerations such as the amountof multiprogramming in the user's job stream, the I/O configuration,the storage configuration,and the workload processed. Therefore,no assurance can be given that an individual user will achieve results similar to those stated here. • IBM, the IBM logo,CPLEX Optimizer, CPLEX Optimization Studio are trademarks of International Business Machines Corporation in the United States, other countries,or both. Unyte is a trademark of WebDialogs,Inc., in the United States, other countries,or both. • If you reference Intel® and/or any of the following Intel products in the text, please mark the first use and include those that you use as follows; otherwise delete: Intel, Intel Centrino,Celeron,Intel Xeon,Intel SpeedStep,Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

×