[Coin-lpsolver] Cbc failure with the integer presolve
John J Forrest
jjforre at us.ibm.com
Tue Jan 4 06:06:42 EST 2005
Jean-Sebastien,
Will look at it tomorrow.
John Forrest
Jean-Sebastien Roy <js at jeannot.org>
Sent by: coin-lpsolver-bounces at list.coin-or.org
01/03/2005 05:38 PM
To
coin-lpsolver at list.coin-or.org
cc
Subject
[Coin-lpsolver] Cbc failure with the integer presolve
Hi !
Trying to update my cuting plane code to the latest Clp/Cbc version, I
encountered various problems, I did not encounter with the previous
versions.
For example, when solving the small attached test.mps MIP problem using
Cbc and the interger presolve, I get:
Cbc0006I The LP relaxation is infeasible or too expensive
I cannot reproduce the problem using the cbc executable itself, so I've
attached a small driver.cpp main that exhibit the problem on my
computer. My driver is quite possibly the culprit here (since it works
with the cbc executable), but I'm not able to see exactly what's wrong
with it.
The driver basically does :
OsiClpSolverInterface solver1;
CbcModel model(solver1);
model.solver()->readMps("test.mps","mps");
model.initialSolve();
/* Add a few Cuts using model.addCutGenerator */
CbcModel *model2 = model.integerPresolve();
model2->branchAndBound();
model.originalModel(model2,false);
When not using the integerPresolve, it works fine. It the integer
presolve unsafe to use ?
(If matters, I used GCC 3.3.6. I wasn't able to compile Coin anymore
using GCC 2.95.4, and GCC 3.4.4 made Clp crash badly on my computer (but
it may have been compilation flags))
Thank you very much in advance for any help,
Regards,
js
PS: For what is worth, with the current version of Clp/Cbc, I observe a
very small problem, that even with the logLevel equal to -1, some
information are output by Coin, like:
Coin0506I Presolve 1 (-2) rows, 2 (-1) columns and 2 (-4) elements
#include <cassert>
#include <iostream>
#include "CoinError.hpp"
#include "OsiCuts.hpp"
#include "OsiClpSolverInterface.hpp"
#include "CglCutGenerator.hpp"
#include "CglGomory.hpp"
#include "CglProbing.hpp"
#include "CglKnapsackCover.hpp"
#include "CglOddHole.hpp"
#include "CglClique.hpp"
#include "CglFlowCover.hpp"
#include "CglMixedIntegerRounding.hpp"
#include "CglTwomir.hpp"
#include "CbcModel.hpp"
#include "CbcHeuristic.hpp"
using std::cerr;
using std::cout;
using std::endl;
/* problem status */
#define LpStatusNotSolved 0
#define LpStatusOptimal 1
#define LpStatusInfeasible -1
#define LpStatusUnbounded -2
#define LpStatusUndefined -3
int main(int argc, const char *argv[])
{
int pulp_status;
int presolve = 0, dual = 0, scale = 1, crash = 0, mip =
1,
strong = 5, cuts = 1, integerPresolve =
1, rounding = 0;
try
{
OsiClpSolverInterface solver1;
CbcModel model(solver1);
model.solver()->readMps("test.mps.gz","mps");
model.solver()->messageHandler()->setLogLevel(1);
model.messageHandler()->setLogLevel(1);
if (presolve)
model.solver()->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry);
if (dual)
model.solver()->setHintParam(OsiDoDualInInitial,true,OsiHintTry);
if (!scale)
model.solver()->setHintParam(OsiDoScale,false,OsiHintTry);
if (crash)
model.solver()->setHintParam(OsiDoCrash,true,OsiHintTry);
model.initialSolve();
if (model.solver()->isProvenOptimal())
pulp_status =
LpStatusOptimal;
else if
(model.solver()->isProvenPrimalInfeasible())
pulp_status =
LpStatusInfeasible;
else if
(model.solver()->isProvenDualInfeasible())
pulp_status =
LpStatusUnbounded;
else
pulp_status =
LpStatusUndefined;
if (pulp_status == LpStatusOptimal &&
mip)
{
model.solver()->messageHandler()->setLogLevel(-1);
model.setNumberStrong(strong);
/* Cuts */
CglGomory gomory;
CglProbing probing;
probing.setUsingObjective(true);
probing.setMaxPass(3);
probing.setMaxProbe(100);
probing.setMaxLook(50);
probing.setRowCuts(3);
CglKnapsackCover
knapsackCover;
CglOddHole oddHole;
oddHole.setMinimumViolation(0.005);
oddHole.setMinimumViolationPer(0.0002);
oddHole.setMaximumEntries(100);
if (cuts)
{
model.addCutGenerator(&gomory,-1,"Gomory");
model.addCutGenerator(&probing,-1,"Probing");
model.addCutGenerator(&knapsackCover,-1,"Knapsack");
model.addCutGenerator(&oddHole,-1,"OddHole");
}
if (integerPresolve)
{
CbcModel
*model2 = model.integerPresolve();
if
(model2)
{
/* Rounding */
CbcRounding heuristic(*model2);
if (rounding)
model2->addHeuristic(&heuristic);
model2->branchAndBound();
model.originalModel(model2,false);
}
else
pulp_status = LpStatusInfeasible;
}
else
{
/*
Rounding */
CbcRounding heuristic(model);
if
(rounding)
model.addHeuristic(&heuristic);
model.branchAndBound();
}
}
}
catch ( CoinError e )
{
cout <<e.className() <<"::" <<e.methodName() <<" - " <<e.message()
<<endl;
}
return 0;
}
_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20050104/d393cebc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.mps.gz
Type: application/octet-stream
Size: 3913 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20050104/d393cebc/attachment.obj>
More information about the Clp
mailing list