coin-or / Clp

COIN-OR Linear Programming Solver
Other
396 stars 82 forks source link

Idiot not working on Windows #163

Closed BjornPetersen closed 3 years ago

BjornPetersen commented 3 years ago

Using the stand alone CLP executable on Linux it takes 6 seconds to solve the attached instance. When using libClp on Windows it takes 10 minutes (100 times slower). It appears that Idiot::crash is finding a "wrong" initials solution that slows down what happens afterward.

Using Visual Studio 2019 and static linking with libClp, libCoinUtils, libOsi, and libOsiClp:

#include "OsiClp/OsiClpSolverInterface.hpp"
int main() {
    auto clpSolver = OsiClpSolverInterface();
    clpSolver.readLp("Clp-Dual_50.lp");
    clpSolver.initialSolve();
}

Clp-Dual_50.zip output.txt

jjhforrest commented 3 years ago

Bjorn,

With OsiClpSolverInterface::initialSolve the code decides to do a very lightweight Idiot crash - which gets nowhere. You need a bit more tuning. The following works for me.

include "ClpSimplex.hpp"

include "OsiClpSolverInterface.hpp"

int main(int argc, const char *argv[]) { OsiClpSolverInterface clpSolver; clpSolver.readLp("/tmp/Clp-Dual_50.lp"); ClpSolve solveOptions; solveOptions.setSolveType(ClpSolve::usePrimalorSprint); solveOptions.setSpecialOption(1,2,100); clpSolver.setSolveOptions(solveOptions); clpSolver.initialSolve(); return 0; }

John Forrest

On 23/10/2020 09:14, BjornPetersen wrote:

Using the stand alone CLP executable on Linux it takes 6 seconds to solve the attached instance. When using libClp on Windows it takes 10 minutes (100 times slower). It appears that Idiot::crash is finding a "wrong" initials solution that slows down what happens afterward.

Using Visual Studio 2019 and static linking with libClp, libCoinUtils, libOsi, and libOsiClp:

|#include "OsiClp/OsiClpSolverInterface.hpp" int main() { auto clpSolver = OsiClpSolverInterface(); clpSolver.readLp("Clp-Dual_50.lp"); clpSolver.initialSolve(); } |

Clp-Dual_50.zip https://github.com/coin-or/Clp/files/5428070/Clp-Dual_50.zip output.txt https://github.com/coin-or/Clp/files/5428165/output.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/Clp/issues/163, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHBIA4XAASQKCJKIT5TSME3NLANCNFSM4S4HK5KQ.

BjornPetersen commented 3 years ago

Hi John

Thanks, that did the trick. Is there a guide somewhere for setting these secret parameters/options?

Best regards Bjørn

jjhforrest commented 3 years ago

Bjorn,

There are some hints in ClpSolve.hpp

John Forrest On 26/10/2020 07:11, BjornPetersen wrote:

Hi John

Thanks, that did the trick. Is there a guide somewhere for setting these secret parameters/options?

Best regards Bjørn

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/coin-or/Clp/issues/163#issuecomment-716353975, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHHYQVEXIWJGED5CW2LSMUOKFANCNFSM4S4HK5KQ.