Skip to content

Commit 0eef1ba

Browse files
committed
Merge remote-tracking branch 'origin/v9-minor'
2 parents bd9fc05 + 0b2cdb7 commit 0eef1ba

File tree

4 files changed

+62
-62
lines changed

4 files changed

+62
-62
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ Fixed bugs
354354
- also for the initial LP solve force acceptance of Farkas row in SCIPlpGetDualfarkas() if all other means for obtaining a reliable Farkas proof have failed
355355
- avoid overwriting set cutoff flag in tightenCoefs(), preprocessConstraintPairs(), and applyFixings() of cons_varbound.c to reject infeasible solutions
356356
- fix memory leak in exprinterpret_cppad.cpp w.r.t. user expressions
357+
- adjust bound before checking feasibility in SCIPvarAddVlb() and SCIPvarAddVub() to detect integrality cutoff
357358

358359
Build system
359360
------------

check/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ set(pairs_Issue
562562
"instances/Issue/3920.cip\;0\;presolving_milp_off"
563563
"instances/Issue/3932.cip\;+infinity\;reduced_tolerance"
564564
"instances/Issue/3934.cip\;-5007\;conflict_off_reduced_presolving_subrestart"
565+
"instances/Issue/3935.cip\;-24793.9840277416\;default"
565566
)
566567

567568
#

check/instances/Issue/3935.cip

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
STATISTICS
2+
Problem name : small
3+
Variables : 5 (0 binary, 3 integer, 0 implicit integer, 2 continuous)
4+
Constraints : 0 initial, 3 maximal
5+
OBJECTIVE
6+
Sense : minimize
7+
VARIABLES
8+
[integer] <x0>: obj=88.47, original bounds=[-200,200]
9+
[integer] <x1>: obj=0, original bounds=[-200,200]
10+
[integer] <x4>: obj=81, original bounds=[-200,200]
11+
[continuous] <x3>: obj=12, original bounds=[-200,200]
12+
[continuous] <x2>: obj=78, original bounds=[-200,200]
13+
CONSTRAINTS
14+
[linear] <_C15>: -20.9<x0>[I] -3.19<x1>[I] -35.38<x4>[I] -93.68<x3>[C] +81.29<x2>[C] <= -2023.88;
15+
[linear] <_C16>: +86.76<x0>[I] -62.71<x1>[I] +52.33<x4>[I] -41.23<x3>[C] +78.43<x2>[C] >= -3046.83;
16+
[linear] <_C2>: -23.81<x0>[I] -7.03<x1>[I] +61.09<x4>[I] +87.2<x3>[C] -75.09<x2>[C] >= -1791.83;
17+
END

src/scip/var.c

Lines changed: 43 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15309,18 +15309,19 @@ SCIP_RETCODE SCIPvarAddVlb(
1530915309
/* the variable bound constraint defines a new upper bound */
1531015310
if( SCIPsetIsGT(set, vlbcoef, 1.0) )
1531115311
{
15312-
SCIP_Real newub = vlbconstant / (1.0 - vlbcoef);
15312+
/* bound might be adjusted due to integrality condition */
15313+
SCIP_Real newub = adjustedUb(set, SCIPvarIsIntegral(var), vlbconstant / (1.0 - vlbcoef));
1531315314

15315+
/* check bounds for feasibility */
1531415316
if( SCIPsetIsFeasLT(set, newub, lb) )
1531515317
{
1531615318
*infeasible = TRUE;
1531715319
return SCIP_OKAY;
1531815320
}
15319-
else if( SCIPsetIsFeasLT(set, newub, ub) )
15320-
{
15321-
/* bound might be adjusted due to integrality condition */
15322-
newub = adjustedUb(set, SCIPvarIsIntegral(var), newub);
1532315321

15322+
/* improve global upper bound of variable */
15323+
if( SCIPsetIsFeasLT(set, newub, ub) )
15324+
{
1532415325
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1532515326
* with the local bound, in this case we need to store the bound change as pending bound change
1532615327
*/
@@ -15345,22 +15346,21 @@ SCIP_RETCODE SCIPvarAddVlb(
1534515346
/* the variable bound constraint defines a new lower bound */
1534615347
else
1534715348
{
15348-
SCIP_Real newlb;
15349-
1535015349
assert(SCIPsetIsLT(set, vlbcoef, 1.0));
1535115350

15352-
newlb = vlbconstant / (1.0 - vlbcoef);
15351+
/* bound might be adjusted due to integrality condition */
15352+
SCIP_Real newlb = adjustedLb(set, SCIPvarIsIntegral(var), vlbconstant / (1.0 - vlbcoef));
1535315353

15354+
/* check bounds for feasibility */
1535415355
if( SCIPsetIsFeasGT(set, newlb, ub) )
1535515356
{
1535615357
*infeasible = TRUE;
1535715358
return SCIP_OKAY;
1535815359
}
15359-
else if( SCIPsetIsFeasGT(set, newlb, lb) )
15360-
{
15361-
/* bound might be adjusted due to integrality condition */
15362-
newlb = adjustedLb(set, SCIPvarIsIntegral(var), newlb);
1536315360

15361+
/* improve global lower bound of variable */
15362+
if( SCIPsetIsFeasGT(set, newlb, lb) )
15363+
{
1536415364
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1536515365
* with the local bound, in this case we need to store the bound change as pending bound change
1536615366
*/
@@ -15435,27 +15435,21 @@ SCIP_RETCODE SCIPvarAddVlb(
1543515435
/* improve global bounds of vlb variable, and calculate minimal and maximal value of variable bound */
1543615436
if( vlbcoef >= 0.0 )
1543715437
{
15438-
SCIP_Real newzub;
15439-
1544015438
if( !SCIPsetIsInfinity(set, xub) )
1544115439
{
1544215440
/* x >= b*z + d -> z <= (x-d)/b */
15443-
newzub = (xub - vlbconstant)/vlbcoef;
15444-
15445-
/* return if the new bound is less than -infinity */
15446-
if( SCIPsetIsInfinity(set, REALABS(newzub)) )
15447-
return SCIP_OKAY;
15441+
SCIP_Real newzub = adjustedUb(set, SCIPvarIsIntegral(vlbvar), (xub - vlbconstant) / vlbcoef);
1544815442

15443+
/* check bounds for feasibility */
1544915444
if( SCIPsetIsFeasLT(set, newzub, zlb) )
1545015445
{
1545115446
*infeasible = TRUE;
1545215447
return SCIP_OKAY;
1545315448
}
15449+
15450+
/* improve global upper bound of variable */
1545415451
if( SCIPsetIsFeasLT(set, newzub, zub) )
1545515452
{
15456-
/* bound might be adjusted due to integrality condition */
15457-
newzub = adjustedUb(set, SCIPvarIsIntegral(vlbvar), newzub);
15458-
1545915453
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1546015454
* with the local bound, in this case we need to store the bound change as pending bound change
1546115455
*/
@@ -15491,27 +15485,21 @@ SCIP_RETCODE SCIPvarAddVlb(
1549115485
}
1549215486
else
1549315487
{
15494-
SCIP_Real newzlb;
15495-
1549615488
if( !SCIPsetIsInfinity(set, xub) )
1549715489
{
1549815490
/* x >= b*z + d -> z >= (x-d)/b */
15499-
newzlb = (xub - vlbconstant)/vlbcoef;
15500-
15501-
/* return if the new bound is larger than infinity */
15502-
if( SCIPsetIsInfinity(set, REALABS(newzlb)) )
15503-
return SCIP_OKAY;
15491+
SCIP_Real newzlb = adjustedLb(set, SCIPvarIsIntegral(vlbvar), (xub - vlbconstant) / vlbcoef);
1550415492

15493+
/* check bounds for feasibility */
1550515494
if( SCIPsetIsFeasGT(set, newzlb, zub) )
1550615495
{
1550715496
*infeasible = TRUE;
1550815497
return SCIP_OKAY;
1550915498
}
15499+
15500+
/* improve global lower bound of variable */
1551015501
if( SCIPsetIsFeasGT(set, newzlb, zlb) )
1551115502
{
15512-
/* bound might be adjusted due to integrality condition */
15513-
newzlb = adjustedLb(set, SCIPvarIsIntegral(vlbvar), newzlb);
15514-
1551515503
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1551615504
* with the local bound, in this case we need to store the bound change as pending bound change
1551715505
*/
@@ -15558,12 +15546,10 @@ SCIP_RETCODE SCIPvarAddVlb(
1555815546
*infeasible = TRUE;
1555915547
return SCIP_OKAY;
1556015548
}
15549+
1556115550
/* improve global lower bound of variable */
1556215551
if( SCIPsetIsFeasGT(set, minvlb, xlb) )
1556315552
{
15564-
/* bound might be adjusted due to integrality condition */
15565-
minvlb = adjustedLb(set, SCIPvarIsIntegral(var), minvlb);
15566-
1556715553
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1556815554
* with the local bound, in this case we need to store the bound change as pending bound change
1556915555
*/
@@ -15785,18 +15771,19 @@ SCIP_RETCODE SCIPvarAddVub(
1578515771
/* the variable bound constraint defines a new lower bound */
1578615772
if( SCIPsetIsGT(set, vubcoef, 1.0) )
1578715773
{
15788-
SCIP_Real newlb = vubconstant / (1.0 - vubcoef);
15774+
/* bound might be adjusted due to integrality condition */
15775+
SCIP_Real newlb = adjustedLb(set, SCIPvarIsIntegral(var), vubconstant / (1.0 - vubcoef));
1578915776

15777+
/* check bounds for feasibility */
1579015778
if( SCIPsetIsFeasGT(set, newlb, ub) )
1579115779
{
1579215780
*infeasible = TRUE;
1579315781
return SCIP_OKAY;
1579415782
}
15795-
else if( SCIPsetIsFeasGT(set, newlb, lb) )
15796-
{
15797-
/* bound might be adjusted due to integrality condition */
15798-
newlb = adjustedLb(set, SCIPvarIsIntegral(var), newlb);
1579915783

15784+
/* improve global lower bound of variable */
15785+
if( SCIPsetIsFeasGT(set, newlb, lb) )
15786+
{
1580015787
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1580115788
* with the local bound, in this case we need to store the bound change as pending bound change
1580215789
*/
@@ -15821,22 +15808,21 @@ SCIP_RETCODE SCIPvarAddVub(
1582115808
/* the variable bound constraint defines a new upper bound */
1582215809
else
1582315810
{
15824-
SCIP_Real newub;
15825-
1582615811
assert(SCIPsetIsLT(set, vubcoef, 1.0));
1582715812

15828-
newub = vubconstant / (1.0 - vubcoef);
15813+
/* bound might be adjusted due to integrality condition */
15814+
SCIP_Real newub = adjustedUb(set, SCIPvarIsIntegral(var), vubconstant / (1.0 - vubcoef));
1582915815

15816+
/* check bounds for feasibility */
1583015817
if( SCIPsetIsFeasLT(set, newub, lb) )
1583115818
{
1583215819
*infeasible = TRUE;
1583315820
return SCIP_OKAY;
1583415821
}
15835-
else if( SCIPsetIsFeasLT(set, newub, ub) )
15836-
{
15837-
/* bound might be adjusted due to integrality condition */
15838-
newub = adjustedUb(set, SCIPvarIsIntegral(var), newub);
1583915822

15823+
/* improve global upper bound of variable */
15824+
if( SCIPsetIsFeasLT(set, newub, ub) )
15825+
{
1584015826
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1584115827
* with the local bound, in this case we need to store the bound change as pending bound change
1584215828
*/
@@ -15911,22 +15897,21 @@ SCIP_RETCODE SCIPvarAddVub(
1591115897
/* improve global bounds of vub variable, and calculate minimal and maximal value of variable bound */
1591215898
if( vubcoef >= 0.0 )
1591315899
{
15914-
SCIP_Real newzlb;
15915-
1591615900
if( !SCIPsetIsInfinity(set, -xlb) )
1591715901
{
1591815902
/* x <= b*z + d -> z >= (x-d)/b */
15919-
newzlb = (xlb - vubconstant)/vubcoef;
15903+
SCIP_Real newzlb = adjustedLb(set, SCIPvarIsIntegral(vubvar), (xlb - vubconstant) / vubcoef);
15904+
15905+
/* check bounds for feasibility */
1592015906
if( SCIPsetIsFeasGT(set, newzlb, zub) )
1592115907
{
1592215908
*infeasible = TRUE;
1592315909
return SCIP_OKAY;
1592415910
}
15911+
15912+
/* improve global lower bound of variable */
1592515913
if( SCIPsetIsFeasGT(set, newzlb, zlb) )
1592615914
{
15927-
/* bound might be adjusted due to integrality condition */
15928-
newzlb = adjustedLb(set, SCIPvarIsIntegral(vubvar), newzlb);
15929-
1593015915
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1593115916
* with the local bound, in this case we need to store the bound change as pending bound change
1593215917
*/
@@ -15962,22 +15947,21 @@ SCIP_RETCODE SCIPvarAddVub(
1596215947
}
1596315948
else
1596415949
{
15965-
SCIP_Real newzub;
15966-
1596715950
if( !SCIPsetIsInfinity(set, -xlb) )
1596815951
{
1596915952
/* x <= b*z + d -> z <= (x-d)/b */
15970-
newzub = (xlb - vubconstant)/vubcoef;
15953+
SCIP_Real newzub = adjustedUb(set, SCIPvarIsIntegral(vubvar), (xlb - vubconstant) / vubcoef);
15954+
15955+
/* check bounds for feasibility */
1597115956
if( SCIPsetIsFeasLT(set, newzub, zlb) )
1597215957
{
1597315958
*infeasible = TRUE;
1597415959
return SCIP_OKAY;
1597515960
}
15961+
15962+
/* improve global upper bound of variable */
1597615963
if( SCIPsetIsFeasLT(set, newzub, zub) )
1597715964
{
15978-
/* bound might be adjusted due to integrality condition */
15979-
newzub = adjustedUb(set, SCIPvarIsIntegral(vubvar), newzub);
15980-
1598115965
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1598215966
* with the local bound, in this case we need to store the bound change as pending bound change
1598315967
*/
@@ -16028,9 +16012,6 @@ SCIP_RETCODE SCIPvarAddVub(
1602816012
/* improve global upper bound of variable */
1602916013
if( SCIPsetIsFeasLT(set, maxvub, xub) )
1603016014
{
16031-
/* bound might be adjusted due to integrality condition */
16032-
maxvub = adjustedUb(set, SCIPvarIsIntegral(var), maxvub);
16033-
1603416015
/* during solving stage it can happen that the global bound change cannot be applied directly because it conflicts
1603516016
* with the local bound, in this case we need to store the bound change as pending bound change
1603616017
*/

0 commit comments

Comments
 (0)