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

Handle dual infeasible subproblem in DwBundleDual (Issue211) #271

Open
wants to merge 21 commits into
base: release-draft
Choose a base branch
from

Conversation

hideakiv
Copy link
Collaborator

The original implementation did not add cuts when at least one of the subproblems was dual infeasible. This is fixed to generate columns using extreme rays.

@hideakiv hideakiv changed the base branch from release to release-draft June 14, 2023 20:00
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: +48.82 🎉

Comparison is base (2c9b9e6) 11.88% compared to head (37e3daa) 60.70%.

Additional details and impacted files
@@                Coverage Diff                 @@
##           release-draft     #271       +/-   ##
==================================================
+ Coverage          11.88%   60.70%   +48.82%     
==================================================
  Files                 88      121       +33     
  Lines              10743    10213      -530     
==================================================
+ Hits                1277     6200     +4923     
+ Misses              9466     4013     -5453     
Impacted Files Coverage Δ
src/DspConfig.h 100.00% <ø> (+100.00%) ⬆️
src/Solver/DantzigWolfe/DwBundleDual.cpp 71.42% <ø> (+71.42%) ⬆️
src/Solver/DantzigWolfe/DwBundleDual.h 44.44% <ø> (+44.44%) ⬆️
src/Solver/DantzigWolfe/DwMaster.cpp 36.39% <ø> (+36.39%) ⬆️
src/Solver/DantzigWolfe/DwMaster.h 40.00% <ø> (+40.00%) ⬆️
src/Solver/DantzigWolfe/DwWorker.cpp 78.57% <ø> (+78.57%) ⬆️
src/Solver/DualDecomp/DdDriverSerial.cpp 87.23% <ø> (+87.23%) ⬆️
src/Solver/DualDecomp/DdMW.h 33.33% <ø> (+33.33%) ⬆️
src/Solver/DualDecomp/DdMasterTr.cpp 71.57% <ø> (+71.57%) ⬆️
src/Solver/DualDecomp/DdWorkerUB.cpp 80.95% <ø> (+80.95%) ⬆️
... and 3 more

... and 99 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hideakiv hideakiv marked this pull request as ready for review June 27, 2023 07:03
// // sind or s ???
// DSPdebugMessage("updated obj coefficient s: %d, sind: %d, coeff: %f\n", s, sind, osi_->si_->getObjCoefficients()[sind]);
// }
if (osi_->si_->getColLower()[sind] == 0.0 && osi_->si_->getColUpper()[sind] == 0.0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps there is a better way to check whether the bound has been updated or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create variables that raises flags

@hideakiv hideakiv linked an issue Jun 29, 2023 that may be closed by this pull request
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #269

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #269. Also #277. BIGNUM=1e+100 was sufficient to fix the issue.

examples/cpp/farmer_dec.cpp Outdated Show resolved Hide resolved
examples/mps-dec/farmer.dec Outdated Show resolved Hide resolved
examples/mps-dec/farmer.mps Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@hideakiv hideakiv Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to go through the math formulations together.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, columns were generated only when all the subproblems were not dual infeasible. The code was changed to addCols for every iterations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add in-line descriptions to further explain this?

break;
case OsiGrb:
// rays = osi_[s]->getUnbdRay();
throw CoinError("getPrimalRays not implemented in Gurobi.", "DwWorker", "DwWorker.cpp");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When throwing the error, does the code print out the message that describes the solution status? If not, please add the proper message to explain the solution status.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Encountered unbounded subproblem. getPrimalRays not implemented in Gurobi."

rays = osi_[s]->getUnbdRay();
break;
case OsiGrb:
// rays = osi_[s]->getUnbdRay();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out? This was implemented in this PR.

@@ -207,6 +207,14 @@ class DspOsiCpx : public DspOsi {
CPXsetdblparam(cpx_->getEnvironmentPtr(), CPX_PARAM_EPGAP, CoinMax(0.0, CoinMin(1.0, tol)));
}

/** return unbounded ray */
virtual std::vector< double * > getUnbdRay() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we switch to LP here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a description of initial solve: CPLEX Error 1254

@hideakiv hideakiv changed the title Issue211 Handle dual infeasible subproblem in DwBundleDual (Issue211) Jul 13, 2023
@hideakiv
Copy link
Collaborator Author

Fail at cpx_dw_noswot and cpx_dw_dec_farmer. It works on my local machine using Gurobi and the server using CPLEX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unbounded subproblems for general decomposition problem with dw
3 participants