Skip to content

Commit 28e5278

Browse files
committed
Merge branch 'return-benders-solution' into 'master'
Adds relaxator for applying Benders' decomposition using a supplied decomposition structure (such as through a DEC file) See merge request integer/scip!3774
2 parents 6689ae9 + 7cc235d commit 28e5278

29 files changed

+26926
-321
lines changed

CHANGELOG

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Features
2828
- added decomposition kernel search (DKS) heuristic (disabled by default). This heuristic implements a kernel search framework and can be used
2929
both as a construction heuristic as well as an improvement heuristic. In addition, existing decomposition information can be utilized by this heuristic.
3030
- symmetry detection does not treat implicit integer variables separately anymore, but computes symmetries based on the variable type inferred from variable bounds and implied integrality
31+
- when solving a SCIP problem with additional decomposition information (for example, when reading a DEC file) and enabling decomposition/applybenders,
32+
the problem is now solved in a Benders' decomposition relaxator; instead of decomposing the original SCIP instance, the relaxator builds the decomposed problem in
33+
sub-SCIPs and solves it via default Benders' Decomposition; a solution to the original (undecomposed) problem is now made available by the relaxator;
34+
the SCIP shell dialog "display statistics" now also prints the statistics from solving the Benders' decomposition in the relaxator
3135

3236
Performance improvements
3337
------------------------
@@ -87,6 +91,8 @@ Interface changes
8791
- SCIPexprSetIntegrality(): set argument generalized from SCIP_Bool integral to SCIP_IMPLINTTYPE integrality (4th position)
8892
- Temporarily for SCIP 10 only: Creating a variable SCIPcreateVar() with type SCIP_VARTYPE_IMPLINT creates a variable of type SCIP_VARTYPE_CONTINUOUS and implied integral type SCIP_IMPLINTTYPE_WEAK instead
8993
- Temporarily for SCIP 10 only: SCIPchgVarType() converts a call with type SCIP_VARTYPE_IMPLINT into a call of SCIPchgVarImplType() with type SCIP_IMPLINTTYPE_WEAK
94+
- SCIPapplyBendersDecomposition has been removed. This was originally used to apply Benders' decomposition from a
95+
supplied decomposition structure. The application of Benders' decomposition now occurs in benders_relax.
9096

9197
### New API functions
9298

@@ -127,6 +133,8 @@ Interface changes
127133
- added SCIPvarsCountTypes() to determine the variable type count distribution for an array of variables
128134
- added SCIPeventGetOldImplType() and SCIPeventGetNewImplType() to query the new event SCIP_EVENTTYPE_IMPLTYPECHANGED
129135
- added SCIPexprGetIntegrality(), which in addition to the existing function SCIPexprIsIntegral() provides information about the presence of weakly implied integral variables
136+
- added SCIPincludeRelaxBenders(), which is used to include the Benders' decomposition relaxator.
137+
- added SCIPgetMasterProblemRelaxBenders() for retrieving the master problem SCIP instance from the Benders' decomposition relaxator.
130138

131139
### Changes in preprocessor macros
132140

@@ -179,6 +187,11 @@ Interface changes
179187
"heuristics/dks/buckmaxgap", "heuristics/dks/maxlinkscore", "heuristics/dks/maxbuckfrac", "heuristics/dks/maxnodes",
180188
"heuristics/dks/usetwolevel", "heuristics/dks/usedecomp", "heuristics/dks/usebestsol", "heuristics/dks/redcostsort", "heuristics/dks/primalonly",
181189
"heuristics/dks/redcostlogsort", "heuristics/dks/objcutoff", and "heuristics/dks/runbinprobsonly" to control heuristic decomposition kernel search
190+
- new parameters "relaxing/benders/continueorig" and "relaxing/benders/nodelimit" for controlling the behaviour of the
191+
Benders' decomposition relaxator. The "continueorig" parameter indicates whether the original problem should continue
192+
solving after the completion of the Benders' decomposition algorithm if the problem is not solved to optimality. The
193+
"nodelimit" parameter allows the user to provide a node limit for the Benders' decomposition master problem (by
194+
default the limits from the original SCIP instance are copied to the master problem).
182195

183196
### Data structures
184197

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ SCIPPLUGINLIBOBJ= scip/benders_default.o \
878878
scip/reader_tim.o \
879879
scip/reader_wbo.o \
880880
scip/reader_zpl.o \
881+
scip/relax_benders.o \
881882
scip/sepa_aggregation.o \
882883
scip/sepa_cgmip.o \
883884
scip/sepa_clique.o \

check/CMakeLists.txt

+17-5
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ set(settings_BendersQP
187187
"benders-qp"
188188
)
189189

190+
set(settings_BendersDec
191+
"usebenders-dec"
192+
)
193+
190194
set(settings_Decomp
191195
"decompheurs"
192196
"decompheurs_dps"
@@ -483,9 +487,16 @@ set(instances_BendersLB
483487
)
484488

485489
set(instances_BendersQP
486-
"instances/Benders/classical_20_0.mps\;instances/Benders/classical_20.dec\;-8.22960761981176e-02"
487-
"instances/Benders/classical_30_0.mps\;instances/Benders/classical_30.dec\;-7.98150796362468e-02"
488-
"instances/Benders/classical_30_15.mps\;instances/Benders/classical_30.dec\;-7.34740783553289e-02"
490+
"instances/Benders/classical_20_0.mps\;instances/Benders/classical_20.dec\;-8.22958452550615e-02"
491+
"instances/Benders/classical_30_0.mps\;instances/Benders/classical_30.dec\;-7.98149452840201e-02"
492+
"instances/Benders/classical_30_15.mps\;instances/Benders/classical_30.dec\;-7.34739274330805e-02"
493+
)
494+
495+
set(instances_BendersDec
496+
"instances/Benders/cap41.lp\;instances/Benders/cap41.dec\;+1.24518068000000e+06"
497+
"instances/Benders/cap42.lp\;instances/Benders/cap42.dec\;+1.31282733250000e+06"
498+
"instances/Benders/cap43.lp\;instances/Benders/cap43.dec\;+1.37782733250000e+06"
499+
"instances/Benders/cap44.lp\;instances/Benders/cap44.dec\;+1.47532733250000e+06"
489500
)
490501

491502
set(instances_Decomp
@@ -667,7 +678,7 @@ if((${TEST_BENDERSQP} AND (NOT ${LPS} STREQUAL "msk" )) OR (NOT ${prefix} STREQU
667678
#
668679
# treat the instance as a tuple (list) of two values
669680
#
670-
if(NOT ((${basename} STREQUAL "classical_30_0.mps") AND (${LPS} STREQUAL "grb")))
681+
if(NOT ((${basename} STREQUAL "classical_30_0.mps") AND ((${LPS} STREQUAL "grb") OR (${LPS} STREQUAL "cpx"))))
671682
add_test(NAME ${prefix}-${setting}-${basename}
672683
COMMAND $<TARGET_FILE:scip> -c "set load ${PROJECT_SOURCE_DIR}/check/coverage/settings/${setting}.set read ${PROJECT_SOURCE_DIR}/check/${instpath} read ${PROJECT_SOURCE_DIR}/check/${decpath} opt validatesol ${optval} ${optval} q"
673684
)
@@ -677,7 +688,7 @@ if((${TEST_BENDERSQP} AND (NOT ${LPS} STREQUAL "msk" )) OR (NOT ${prefix} STREQU
677688
FAIL_REGULAR_EXPRESSION "ERROR|user parameter file <${PROJECT_SOURCE_DIR}/check/coverage/settings/${setting}.set> not found"
678689
DEPENDS scip-build
679690
)
680-
endif() # separation does not converge, #3724 (LPS=grb, BendersQP-benders-qp-classical_30_0.mps)
691+
endif() # separation does not converge, #3724 (LPS=grb or LPS=cpx, BendersQP-benders-qp-classical_30_0.mps)
681692
endforeach(setting)
682693
endforeach(instance)
683694
endif()
@@ -729,6 +740,7 @@ add_instancetests(instances_Benders settings_Benders "Benders")
729740
add_instancetests(instances_Or settings_Or "Or")
730741
add_instancetests(instances_BendersLB settings_BendersLB "BendersLB")
731742
add_decompinstancetests(instances_BendersQP settings_BendersQP "BendersQP")
743+
add_decompinstancetests(instances_BendersDec settings_BendersDec "BendersDec")
732744
add_decompinstancetests(instances_Decomp settings_Decomp "Decomp")
733745
add_pairtests(pairs_Issue "Issue")
734746

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SCIP version 10.0.0
2+
3+
# should the variables be labelled for the application of Benders' decomposition?
4+
# [type: bool, advanced: FALSE, range: {TRUE,FALSE}, default: FALSE]
5+
decomposition/benderslabels = TRUE
6+
7+
# if a decomposition exists, should Benders' decomposition be applied?
8+
# [type: bool, advanced: FALSE, range: {TRUE,FALSE}, default: FALSE]
9+
decomposition/applybenders = TRUE
10+
11+
# frequency for calling primal heuristic <alns> (-1: never, 0: only at depth freqofs)
12+
# [type: int, advanced: FALSE, range: [-1,65534], default: 20]
13+
heuristics/alns/freq = -1
14+
15+
# frequency for calling primal heuristic <rens> (-1: never, 0: only at depth freqofs)
16+
# [type: int, advanced: FALSE, range: [-1,65534], default: 0]
17+
heuristics/rens/freq = -1
18+
19+
# should Benders' decomposition be used in LNS heurisics?
20+
# [type: bool, advanced: FALSE, range: {TRUE,FALSE}, default: TRUE]
21+
benders/default/lnscheck = FALSE

0 commit comments

Comments
 (0)