coin-or / coin-or/python-mip

Problems with mipstart

Open
#154 1 comment 1 reaction 0 assignees View on GitHub
bug cbc
Dominant language
Linear Programming
Stars
600
Forks
108
PR merge metrics
No merged PRs in 30d

Description

I don't think it is a bug but I am facing issues with the mipstart option of the cbc solver.
I have a problem I would like to decompose into two steps and I would like to initialize the second problem with the results from the first step.

I attached the scripts for both problems (mip2151 for the first step and mip 2152 for the second one). The problem is quite small here but when I will succeed to pass an initial solution, I will significantly increase the size of the problem.
[script2152.txt](https://github.com/coin-or/python-mip/files/5458692/script2152.txt)
[script2151.txt](https://github.com/coin-or/python-mip/files/5458693/script2151.txt)

After solving the first problem, I saved the results into a .sol file with `save_mipstart(mip_start, '.sol')` attribute.
Here is the content of this .sol file ([mipstart2151_10.txt](https://github.com/coin-or/python-mip/files/5458702/mipstart2151_10.txt))
However, when I introduce this file into the second problem with the following lines:

```
mip_start = load_mipstart('mipstart2151_10.sol')
var_list=[]
for name, value in mip_start:
var = model.var_by_name(name)
if var is not None:
var_list.append((var, value))
model.start= var_list
model.validate_mip_start()
```
I get the following error message: `NOT OK, optimization status: OptimizationStatus.INFEASIBLE`
Even with a one-period problem, I get the same message.
Then, if I execute `model.optimize()` the results are exactly the same than without initialization (even the number of iterations and explored nodes), which let me think that the solver does not take into account the results from the first step.
I don't know if it because the results are not indexed in the .sol file or if I missed some steps.

I am using Spyder to execute the script (Ipython version 7.12.0) and I have the version 1.9.3 of python-mip.

Thank you in advance for any advice or comment

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.