Skip to content

Commit

Permalink
Fix unwanted behavior of CLP when we expect to do dual simplex
Browse files Browse the repository at this point in the history
CLP is hinted to go for dual simplex but it may still go for primal, giving wrong
results when in strong branching iteration limit is hit and primal has been done.
Moreover, when doing dual simplex, dual solutions may be inaccure at iteration limit.
To fix that, some options are set through Osi to make CLP behave as we expect.
  • Loading branch information
febattista committed Apr 1, 2024
1 parent c462607 commit 89754e7
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/LP/lp_solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2339,11 +2339,22 @@ void open_lp_solver(LPdata *lp_data)
lp_data->si->messageHandler()->setLogLevel(0);
#ifdef __OSI_CLP__
lp_data->si->setupForRepeatedUse();
//lp_data->si->setupForRepeatedUse(3,0);
//lp_data->si->getModelPtr()->setFactorizationFrequency(200);
//lp_data->si->getModelPtr()->setSparseFactorization(true);
//lp_data->si->getModelPtr()->setSpecialOptions(524288);
//lp_data->si->getModelPtr()->setSpecialOptions(4);
// feb223
int options = lp_data->si->getModelPtr()->specialOptions();
int moreOptions = lp_data->si->getModelPtr()->moreSpecialOptions();

options |= 32 // CLP creates ray while doing dual simplex
// + 2048 // CLP does not cruch the problem
// maybe not needed if we recompute dj's on fixed vars ???
+ 0x08000000; // CLP computes accurate duals on LP_D_ITLIM
moreOptions |= 8192; // CLP uses dual simplex if it has suggested to do so
lp_data->si->getModelPtr()->setSpecialOptions(options);
lp_data->si->getModelPtr()->setMoreSpecialOptions(moreOptions);
// lp_data->si->setupForRepeatedUse(3,0);
// lp_data->si->getModelPtr()->setFactorizationFrequency(200);
// lp_data->si->getModelPtr()->setSparseFactorization(true);
// lp_data->si->getModelPtr()->setSpecialOptions(524288);
// lp_data->si->getModelPtr()->setSpecialOptions(4);
lp_data->si->getModelPtr()->setPerturbation(50);
//set cleanup param if unscaled primal is infeasible
lp_data->si->setCleanupScaling(1);
Expand Down

0 comments on commit 89754e7

Please sign in to comment.