Skip to content

Commit a8d1549

Browse files
committed
Merge remote-tracking branch 'origin/v92-bugfix' into v9-minor
2 parents db3bfdd + ecdc80d commit a8d1549

File tree

6 files changed

+59
-68
lines changed

6 files changed

+59
-68
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Fixed bugs
5252
- when upgrading to xor constraint require parity variable to be enforced integral
5353
- provide the depth of the applied effective root with SCIPtreeGetEffectiveRootDepth() to avert invalid globalization of constraint set changes
5454
- disable objective limit during lexicographic dual minimization to keep feasibility status
55+
- declare infinite bound inference infeasible in SCIPinferVarLbCons() and SCIPinferVarUbCons() to maintain correct loose LP values
5556

5657
Build system
5758
------------

check/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ set(pairs_Issue
512512
"instances/Issue/3870.cip\;5133546551065818\;default"
513513
"instances/Issue/3908.cip\;-20317.1313131313\;subrestart"
514514
"instances/Issue/3911.cip\;-30386.2338470598\;lexdual"
515+
"instances/Issue/3917.cip\;+infinity\;default"
515516
)
516517

517518
#

check/instances/Issue/3917.cip

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
STATISTICS
2+
Problem name : seed
3+
Variables : 2 (0 binary, 1 integer, 0 implicit integer, 1 continuous)
4+
Constraints : 0 initial, 2 maximal
5+
OBJECTIVE
6+
Sense : minimize
7+
VARIABLES
8+
[integer] <x3>: obj=1, original bounds=[0,+inf]
9+
[continuous] <x5>: obj=0, original bounds=[0,+inf]
10+
CONSTRAINTS
11+
[linear] <_C1>: +5<x3>[I] -51<x5>[C] >= 0;
12+
[linear] <_C2>: -69.93<x3>[I] +80.45<x5>[C] >= 3004.82;
13+
END

src/scip/cons_varbound.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ SCIP_RETCODE separateCons(
12041204

12051205
if( cutoff )
12061206
{
1207-
assert(SCIPisGT(scip, newlb, SCIPvarGetUbLocal(var)));
1207+
assert(SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(var)));
12081208

12091209
/* analyze infeasibility */
12101210
SCIP_CALL( analyzeConflict(scip, cons, var, newlb, PROPRULE_1, SCIP_BOUNDTYPE_LOWER, usebdwidening) );
@@ -1235,7 +1235,7 @@ SCIP_RETCODE separateCons(
12351235

12361236
if( cutoff )
12371237
{
1238-
assert(SCIPisLT(scip, newub, SCIPvarGetLbLocal(var)));
1238+
assert(SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(var)));
12391239

12401240
/* analyze infeasibility */
12411241
SCIP_CALL( analyzeConflict(scip, cons, var, newub, PROPRULE_3, SCIP_BOUNDTYPE_UPPER, usebdwidening) );
@@ -1561,7 +1561,7 @@ SCIP_RETCODE propagateCons(
15611561
if( *cutoff )
15621562
{
15631563
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->var), xlb, xub, newlb, xub);
1564-
assert( SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->var)) );
1564+
assert(SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->var)));
15651565

15661566
SCIP_CALL( SCIPresetConsAge(scip, cons) );
15671567

@@ -1602,7 +1602,7 @@ SCIP_RETCODE propagateCons(
16021602
if( *cutoff )
16031603
{
16041604
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->vbdvar), ylb, yub, newlb, yub);
1605-
assert( SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->vbdvar)) );
1605+
assert(SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->vbdvar)));
16061606

16071607
/* analyze infeasibility */
16081608
SCIP_CALL( analyzeConflict(scip, cons, consdata->vbdvar, newlb, PROPRULE_2, SCIP_BOUNDTYPE_LOWER, usebdwidening) );
@@ -1634,7 +1634,7 @@ SCIP_RETCODE propagateCons(
16341634
if( *cutoff )
16351635
{
16361636
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->vbdvar), ylb, yub, ylb, newub);
1637-
assert( SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->vbdvar)) );
1637+
assert(SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->vbdvar)));
16381638

16391639
SCIP_CALL( SCIPresetConsAge(scip, cons) );
16401640

@@ -1704,7 +1704,7 @@ SCIP_RETCODE propagateCons(
17041704
if( *cutoff )
17051705
{
17061706
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->var), xlb, xub, xlb, newub);
1707-
assert( SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->var)) );
1707+
assert(SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->var)));
17081708

17091709
SCIP_CALL( SCIPresetConsAge(scip, cons) );
17101710

@@ -1745,7 +1745,7 @@ SCIP_RETCODE propagateCons(
17451745
if( *cutoff )
17461746
{
17471747
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->vbdvar), ylb, yub, ylb, newub);
1748-
assert(SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->vbdvar)));
1748+
assert(SCIPisInfinity(scip, -newub) || SCIPisLT(scip, newub, SCIPvarGetLbLocal(consdata->vbdvar)));
17491749

17501750
SCIP_CALL( SCIPresetConsAge(scip, cons) );
17511751

@@ -1779,7 +1779,7 @@ SCIP_RETCODE propagateCons(
17791779
if( *cutoff )
17801780
{
17811781
SCIPdebugMsg(scip, "cutoff while tightening <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n", SCIPvarGetName(consdata->vbdvar), ylb, yub, newlb, yub);
1782-
assert(SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->vbdvar)));
1782+
assert(SCIPisInfinity(scip, newlb) || SCIPisGT(scip, newlb, SCIPvarGetUbLocal(consdata->vbdvar)));
17831783

17841784
SCIP_CALL( SCIPresetConsAge(scip, cons) );
17851785

src/scip/lp.c

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13580,33 +13580,30 @@ void getObjvalDeltaLb(
1358013580
int* deltainf /**< pointer to store the number of variables with infinite best bound */
1358113581
)
1358213582
{
13583-
assert(!SCIPsetIsInfinity(set, REALABS(obj)));
13583+
assert(obj > 0.0);
13584+
assert(!SCIPsetIsInfinity(set, obj));
1358413585
assert(!SCIPsetIsInfinity(set, oldlb));
13585-
assert(!SCIPsetIsInfinity(set, -oldlb) || !SCIPsetIsInfinity(set, -newlb));
13586-
assert(SCIPsetIsPositive(set, obj)); /* we only need to update if the objective is positive */
13586+
assert(!SCIPsetIsInfinity(set, newlb));
13587+
assert(newlb != oldlb); /*lint !e777*/
1358713588

13588-
if( SCIPsetIsInfinity(set, -oldlb) )
13589+
if( SCIPsetIsInfinity(set, -newlb) )
1358913590
{
13590-
if( !SCIPsetIsInfinity(set, newlb) )
13591-
{
13592-
(*deltainf) = -1;
13593-
(*deltaval) = newlb * obj;
13594-
}
13595-
else
13596-
{
13597-
(*deltainf) = 0;
13598-
(*deltaval) = 0.0;
13599-
}
13591+
assert(!SCIPsetIsInfinity(set, -oldlb));
13592+
13593+
*deltainf = 1;
13594+
*deltaval = -obj * oldlb;
1360013595
}
13601-
else if( SCIPsetIsInfinity(set, REALABS(newlb)) )
13596+
else if( SCIPsetIsInfinity(set, -oldlb) )
1360213597
{
13603-
(*deltainf) = 1;
13604-
(*deltaval) = -oldlb * obj;
13598+
assert(!SCIPsetIsInfinity(set, -newlb));
13599+
13600+
*deltainf = -1;
13601+
*deltaval = obj * newlb;
1360513602
}
1360613603
else
1360713604
{
13608-
(*deltainf) = 0;
13609-
(*deltaval) = obj * (newlb - oldlb);
13605+
*deltainf = 0;
13606+
*deltaval = obj * (newlb - oldlb);
1361013607
}
1361113608
}
1361213609

@@ -13621,33 +13618,30 @@ void getObjvalDeltaUb(
1362113618
int* deltainf /**< pointer to store the number of variables with infinite best bound */
1362213619
)
1362313620
{
13624-
assert(!SCIPsetIsInfinity(set, REALABS(obj)));
13621+
assert(obj < 0.0);
13622+
assert(!SCIPsetIsInfinity(set, -obj));
1362513623
assert(!SCIPsetIsInfinity(set, -oldub));
13626-
assert(!SCIPsetIsInfinity(set, oldub) || !SCIPsetIsInfinity(set, newub));
13627-
assert(SCIPsetIsNegative(set, obj)); /* we only need to update if the objective is negative */
13624+
assert(!SCIPsetIsInfinity(set, -newub));
13625+
assert(newub != oldub); /*lint !e777*/
1362813626

13629-
if( SCIPsetIsInfinity(set, oldub) )
13627+
if( SCIPsetIsInfinity(set, newub) )
1363013628
{
13631-
if( !SCIPsetIsInfinity(set, -newub) )
13632-
{
13633-
(*deltainf) = -1;
13634-
(*deltaval) = newub * obj;
13635-
}
13636-
else
13637-
{
13638-
(*deltainf) = 0;
13639-
(*deltaval) = 0.0;
13640-
}
13629+
assert(!SCIPsetIsInfinity(set, oldub));
13630+
13631+
*deltainf = 1;
13632+
*deltaval = -obj * oldub;
1364113633
}
13642-
else if( SCIPsetIsInfinity(set, REALABS(newub)) )
13634+
else if( SCIPsetIsInfinity(set, oldub) )
1364313635
{
13644-
(*deltainf) = 1;
13645-
(*deltaval) = -oldub * obj;
13636+
assert(!SCIPsetIsInfinity(set, newub));
13637+
13638+
*deltainf = -1;
13639+
*deltaval = obj * newub;
1364613640
}
1364713641
else
1364813642
{
13649-
(*deltainf) = 0;
13650-
(*deltaval) = obj * (newub - oldub);
13643+
*deltainf = 0;
13644+
*deltaval = obj * (newub - oldub);
1365113645
}
1365213646
}
1365313647

src/scip/scip_var.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5645,26 +5645,17 @@ SCIP_RETCODE SCIPinferVarLbCons(
56455645

56465646
SCIPvarAdjustLb(var, scip->set, &newbound);
56475647

5648-
/* ignore tightenings of lower bounds to +infinity during solving process */
5649-
if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
5650-
{
5651-
#ifndef NDEBUG
5652-
SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
5653-
SCIPvarGetLbLocal(var));
5654-
#endif
5655-
return SCIP_OKAY;
5656-
}
5657-
56585648
/* get current bounds */
56595649
lb = SCIPvarGetLbLocal(var);
56605650
ub = SCIPvarGetUbLocal(var);
56615651
assert(SCIPsetIsLE(scip->set, lb, ub));
56625652

5663-
if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
5653+
if( SCIPisInfinity(scip, newbound) || SCIPisFeasGT(scip, newbound, ub) )
56645654
{
56655655
*infeasible = TRUE;
56665656
return SCIP_OKAY;
56675657
}
5658+
56685659
newbound = MIN(newbound, ub);
56695660

56705661
if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
@@ -5759,26 +5750,17 @@ SCIP_RETCODE SCIPinferVarUbCons(
57595750

57605751
SCIPvarAdjustUb(var, scip->set, &newbound);
57615752

5762-
/* ignore tightenings of upper bounds to -infinity during solving process */
5763-
if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
5764-
{
5765-
#ifndef NDEBUG
5766-
SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
5767-
SCIPvarGetUbLocal(var));
5768-
#endif
5769-
return SCIP_OKAY;
5770-
}
5771-
57725753
/* get current bounds */
57735754
lb = SCIPvarGetLbLocal(var);
57745755
ub = SCIPvarGetUbLocal(var);
57755756
assert(SCIPsetIsLE(scip->set, lb, ub));
57765757

5777-
if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
5758+
if( SCIPisInfinity(scip, -newbound) || SCIPisFeasLT(scip, newbound, lb) )
57785759
{
57795760
*infeasible = TRUE;
57805761
return SCIP_OKAY;
57815762
}
5763+
57825764
newbound = MAX(newbound, lb);
57835765

57845766
if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )

0 commit comments

Comments
 (0)