Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newline before comparison operator in .lp file format #72

Conversation

dlaehnemann
Copy link
Contributor

This is a workaround for this curious cbc bug that I encountered:
coin-or/CoinUtils#144

It seems that the LP file format is not standardized (yay!). However, points 5 and 9 in this lpsolve documentation for the CPLEX LP format and this IBM CPLEX LP format description of constraints agree in that constraints can go across multiple lines. Only the constraint name and its colon (e.g. c1234:) need to appear on the same line, as do the comparison operator and the right-hand side (e.g. >= 5678). And I found this slide deck that refers to the LP file format as developed by CPLEX. So I assume cbc (and the other solvers) will follow these kinds of "format descriptions".

So introducing these newlines should be safe to do and will prevent this bug. To get back the original format, this PR can later be reverted once the issue in CoinUtils (and thus cbc) is addressed. To make this easier, I would squash the commits in this PR during merging.

@dlaehnemann
Copy link
Contributor Author

After extensive digging, I have now found a better workaround using the NativeCbcSolver. However, for this to work, the used cbc currently still has to be patched to avoid a concurrency until a new major version is released. If anybody is looking to use the NativeCbcSolver and running into issues with multiple Cbc instances (on separate problems and on separate threads, but on the same system) running in parallel with some of them randomly crashing, here are solutions that I found:
KardinalAI/coin_cbc#7 (comment)

I'll close this issue, because this is only a workaround until a new release of CoinUtils with the recent fixes to the LP input parsing bugs I reported. It's not worth merging this, if it becomes obsolete in the near future and will only cause confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant