coin-or / coin-or/CyLP

PuLP integration, cbcModel.status, variable names, readMPS, etc.

Open
#206 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JetBrains MPS
Stars
192
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I'm trying to integrate this package as an optional dependency of PuLP, as an alternative to distribute the cbc binary.

You can see the progress here: https://github.com/coin-or/pulp/blob/60579dc516c55c63b603f139e2b823de6a1b2d31/pulp/apis/coin_api.py#L872

I've been encountering a number of issues.

I've tried to follow the documentation on [CyClpSimplex](https://coin-or.github.io/CyLP/modules/CyClpSimplex.html) and [CyCbcModel](https://coin-or.github.io/CyLP/modules/CyCbcModel.html).

It seems that `cbcModel.status` returns "relaxation infeasible" on optimal problems, where the log says is Optimal.

What's the correct way to get the correct status after solving a problem? I attach a few mps with

filename: test_continuous-pulp.txt
cbc logs say: Optimal
cbc.status returns: relaxation infeasible
cbc.solve() returns: 0

--------------

The return code from `cbcModel.solve()` returns 0 (which I interpret as Optimal) when the log status shows "Linear relaxation infeasible".

filename: test_infeasible-pulp.txt
cbc logs says: Linear relaxation infeasible
cbc.status returns: relaxation infeasible
cbc.solve() returns: 0

Result - Linear relaxation infeasible

------------

Also, how do I solve maximization problems? Do I need to invert the objective functional myself? Or is there a way to communicate this when loading the MPS file?

filename: test_continuous_max-pulp.txt

-------------

Finally, how do I access the variables by name when I load the MPS file as input with `CyClpSimplex.readMps`?

`CyClpSimplex.variables` returns an error
`CyClpSimplex.variableNames` is empty

[test_infeasible-pulp.txt](https://github.com/user-attachments/files/19344314/test_infeasible-pulp.txt)
[test_continuous-pulp.txt](https://github.com/user-attachments/files/19344313/test_continuous-pulp.txt)
[test_continuous_max-pulp.txt](https://github.com/user-attachments/files/19344315/test_continuous_max-pulp.txt)

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.