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 13, 2023
2 parents ffa1a8d + 59093d2 commit 15fefbc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Fixed bugs
- disable heuristics before and during presolving in benders decomposition to avoid messing up the objective structure in the solution store by dropping auxiliary variables in the required retransformations
- correct local flag of singleton conflict constraints in tightenSingleVar() against invalid bound globalization
- respect unboundedness in the computation of activity bounds in conflict.c to avoid invalid huge bounds due to small coefficients on unbounded variables
- ensure positive sides of a linear constraint when recognizing a set partition in rangedRowSimplify() to account for redundancy issues

@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 @@ -476,6 +476,7 @@ set(pairs_Issue
"instances/Issue/3625.lp\;117.75284354701\;default"
# Test currently not working since problems with the feasibility check for unbounded problems appear: https://git.zib.de/integer/scip/-/issues/3422
# "instances/Issue/3629.cip\;-infinity\;only_dualinfer"
"instances/Issue/3632.cip\;0\;default"
)

#
Expand Down
15 changes: 15 additions & 0 deletions check/instances/Issue/3632.cip
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
STATISTICS
Problem name : mod011
Variables : 4 (3 binary, 0 integer, 0 implicit integer, 1 continuous)
Constraints : 0 initial, 2 maximal
OBJECTIVE
Sense : minimize
VARIABLES
[binary] <x1>: obj=1, original bounds=[0,1]
[binary] <x2>: obj=1, original bounds=[0,1]
[binary] <x3>: obj=1, original bounds=[0,1]
[continuous] <x10269>: obj=0, original bounds=[0,+inf]
CONSTRAINTS
[linear] <c154>: <x10269>[C] == 94;
[linear] <c2>: 0 <= <x1>[B] +<x2>[B] +<x3>[B] <= 1;
END
24 changes: 14 additions & 10 deletions src/scip/cons_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -11424,11 +11424,10 @@ SCIP_DECL_SORTINDCOMP(consdataCompSim)
return (value > 0 ? +1 : (value < 0 ? -1 : 0));
}

/** tries to simplify coefficients and delete variables in ranged row of the form lhs <= a^Tx <= rhs, e.g. using the greatest
* common divisor
/** tries to simplify coefficients in ranged row of the form lhs <= a^Tx <= rhs
*
* 1. lhs <= a^Tx <= rhs, forall a_i >= lhs, a_i <= rhs, and forall pairs a_i + a_j > rhs then we can change this
* constraint to 1^Tx = 1
* 1. lhs <= a^Tx <= rhs, x binary, lhs > 0, forall a_i >= lhs, a_i <= rhs, and forall pairs a_i + a_j > rhs,
* then we can change this constraint to 1^Tx = 1
*/
static
SCIP_RETCODE rangedRowSimplify(
Expand Down Expand Up @@ -11465,16 +11464,21 @@ SCIP_RETCODE rangedRowSimplify(
if( nvars < 2 )
return SCIP_OKAY;

lhs = consdata->lhs;
rhs = consdata->rhs;
assert(!SCIPisInfinity(scip, -lhs));
assert(!SCIPisInfinity(scip, rhs));
assert(!SCIPisNegative(scip, rhs));

/* sides must be positive to detect set partition */
if( !SCIPisPositive(scip, lhs) || !SCIPisPositive(scip, rhs) )
return SCIP_OKAY;

vals = consdata->vals;
vars = consdata->vars;
assert(vars != NULL);
assert(vals != NULL);

lhs = consdata->lhs;
rhs = consdata->rhs;
assert(!SCIPisInfinity(scip, -lhs) && !SCIPisInfinity(scip, rhs));
assert(!SCIPisNegative(scip, rhs));

minval = SCIP_INVALID;
secondminval = SCIP_INVALID;
maxval = -SCIP_INVALID;
Expand Down Expand Up @@ -11504,7 +11508,7 @@ SCIP_RETCODE rangedRowSimplify(
if( SCIPisEQ(scip, minval, maxval) && SCIPisEQ(scip, lhs, rhs) )
return SCIP_OKAY;

/* check if we can and need to choose exactly one binary variable */
/* check if we can choose one and need to choose at most one binary variable */
if( SCIPisGE(scip, minval, lhs) && SCIPisLE(scip, maxval, rhs) && SCIPisGT(scip, minval + secondminval, rhs) )
{
/* change all coefficients to 1.0 */
Expand Down

0 comments on commit 15fefbc

Please sign in to comment.