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

reset Clp termination code to "time limit reached" when seeing "iteration limit reached" in dual simplex resolve #199

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/LP/lp_solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,12 @@ int initial_lp_solve (LPdata *lp_data, int *iterd)
}else if (si->isIterationLimitReached()){
term = LP_D_ITLIM;
#ifdef __OSI_CLP__
// YX: reset term if needed; Clp may return ITLIM at timeout
int itlim_chk = -1;
retval = si->getIntParam(OsiMaxNumIteration, itlim_chk);
if (si->getIterationCount() < itlim_chk){
term = LP_TIME_LIMIT;
}
/* If max iterations and had switched to primal, bound is no good */
if (si->getModelPtr()->secondaryStatus() == 10){
term = LP_ABANDONED;
Expand Down Expand Up @@ -2715,6 +2721,12 @@ int dual_simplex(LPdata *lp_data, int *iterd)
}else if (si->isIterationLimitReached()){
term = LP_D_ITLIM;
#ifdef __OSI_CLP__
// YX: reset term if needed; Clp may return ITLIM at timeout
int itlim_chk = -1;
retval = si->getIntParam(OsiMaxNumIteration, itlim_chk);
if (si->getIterationCount() < itlim_chk){
term = LP_TIME_LIMIT;
}
/* If max iterations and had switched to primal, bound is no good */
if (si->getModelPtr()->secondaryStatus() == 10){
term = LP_ABANDONED;
Expand Down Expand Up @@ -2819,9 +2831,17 @@ int solve_hotstart(LPdata *lp_data, int *iterd)
term = LP_D_OBJLIM;
else if (si->isProvenOptimal())
term = LP_OPTIMAL;
else if (si->isIterationLimitReached())
else if (si->isIterationLimitReached()){
term = LP_D_ITLIM;
else if (si->isAbandoned())
#ifdef __OSI_CLP__
// YX: reset term if needed; Clp may return ITLIM at timeout
int itlim_chk = -1;
retval = si->getIntParam(OsiMaxNumIteration, itlim_chk);
if (si->getIterationCount() < itlim_chk){
term = LP_TIME_LIMIT;
}
#endif
}else if (si->isAbandoned())
term = LP_ABANDONED;

/* if(term == D_UNBOUNDED){
Expand Down
Loading