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

Update lpsolve interface and handled default solver logic #7

Merged
merged 9 commits into from
Oct 27, 2017

Conversation

islerfab
Copy link
Collaborator

Resolves #3 and #4.

  • Fixed bugs in the lpsolve solver so it behaves like the cplex solver
    • Main issue: Multiple appearences of the same variable in a constraint were ignored, now they're added
    • Only known issue now: It's much slower, but we can't do too much about that.
  • If a solver is requested in the default way (via new SolverClient()), it will now
    • first try to find the cplex solver; if found, use the cplex solver
    • if not found, fall back to the lpsolve solver while warning the user that this is much less performant
  • Added a mechanism to provide the native libraries of LPSolve with the jar file
    • At runtime, if the libraries are not installed by the user, it copies the right libraries (it depends on the OS and architecture of the user's machine) into the tempDir and adds this new directory to the java library path
    • This way, there should always be a fall-back option without any effort of the user.
    • If this fails for any reason (e.g. access right issues for the tempDir), it will display a precise step-by-step instruction of how to prepare lpsolve so it works.
  • Minor cleanups I stumbled upon, no general systematic refactoring

…enough

* First experiments with fallback mechanism to lpsolve if cplex is not found
…ance of a variable in a constraint into account, which is normally fine - However, if a constraint has multiple appearances of a variable in a constraint, it should take all of them into account (i.e., add them up).

Example: 3x - 1x >= 0 was interpreted as -1x >= 0, now it's interpreted as 2x >= 0
  - If cplex is not found, it falls back to lp solve
  - Still TODO: If cplex is explicitly "ordered", but jar is not available, the error is not handled consistently
* Added instructions to get over the errors if either jars or native libraries are not found
…ar. Tested on Windows, to be tested on Unix.
@islerfab islerfab requested a review from blubin October 24, 2017 10:05
@ghost ghost assigned islerfab Oct 24, 2017
@ghost ghost added the in progress label Oct 24, 2017
* Handle values that are higher than LPSolve's limit of 9000000 inside the LPSolve solver, logging a warning if a value has been capped.
in a large MIP, there are way too many warnings.
Copy link
Owner

@blubin blubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maven integration and improvements to LPSolve

@islerfab islerfab merged commit c2eee69 into develop Oct 27, 2017
@ghost ghost removed the in progress label Oct 27, 2017
@islerfab islerfab deleted the 3-update-lpsolve branch October 27, 2017 16:50
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.

2 participants