From 8074f2534a270532ea5e14972fc3d22d852744ff Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Sat, 11 Feb 2023 23:15:58 -0600 Subject: [PATCH 1/8] set DEPEND_DIR as CMAKE_BINARY_DIR --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7abb76c2..bc9d57c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) include(color_scheme.cmake) include(UserConfig.cmake) -set(DEPEND_DIR $ENV{PWD}) +set(DEPEND_DIR ${CMAKE_BINARY_DIR}) message(STATUS "The system information: ${CMAKE_SYSTEM}.${CMAKE_SYSTEM_PROCESSOR}") From 79b4c13783e6175bf9e51975c35d9ca3465097d6 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Sat, 11 Feb 2023 23:16:22 -0600 Subject: [PATCH 2/8] added back tests wit noswot --- test/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0b5191d1..8f72d9a7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,7 +3,7 @@ if(SCIPLIB) add_test(NAME scip_bd_sslp COMMAND $ENV{PWD}/src/runDsp --algo bd --smps ${CMAKE_SOURCE_DIR}/examples/smps/sslp_5_25_50 --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -121.6) add_test(NAME scip_dd_farmer COMMAND $ENV{PWD}/src/runDsp --algo dd --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -108389.9994043) add_test(NAME scip_de_farmer COMMAND $ENV{PWD}/src/runDsp --algo de --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -108389.9994043) - # add_test(NAME scip_de_noswot COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -42) + add_test(NAME scip_de_noswot COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -41) add_test(NAME scip_drbd_drslp COMMAND $ENV{PWD}/src/runDsp --algo drbd --smps ${CMAKE_SOURCE_DIR}/examples/dro/drslp_5_5_5_5 --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test 5.60247) add_test(NAME scip_drbd_farmer COMMAND $ENV{PWD}/src/runDsp --algo drbd --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --wassnorm 2 --wasseps 0.1 --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -108354) add_test(NAME scip_drbd_sslp_BB COMMAND $ENV{PWD}/src/runDsp --algo drbd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_BB --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -98.0703) @@ -29,8 +29,8 @@ if(CPLEXLIB) add_test(NAME cpx_drdd_sslp_BC COMMAND $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_BC --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -98.0705) add_test(NAME cpx_drdd_sslp_CC COMMAND $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -194.811) add_test(NAME cpx_dw_farmer COMMAND $ENV{PWD}/src/runDsp --algo dw --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -108389.9994043) - # add_test(NAME cpx_de_noswot COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -42) - # add_test(NAME cpx_dw_noswot COMMAND $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -42) + add_test(NAME cpx_de_noswot COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -41) + add_test(NAME cpx_dw_noswot COMMAND $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -41) endif(CPLEXLIB) if(GUROBILIB) @@ -42,8 +42,8 @@ if(GUROBILIB) add_test(NAME grb_drdd_sslp_BC COMMAND $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_BC --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -98.0705) add_test(NAME grb_drdd_sslp_CC COMMAND $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -194.811) add_test(NAME grb_dw_farmer COMMAND $ENV{PWD}/src/runDsp --algo dw --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -108389.9994043) - # add_test(NAME grb_noswot_de COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -42) - # add_test(NAME grb_noswot_dw COMMAND $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -42) + add_test(NAME grb_noswot_de COMMAND $ENV{PWD}/src/runDsp --algo de --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -41) + add_test(NAME grb_noswot_dw COMMAND $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -41) endif(GUROBILIB) if (MPI_CXX_FOUND) @@ -63,7 +63,7 @@ if (MPI_CXX_FOUND) # add_test(NAME scip_drbd_mpi_sslp_CC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drbd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -194.836) add_test(NAME scip_drdd_mpi_sslp_CC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -194.811) add_test(NAME scip_dw_mpi_farmer COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -108389.9994043) - # add_test(NAME scip_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -42) + add_test(NAME scip_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_scip.txt --test -41) if(MA27LIB) add_test(NAME ooqp_dd_mpi_farmer COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dd --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_ooqp.txt --test -108389.9994043) add_test(NAME ooqp_dd_mpi_farmer_async COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dd --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_async_dd.txt --test -108389.9994043) @@ -78,7 +78,7 @@ if (MPI_CXX_FOUND) add_test(NAME cpx_drdd_mpi_sslp_BC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_BC --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -98.0705) add_test(NAME cpx_drdd_mpi_sslp_CC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -194.811) add_test(NAME cpx_dw_mpi_farmer COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -108389.9994043) - # add_test(NAME cpx_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -42) + add_test(NAME cpx_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_cpx.txt --test -41) endif(CPLEXLIB) if(GUROBILIB) @@ -89,7 +89,7 @@ if (MPI_CXX_FOUND) add_test(NAME grb_drdd_mpi_sslp_BC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_BC --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -98.0705) add_test(NAME grb_drdd_mpi_sslp_CC COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo drdd --smps ${CMAKE_SOURCE_DIR}/examples/dro/sslp_5_25_15_CC --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -194.811) add_test(NAME grb_dw_mpi_farmer COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --smps ${CMAKE_SOURCE_DIR}/examples/smps/farmer --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -108389.9994043) - # add_test(NAME grb_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -42) + add_test(NAME grb_dw_mpi_noswot COMMAND mpiexec -np 3 $ENV{PWD}/src/runDsp --algo dw --mps ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.mps --dec ${CMAKE_SOURCE_DIR}/examples/mps-dec/noswot.dec --param ${CMAKE_SOURCE_DIR}/test/params_grb.txt --test -41) endif(GUROBILIB) endif(MPI_CXX_FOUND) \ No newline at end of file From 38ba944df408458e7b30c77348b742d6632d5ca2 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Sat, 11 Feb 2023 23:16:31 -0600 Subject: [PATCH 3/8] bump version --- src/DspConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DspConfig.h b/src/DspConfig.h index 8ecba478..c6e36814 100644 --- a/src/DspConfig.h +++ b/src/DspConfig.h @@ -6,7 +6,7 @@ */ #define DSP_VERSION_MAJOR 1 #define DSP_VERSION_MINOR 5 -#define DSP_VERSION_PATCH 2 +#define DSP_VERSION_PATCH 3 #include From c6985ae4e993821e84ea4ec2bf782f2f1d057f66 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Fri, 17 Feb 2023 17:19:18 -0600 Subject: [PATCH 4/8] added documents --- src/Solver/DantzigWolfe/DwBundleDual.h | 80 +++++++++++++++++++++++--- src/Solver/DantzigWolfe/DwMaster.h | 26 ++++++++- 2 files changed, 97 insertions(+), 9 deletions(-) diff --git a/src/Solver/DantzigWolfe/DwBundleDual.h b/src/Solver/DantzigWolfe/DwBundleDual.h index 730a730e..2011b94f 100644 --- a/src/Solver/DantzigWolfe/DwBundleDual.h +++ b/src/Solver/DantzigWolfe/DwBundleDual.h @@ -13,6 +13,10 @@ #include #include "Solver/DantzigWolfe/DwMaster.h" +/** + * @brief This implements a bundle method for solving the master problem. + * + */ class DwBundleDual: public DwMaster { public: /** constructor with worker */ @@ -31,7 +35,22 @@ class DwBundleDual: public DwMaster { /** default destructor */ virtual ~DwBundleDual(); - /** solve */ + /** + * @brief This function solves the master problem by using a bundle method. + * + * This initializes the best dual solution, the dual solution, and the proximal center in the + * quadratic objective function of the dual problem. + * + * This calls DwMaster::generateCols() to generate a set of initial columns. These are added as columns + * to the primal problem, but added as rows to the dual problem. DwMaster::generateCols() calls + * addCols(), the implementation of which (i.e., DwBundleDual::addCols()) in this class calls + * DwBundleDual::addRows(), where the columns are added to the primal problem object and the rows are + * added to the dual proble object. + * + * After adding the initial rows/columns, DwMaster::gutsOfSolver() is called. + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE solve(); /** get best dual objective */ @@ -45,13 +64,29 @@ class DwBundleDual: public DwMaster { protected: - /** This creates a master problem. */ + /** + * @brief This overwrites DwMaster::createProblem() and creates the primal and dual problem objects. + * + * This creates the primal and dual problem objects and sets the column bounds for the current node + * subproblem. phase_ is always set to 2, because the Bundle method does not consider two phases. + * The best dual objective value is initialized to COIN_DBL_MAX; + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE createProblem(); /** Update the proximal bundle center */ virtual DSP_RTN_CODE updateCenter(double penalty); - /** solver master */ + /** + * @brief This solves the master problems in both primal and dual. + * + * This function is called from DwMaster::gutsOfSolve(). The dual problem is solved first. If the solution + * status is either optimal or feasible, this function updates the bundle parameters and solves the primal + * problem. + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE solveMaster(); /** update master */ @@ -85,17 +120,41 @@ class DwBundleDual: public DwMaster { std::vector& objs, /**< [in] subproblem objective values */ std::vector& sols /**< [in] subproblem solutions */); - /** Calculate Lagrangian bound */ + /** + * @brief This computes the Lagrangian dual bound. + * + * The sign of the Lagrangian dual bound is same as the original objective function. + */ virtual DSP_RTN_CODE getLagrangianBound( std::vector& objs /**< [in] subproblem objective values */); /** print iteration information */ virtual void printIterInfo(); - /** create primal master problem */ + /** + * @brief This creates a primal (minimization) problem object. + * + * The primal problem is the restricted master problem of Dantzig-Wolfe decomposition. + * The problem consists of two sets of constraints. + * The first set of constraints are reserved (empty initially) to represents the convex + * combination of columns generated in this method. The other constraints are reserved to + * represent the original constraints of the master block. The solver interface is created. + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE createPrimalProblem(); - /** create dual master problem */ + /** + * @brief This creates a dual (maximization) problem object. + * + * The problem is initialized with (i) the auxiliary variables to represent the upper approximation + * of the blocks and (ii) the variables to represent the Lagrangian multipliers of the master block + * constraints. The quadratic objective function is created for the proximal term with weight u_; + * + * The problem is minimized with the negated objective function. + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE createDualProblem(); typedef std::pair pairIntDbl; @@ -136,7 +195,14 @@ class DwBundleDual: public DwMaster { std::vector& rlbd, std::vector& rubd); - /** call external solver for solveMaster() */ + /** + * @brief This solves the dual problem and returns a status. + * + * If CPLEX is used as external solver, extra effort is made when the problem suffers from + * issues in numerical stability. + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE callMasterSolver(); /** assign master solution */ diff --git a/src/Solver/DantzigWolfe/DwMaster.h b/src/Solver/DantzigWolfe/DwMaster.h index c6fdaac0..001281a4 100644 --- a/src/Solver/DantzigWolfe/DwMaster.h +++ b/src/Solver/DantzigWolfe/DwMaster.h @@ -54,7 +54,22 @@ class DwMaster: public DecSolver { /** default destructor */ virtual ~DwMaster(); - /** initialize */ + /** + * @brief This creates the master problem for stochastic structure and general structure. + * + * This function creates the master problem data structure and calls createProblem() to create and initialize + * the master problem object. + * + * For stochastic program, the problem data is obtained from the full model (i.e., the deterministic equivalent problem). + * The dimension of the constraint matrix is S * (n_1 + n_2), where S is the number of scenarios, n_1 + * is the number of first-stage variables, and n_2 is the number of second-stage variables. + * The constraint matrix consists of the non-anticipativity constraints of the form: + * x_1 - x_2 = 0, x_2 - x_3 = 0, and x_3 - x_1 = 0. + * + * For a general structure, this function stores the master block data, which can be obtained as the + * master problem ofthe Benders decomposition without the axiliary variable of representing the reoucrse + * function. This calls createProblem() to create and initialize the master problem. + */ virtual DSP_RTN_CODE init(); /** solve */ @@ -95,7 +110,14 @@ class DwMaster: public DecSolver { /** solve phase 2 */ virtual DSP_RTN_CODE solvePhase2(); - /** guts of solve */ + /** + * @brief This implements the core of the DW method. + * + * This repeats a sequence of function calls: solveMaster(), reduceCols(), restoreCols(), + * generateCols(), generateColsByFix(), and updateModel(). + * + * @return DSP_RTN_CODE + */ virtual DSP_RTN_CODE gutsOfSolve(); /** solver master */ From c401ea7abcb6d7b01d2608bc7e2e6c28ae3d3319 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Fri, 17 Feb 2023 17:19:34 -0600 Subject: [PATCH 5/8] cleanup --- src/Solver/DantzigWolfe/DwMaster.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Solver/DantzigWolfe/DwMaster.cpp b/src/Solver/DantzigWolfe/DwMaster.cpp index 92db446c..7effb093 100644 --- a/src/Solver/DantzigWolfe/DwMaster.cpp +++ b/src/Solver/DantzigWolfe/DwMaster.cpp @@ -172,10 +172,12 @@ DSP_RTN_CODE DwMaster::init() { int nscen = tss->getNumScenarios(); int ncols_first_stage = tss->getNumCols(0); - int ncols = org_mat->getNumCols() + ncols_first_stage * (nscen - 1); const double* probability = tss->getProbability(); - DSPdebugMessage("nscen %d ncols_first_stage %d ncols %d\n", nscen, ncols_first_stage, ncols); + // create a large matrix with S * (n_1 + n_2), where S is the number of scenarios, + // and n_1 and n_2 are the number of first- and second-stage variables, resp. + int ncols = org_mat->getNumCols() + ncols_first_stage * (nscen - 1); + DSPdebugMessage("nscen %d ncols_first_stage %d ncols %d\n", nscen, ncols_first_stage, ncols); mat_orig_ = new CoinPackedMatrix(org_mat->isColOrdered(), 0, 0); mat_orig_->setDimensions(0, ncols); @@ -223,7 +225,11 @@ DSP_RTN_CODE DwMaster::init() { std::fill(rlbd_orig_.begin(), rlbd_orig_.end(), 0.0); std::fill(rubd_orig_.begin(), rubd_orig_.end(), 0.0); } else { - /** retrieve the original master problem structure */ + /** Retrieve the original master problem structure: + * + * The master problem is same as the master of the Benders decomposition without the auxiliary varialbe + * of representing the recourse function. + */ model_->decompose(0, NULL, 0, NULL, NULL, NULL, mat_orig_, org_clbd, org_cubd, org_ctype, org_obj, org_rlbd, org_rubd); clbd_orig_.assign(org_clbd, org_clbd + mat_orig_->getNumCols()); From b55b4e698d4a59275be8c16c11f8aec8f274b2b9 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Fri, 17 Feb 2023 17:20:12 -0600 Subject: [PATCH 6/8] display message at termination --- src/Solver/DantzigWolfe/DwBundleDual.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Solver/DantzigWolfe/DwBundleDual.cpp b/src/Solver/DantzigWolfe/DwBundleDual.cpp index f6cd6df4..cf450582 100644 --- a/src/Solver/DantzigWolfe/DwBundleDual.cpp +++ b/src/Solver/DantzigWolfe/DwBundleDual.cpp @@ -568,11 +568,15 @@ bool DwBundleDual::terminationTest() { return true; } - if (primobj_ < 1.0e+20 && getRelApproxGap() <= par_->getDblParam("DW/GAPTOL")) + if (primobj_ < 1.0e+20 && getRelApproxGap() <= par_->getDblParam("DW/GAPTOL")) { + message_->print(3, "Terminated due to primobj (%e) < 1e+20 and relative gap (%e) <= tolerance (%e)\n", primobj_, getRelApproxGap(), par_->getDblParam("DW/GAPTOL")); return true; + } - if (primobj_ < 1.0e+20 && v_ >= -par_->getDblParam("DW/MIN_INCREASE")) + if (primobj_ < 1.0e+20 && v_ >= -par_->getDblParam("DW/MIN_INCREASE")) { + message_->print(3, "Terminated due to primobj (%e) < 1e+20 and predicted increase (%e) <= minimum increase (%e)\n", primobj_, v_, par_->getDblParam("DW/MIN_INCREASE")); return true; + } if (iterlim_ <= itercnt_) { message_->print(3, "Warning: Iteration limit reached.\n"); From dc18da4cde2d9240e56d5469575ba6573adb2c96 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Fri, 17 Feb 2023 17:20:40 -0600 Subject: [PATCH 7/8] add a comment --- src/Solver/DantzigWolfe/DwBundleDual.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Solver/DantzigWolfe/DwBundleDual.cpp b/src/Solver/DantzigWolfe/DwBundleDual.cpp index cf450582..1d4fa876 100644 --- a/src/Solver/DantzigWolfe/DwBundleDual.cpp +++ b/src/Solver/DantzigWolfe/DwBundleDual.cpp @@ -208,8 +208,10 @@ void DwBundleDual::initDualSolver( /** load problem data */ if (rlbd.size() == 0) getSiPtr()->loadProblem(m, &clbd[0], &cubd[0], &obj[0], NULL, NULL); - else + else { + // TODO: When do we need rlbd and rubd? getSiPtr()->loadProblem(m, &clbd[0], &cubd[0], &obj[0], &rlbd[0], &rubd[0]); + } END_TRY_CATCH(;) } From 8ecdfd465ed85b257f325bec83f8b7285b59f225 Mon Sep 17 00:00:00 2001 From: Kibaek Kim Date: Fri, 17 Feb 2023 17:20:55 -0600 Subject: [PATCH 8/8] added issue line --- src/dsp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dsp.cpp b/src/dsp.cpp index f42faf47..d4d0e924 100644 --- a/src/dsp.cpp +++ b/src/dsp.cpp @@ -522,6 +522,8 @@ int parseDecFile(char* decfile, vector >& rows_in_blocks) { rows_in_blocks[0].push_back(line); } } + + // TODO: #256 Check whether the decomposition results in coupling variables or not } else { printf("Cannot open file: %s\n", decfile); return 1;