Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v80-bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed Oct 2, 2023
2 parents 8deaebe + e9e7cbb commit 9d3f901
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ Fixed bugs
- reject sub-solutions with invalid objectives in SCIPtranslateSubSols() due to contradicting infinite contributions
- correct column index in getMinMaxActivityResiduals() to make presolver dualinfer work
- copy quiet flag from main scip's message handler to the one of solverscip in concurrent optimization
- avoid bound tightening cycles towards huge redundancy bounds in fullDualPresolve() to avert fatal numerical trouble in representing vertices of linear relaxations with unbounded domains
- fix problem where debug solution did not work if branching constraints are present

@section RN804 SCIP 8.0.4
*************************
Expand Down
1 change: 1 addition & 0 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ set(pairs_Issue
"instances/Issue/3047.lp\;20000\;dualinfer"
"instances/Issue/3499.lp\;11460\;closeobj"
"instances/Issue/3589.cip\;-1\;default"
"instances/Issue/3607.cip\;1\;default"
"instances/Issue/3610.cip\;0\;default"
"instances/Issue/3611.lp\;-1600\;default"
)
Expand Down
20 changes: 20 additions & 0 deletions check/instances/Issue/3607.cip
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
STATISTICS
Problem name : PyomoModel
Variables : 6 (1 binary, 0 integer, 0 implicit integer, 5 continuous)
Constraints : 0 initial, 5 maximal
OBJECTIVE
Sense : maximize
VARIABLES
[binary] <x833>: obj=1, original bounds=[0,1]
[continuous] <x6519>: obj=0, original bounds=[-inf,+inf]
[continuous] <x244>: obj=0, original bounds=[0,+inf]
[continuous] <x242>: obj=0, original bounds=[0,+inf]
[continuous] <x6181>: obj=0, original bounds=[-inf,+inf]
[continuous] <x6525>: obj=0, original bounds=[-inf,+inf]
CONSTRAINTS
[linear] <c_u_x14366_>: <x242>[C] -123<x833>[B] == 0;
[linear] <c_e_x8809_>: +5.322<x244>[C] -<x6519>[C] == -1676.675;
[linear] <c_u_x7642_>: +3.565<x6181>[C] -<x6525>[C] <= 0;
[linear] <c_u_x8195_>: -10<x6181>[C] +<x6519>[C] <= 0;
[linear] <c_e_x8815_>: +9.49<x244>[C] +1.28<x242>[C] -<x6525>[C] == -1251.635;
END
20 changes: 12 additions & 8 deletions src/scip/cons_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -15045,14 +15045,16 @@ SCIP_RETCODE fullDualPresolve(

var = vars[v];
obj = SCIPvarGetObj(var);
if( obj >= 0.0 )
if( !SCIPisPositive(scip, -obj) )
{
/* making the variable as small as possible does not increase the objective:
* check if all down locks of the variables are due to linear constraints;
* if largest bound to make constraints redundant is -infinity, we better do nothing for numerical reasons
* if variable is cost neutral and only upper bounded non-positively or negative largest bound to make
* constraints redundant is huge, we better do nothing for numerical reasons
*/
if( SCIPvarGetNLocksDownType(var, SCIP_LOCKTYPE_MODEL) == nlocksdown[v]
&& !SCIPisInfinity(scip, -redlb[v])
if( ( SCIPisPositive(scip, obj) || SCIPisPositive(scip, SCIPvarGetUbGlobal(var)) || !SCIPisInfinity(scip, -SCIPvarGetLbGlobal(var)) )
&& SCIPvarGetNLocksDownType(var, SCIP_LOCKTYPE_MODEL) == nlocksdown[v]
&& !SCIPisHugeValue(scip, -redlb[v])
&& redlb[v] < SCIPvarGetUbGlobal(var) )
{
SCIP_Real ub;
Expand All @@ -15072,14 +15074,16 @@ SCIP_RETCODE fullDualPresolve(
(*nchgbds)++;
}
}
if( obj <= 0.0 )
if( !SCIPisPositive(scip, obj) )
{
/* making the variable as large as possible does not increase the objective:
* check if all up locks of the variables are due to linear constraints;
* if smallest bound to make constraints redundant is +infinity, we better do nothing for numerical reasons
* if variable is cost neutral and only lower bounded non-negatively or positive smallest bound to make
* constraints redundant is huge, we better do nothing for numerical reasons
*/
if( SCIPvarGetNLocksUpType(var, SCIP_LOCKTYPE_MODEL) == nlocksup[v]
&& !SCIPisInfinity(scip, redub[v])
if( ( SCIPisPositive(scip, -obj) || SCIPisPositive(scip, -SCIPvarGetLbGlobal(var)) || !SCIPisInfinity(scip, SCIPvarGetUbGlobal(var)) )
&& SCIPvarGetNLocksUpType(var, SCIP_LOCKTYPE_MODEL) == nlocksup[v]
&& !SCIPisHugeValue(scip, redub[v])
&& redub[v] > SCIPvarGetLbGlobal(var) )
{
SCIP_Real lb;
Expand Down
21 changes: 21 additions & 0 deletions src/scip/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,27 @@ SCIP_RETCODE isSolutionInNode(
}
}
}
if( *solcontained && SCIPnodeGetNAddedConss(node) > 0 )
{
int i;
int naddedcons = 0;
SCIP_CONS** addedcons;

SCIPsetAllocBufferArray(set, &addedcons, SCIPnodeGetNAddedConss(node));

SCIPnodeGetAddedConss(node, addedcons, &naddedcons, SCIPnodeGetNAddedConss(node));

for( i = 0; i < naddedcons && *solcontained; ++i )
{
SCIP_RESULT result = SCIP_FEASIBLE;
SCIP_CALL( SCIPcheckCons(set->scip, addedcons[i], debugsoldata->debugsol , TRUE, TRUE, FALSE, &result) );

if( result != SCIP_FEASIBLE )
*solcontained = FALSE;
}

SCIPsetFreeBufferArray(set, &addedcons);
}
}

/* remember the status of the current node */
Expand Down

0 comments on commit 9d3f901

Please sign in to comment.