[Coin-lpsolver] What is the best way of getting out N feasible extreme points?
Yiming Yao
yao3 at llnl.gov
Thu Aug 7 14:17:40 EDT 2003
John,
Thanks for your correction. I used
"model_->nonLinearCost()->numberInfeasibilities()==0" as feasibility check;
however I couldn't get any feasible extreme point (FEP) for a test LP of
size 57var x 145 constrs. This LP was solved to optimality. There must be
at least one FEP (there should a lot more) for the code to get by trapping
message 102 (CLP_SIMPLEX_HOUSE2) , which is generated every simplex iteration.
My intention is to get every FEP during a simplex process (Steps are
described below.)
Any suggestions?
Thanks,
Yiming
--------------------------------------------------------
Here's what I've done:
1. in ClpMessage.cpp, changed
{CLP_SIMPLEX_HOUSE2,102,4,"%d %g In: %c%d Out: %c%d%? dj ratio %g distance
%g%? dj %g distance %g"},
to
{CLP_SIMPLEX_HOUSE2,102,1,"%d %g In: %c%d Out: %c%d%? dj ratio %g distance
%g%? dj %g distance %g"},
2. Created MlpMessageHandler class by inheriting CoinMessageHandler in a
similar way as the MyMessageHandler class. The main method of this class
looks like the following (I also asked some questions as comments):
int
MlpMessageHandler::print()
{
if (currentSource()=="Clp") {
if (currentMessage().externalNumber()==102) {
// feasible?
if (model_->nonLinearCost()->numberInfeasibilities()==0) {
//compute objective value based on John Forrest's code
double objValue = computeObjValue(model_);
// Is the objective value within limit?
if( objValue > 0 && objValue <= artificialBound) { //
artificialBound is an input parameter
//twoLevelPtr points to my algorithm object.
twoLevelPtr->addCut(solution);
}
}
}
}
return CoinMessageHandler::print();
}
----------------------------
At 03:35 AM 8/7/2003 -0400, John J Forrest wrote:
>One problem may be that I got it all wrong and the test for feasibility is
>not correct. The correct test is
>
>model_->nonLinearCost()->numberInfeasibilites()==0
>
>with ClpNonLinearCost.hpp included.
>
>I will get round to tidying up code some time but hopefully that will work
>for now.
>
>John Forrest
More information about the Clp
mailing list