Skip to content

Commit 38a3b78

Browse files
committed
Merge remote-tracking branch 'origin/v9-minor'
2 parents 1b1bc79 + a8d1549 commit 38a3b78

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
@@ -333,6 +333,7 @@ Fixed bugs
333333
- when upgrading to xor constraint require parity variable to be enforced integral
334334
- provide the depth of the applied effective root with SCIPtreeGetEffectiveRootDepth() to avert invalid globalization of constraint set changes
335335
- disable objective limit during lexicographic dual minimization to keep feasibility status
336+
- declare infinite bound inference infeasible in SCIPinferVarLbCons() and SCIPinferVarUbCons() to maintain correct loose LP values
336337

337338
Build system
338339
------------

check/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ set(pairs_Issue
558558
"instances/Issue/3870.cip\;5133546551065818\;default"
559559
"instances/Issue/3908.cip\;-20317.1313131313\;subrestart"
560560
"instances/Issue/3911.cip\;-30386.2338470598\;lexdual"
561+
"instances/Issue/3917.cip\;+infinity\;default"
561562
)
562563

563564
#

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
@@ -13869,33 +13869,30 @@ void getObjvalDeltaLb(
1386913869
int* deltainf /**< pointer to store the number of variables with infinite best bound */
1387013870
)
1387113871
{
13872-
assert(!SCIPsetIsInfinity(set, REALABS(obj)));
13872+
assert(obj > 0.0);
13873+
assert(!SCIPsetIsInfinity(set, obj));
1387313874
assert(!SCIPsetIsInfinity(set, oldlb));
13874-
assert(!SCIPsetIsInfinity(set, -oldlb) || !SCIPsetIsInfinity(set, -newlb));
13875-
assert(SCIPsetIsPositive(set, obj)); /* we only need to update if the objective is positive */
13875+
assert(!SCIPsetIsInfinity(set, newlb));
13876+
assert(newlb != oldlb); /*lint !e777*/
1387613877

13877-
if( SCIPsetIsInfinity(set, -oldlb) )
13878+
if( SCIPsetIsInfinity(set, -newlb) )
1387813879
{
13879-
if( !SCIPsetIsInfinity(set, newlb) )
13880-
{
13881-
(*deltainf) = -1;
13882-
(*deltaval) = newlb * obj;
13883-
}
13884-
else
13885-
{
13886-
(*deltainf) = 0;
13887-
(*deltaval) = 0.0;
13888-
}
13880+
assert(!SCIPsetIsInfinity(set, -oldlb));
13881+
13882+
*deltainf = 1;
13883+
*deltaval = -obj * oldlb;
1388913884
}
13890-
else if( SCIPsetIsInfinity(set, REALABS(newlb)) )
13885+
else if( SCIPsetIsInfinity(set, -oldlb) )
1389113886
{
13892-
(*deltainf) = 1;
13893-
(*deltaval) = -oldlb * obj;
13887+
assert(!SCIPsetIsInfinity(set, -newlb));
13888+
13889+
*deltainf = -1;
13890+
*deltaval = obj * newlb;
1389413891
}
1389513892
else
1389613893
{
13897-
(*deltainf) = 0;
13898-
(*deltaval) = obj * (newlb - oldlb);
13894+
*deltainf = 0;
13895+
*deltaval = obj * (newlb - oldlb);
1389913896
}
1390013897
}
1390113898

@@ -13910,33 +13907,30 @@ void getObjvalDeltaUb(
1391013907
int* deltainf /**< pointer to store the number of variables with infinite best bound */
1391113908
)
1391213909
{
13913-
assert(!SCIPsetIsInfinity(set, REALABS(obj)));
13910+
assert(obj < 0.0);
13911+
assert(!SCIPsetIsInfinity(set, -obj));
1391413912
assert(!SCIPsetIsInfinity(set, -oldub));
13915-
assert(!SCIPsetIsInfinity(set, oldub) || !SCIPsetIsInfinity(set, newub));
13916-
assert(SCIPsetIsNegative(set, obj)); /* we only need to update if the objective is negative */
13913+
assert(!SCIPsetIsInfinity(set, -newub));
13914+
assert(newub != oldub); /*lint !e777*/
1391713915

13918-
if( SCIPsetIsInfinity(set, oldub) )
13916+
if( SCIPsetIsInfinity(set, newub) )
1391913917
{
13920-
if( !SCIPsetIsInfinity(set, -newub) )
13921-
{
13922-
(*deltainf) = -1;
13923-
(*deltaval) = newub * obj;
13924-
}
13925-
else
13926-
{
13927-
(*deltainf) = 0;
13928-
(*deltaval) = 0.0;
13929-
}
13918+
assert(!SCIPsetIsInfinity(set, oldub));
13919+
13920+
*deltainf = 1;
13921+
*deltaval = -obj * oldub;
1393013922
}
13931-
else if( SCIPsetIsInfinity(set, REALABS(newub)) )
13923+
else if( SCIPsetIsInfinity(set, oldub) )
1393213924
{
13933-
(*deltainf) = 1;
13934-
(*deltaval) = -oldub * obj;
13925+
assert(!SCIPsetIsInfinity(set, newub));
13926+
13927+
*deltainf = -1;
13928+
*deltaval = obj * newub;
1393513929
}
1393613930
else
1393713931
{
13938-
(*deltainf) = 0;
13939-
(*deltaval) = obj * (newub - oldub);
13932+
*deltainf = 0;
13933+
*deltaval = obj * (newub - oldub);
1394013934
}
1394113935
}
1394213936

src/scip/scip_var.c

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

69906990
SCIPvarAdjustLb(var, scip->set, &newbound);
69916991

6992-
/* ignore tightenings of lower bounds to +infinity during solving process */
6993-
if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
6994-
{
6995-
#ifndef NDEBUG
6996-
SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
6997-
SCIPvarGetLbLocal(var));
6998-
#endif
6999-
return SCIP_OKAY;
7000-
}
7001-
70026992
/* get current bounds */
70036993
lb = SCIPvarGetLbLocal(var);
70046994
ub = SCIPvarGetUbLocal(var);
70056995
assert(SCIPsetIsLE(scip->set, lb, ub));
70066996

7007-
if( SCIPsetIsFeasGT(scip->set, newbound, ub) || (scip->set->exact_enable && ub < newbound))
6997+
if( SCIPisInfinity(scip, newbound) || SCIPisFeasGT(scip, newbound, ub) || (scip->set->exact_enable && ub < newbound) )
70086998
{
70096999
*infeasible = TRUE;
70107000
return SCIP_OKAY;
70117001
}
7002+
70127003
newbound = MIN(newbound, ub);
70137004

70147005
if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
@@ -7103,26 +7094,17 @@ SCIP_RETCODE SCIPinferVarUbCons(
71037094

71047095
SCIPvarAdjustUb(var, scip->set, &newbound);
71057096

7106-
/* ignore tightenings of upper bounds to -infinity during solving process */
7107-
if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
7108-
{
7109-
#ifndef NDEBUG
7110-
SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
7111-
SCIPvarGetUbLocal(var));
7112-
#endif
7113-
return SCIP_OKAY;
7114-
}
7115-
71167097
/* get current bounds */
71177098
lb = SCIPvarGetLbLocal(var);
71187099
ub = SCIPvarGetUbLocal(var);
71197100
assert(SCIPsetIsLE(scip->set, lb, ub));
71207101

7121-
if( SCIPsetIsFeasLT(scip->set, newbound, lb) || (scip->set->exact_enable && lb > newbound) )
7102+
if( SCIPisInfinity(scip, -newbound) || SCIPisFeasLT(scip, newbound, lb) || (scip->set->exact_enable && lb > newbound) )
71227103
{
71237104
*infeasible = TRUE;
71247105
return SCIP_OKAY;
71257106
}
7107+
71267108
newbound = MAX(newbound, lb);
71277109

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

0 commit comments

Comments
 (0)