List of Contributions

Philippe Couronne

Contact Details

My Content

1 to 20 of 47 total
Posted By Philippe Couronne Jul 23, 2021 4:43 AM
Found In Egroup: Decision Optimization
\ view thread
Hello, Unfortunately, there is no native way to relax SOS variable sets. However, you are right in that we could improve the linear relaxer by replacing SOS by linear constraints in the relaxed model. Note that for SOS2, the relaxation will be much weaker, as the constraint that only two adjacent ...
Posted By Philippe Couronne Jun 8, 2021 3:38 AM
Found In Egroup: Decision Optimization
\ view thread
What you need is a way to change the CPLEX problem type. To avoid losing consistency between cplex and docplex, I strongly advise to do it temporarily. I have modified the `solvefixed` example code to set the problem type to 0 (LP) instead of 3 (fixedMIP). Using a contextmanager ensures the actual type ...
Posted By Philippe Couronne Jun 7, 2021 8:22 AM
Found In Egroup: Decision Optimization
\ view thread
Thanks for the sample. Though is is not self-contained, I was able to reproduce and understand. The root cause is the "update" you are performing on the variable dict. This is not really necessary but breaks the internal consistency, as internal container objects keep an iterator on the dict's values, ...
Posted By Philippe Couronne Jun 7, 2021 6:11 AM
Found In Egroup: Decision Optimization
\ view thread
Are you using a recent version of DOcplex ( I suggest either 2.20 or 2.21)? If not I suggest first upgrade to one those two. I understand you get two issues:one with the relaxer and another with Model.clone() is that so? Can you reproduce with a small sample, that would help? Regards, Philippe ...
Posted By Philippe Couronne Jun 7, 2021 5:26 AM
Found In Library: Decision Optimization
Posted By Philippe Couronne Jun 7, 2021 5:26 AM
Found In Egroup: Decision Optimization
\ view thread
Hi, If you want to solve a linear model, where all discrete variables are fixed to their value sin a previous solve, use solve_fixed. If you want to solve a linear relaxation of the MILP model, regardless of previous solve values, use the LinearRelaxer class Attached is a sample with solve fixed. ...
Posted By Philippe Couronne May 18, 2021 10:27 AM
Found In Egroup: Decision Optimization
\ view thread
From the previous message, it seems clear the ,multiple installations of docplex with different versions of `pip` resulted in an inconsistent state. After consulting other developers here at IBM the consensus is that only a `rm` operation on the C:\Python37\lib\site-packages\docplex internal package ...
Posted By Philippe Couronne May 18, 2021 7:50 AM
Found In Egroup: Decision Optimization
\ view thread
Thanks for the clarification; this seems to be a conjunction of two problems: - first the install under COS/python installs both `cplex` and `docplex` (a fixed, old version). - second, as Docplex is a source package, the way it is handled by `pip` has changed with newer versions, so latest versions of ...
Posted By Philippe Couronne May 18, 2021 5:00 AM
Found In Egroup: Decision Optimization
\ view thread
Hello docplex2.20 should work fine with cplex 12.9, this looks like an installation issue. Can you run the following command in an environment where docplex can be found by the PYTHONPATH: python -m docplex.mp.check_list and post the output? This checker identifies which version of docplex and cplex ...
Posted By Philippe Couronne May 17, 2021 9:44 AM
Found In Egroup: Decision Optimization
\ view thread
Hello Leo, Generic callbacks are not yet directly supported by DOcplex, but you can use them through the `cplex` attribute of a Model instance, and use the index-based Python API (short answer). I wrote a small sample code at https://github.com/PhilippeCouronne/docplex_contribs/blob/master/docplex_c ...
Posted By Philippe Couronne May 17, 2021 3:55 AM
Found In Egroup: Decision Optimization
\ view thread
Hello The log file you sent shows no progress of the best bound, thus I would suggest to start with setting `mip emphasis` to 3 (best bound) or maybe 4 (hidden solutions). See https://www.ibm.com/docs/en/icos/20.1.0?topic=parameters-mip-emphasis-switch for details. For example, in cplex interactive: ...
Posted By Philippe Couronne May 12, 2021 9:20 AM
Found In Egroup: Decision Optimization
\ view thread
Hello You can set any CPLEX parameter from Docplex. the property `Model.parameters` returns a hierarchical parameter structure, from whoch you can get and set values, just as with the CPLEX Python API. In your case: mdl.parameters.emphasis.mip = 2 # any value from 0 to 5 or mdl.parameters.mip.tolerances.mipgap ...
Posted By Philippe Couronne Mar 31, 2021 4:30 AM
Found In Egroup: Decision Optimization
\ view thread
Hello, The order of constraints has an impact on the MIP search. However, there is no algorithm to reorder constraints to ensure a better performance. If your MIP is slow, I suggest you try tuning parameters, starting with`mip emphasis`, see https://www.ibm.com/support/knowledgecenter/SSSA5P_20.1.0/ ...
Posted By Philippe Couronne Feb 14, 2021 12:28 PM
Found In Egroup: Decision Optimization
\ view thread
Dear Riccardo This is a reported bug of DOcplex 2.20, which has nothing to do with the Academic version (still note the academic version is limited to 1000 variables, but this will show up only on solve()) There is a simple workaround: pass a list instead of a set to `integer_var_dict` and it will work ...
Posted By Philippe Couronne Feb 12, 2021 5:50 AM
Found In Egroup: Decision Optimization
\ view thread
Hi Juan, DOcplex provides a simple, operator-based API to cplex. However, as Vincent said, whenever you need some functionality which is not (yet) directly supported in Docplex, you can access the `cplex` object inside, and use the Python wrappers around the C API, giving you unlimited access to CPLEX ...
Posted By Philippe Couronne Feb 11, 2021 5:52 AM
Found In Egroup: Decision Optimization
\ view thread
Thanks for your quick answer, Federico. Now this is crystal clear. I'll register an issue and this will be fixed in the next release. Thanks again for spotting and reporting this. Such feedback help us to improve Docplex. Philippe. ------------------------------ Philippe Couronne ------------- ...
Posted By Philippe Couronne Feb 11, 2021 5:28 AM
Found In Egroup: Decision Optimization
\ view thread
Hi Federico You're welcome. Thanks for the confirmation. About the 'np.bool' deprecation, I found no explicit mention of `np.bool` in conflict refiner; Does this warning happen only when importing conflict refiner or other Docplex modules? To help me reproduce, can you attach the output of `pip freeze` ...
Posted By Philippe Couronne Jan 26, 2021 9:41 AM
Found In Egroup: Decision Optimization
\ view thread
Hello, Answer for P(ython API: assuming `model` is a Cplex instance, model.parameters.emphasis.mip returns a Parameter object, with a `set()` method to modify. For example (taken from the `etsp.py` sample in Cplex Python samples), setting hidden feasibility (=4) as mip emphasis reads: model.paramet ...
Posted By Philippe Couronne Jan 26, 2021 8:44 AM
Found In Egroup: Decision Optimization
\ view thread
Hi Federico, I confirm the call to `sync_cplex()` you found is the only workaround for now, except for starting a solve; this code is non-documented and might well be changed in future versions. However, the bug has been fixed and the fix will be part of the next version of DOcplex. Thanks. ...
Posted By Philippe Couronne Jan 26, 2021 4:56 AM
Found In Egroup: Decision Optimization
\ view thread
Hi I confirm this is a bug. As you noticed, synchronization is performed before any solve-related operations (solve, populate, refine_conflict), so starting a solve with a small time limit (1s) will indeed re-synchronize bounds before an export. There is a way to work around this without solving, but ...