Skip to content

Commit 32a17a5

Browse files
committed
fix over relaxation with two singletons in row
1 parent 39f7ab5 commit 32a17a5

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/CoinPresolveDual.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,8 @@ const CoinPresolveAction
16311631
int nOther = 0;
16321632
int nSameCoeff = 0;
16331633
int nSingletons = 0;
1634+
// Singletons - all continuous 1 - all binary 2 - other (general or mixed) 3
1635+
int nMixed = 0;
16341636
double rhs = canFix[i] == 1 ? rup[i] : rlo[i];
16351637
double firstCoeff = 0.0;
16361638
int j = -1;
@@ -1645,8 +1647,9 @@ const CoinPresolveAction
16451647
#endif
16461648
for (CoinBigIndex k = krs; k < kre; k++) {
16471649
j = hcol[k];
1648-
if (hincol[j]==1)
1650+
if (hincol[j]==1) {
16491651
nSingletons++;
1652+
}
16501653
double coeff = fabs(rowels[k]);
16511654
if (cup[j] > clo[j]) {
16521655
if (!firstCoeff) {
@@ -1661,19 +1664,33 @@ const CoinPresolveAction
16611664
if (prob->colProhibited2(j)) {
16621665
nInteger = 1;
16631666
nOther = 1;
1667+
nMixed = 3;
16641668
break;
16651669
} else if (integerType[j]) {
16661670
nInteger++;
1671+
if (clo[j]==0.0&&cup[j]==1.0) {
1672+
if (!nMixed)
1673+
nMixed = 2;
1674+
else if (nMixed!=2)
1675+
nMixed = 3; // be on safe side
1676+
} else {
1677+
nMixed = 3;
1678+
}
16671679
} else {
16681680
nOther++;
1681+
if (!nMixed)
1682+
nMixed = 1;
1683+
else if (nMixed!=1)
1684+
nMixed = 3; // be on safe side
16691685
}
16701686
} else {
16711687
rhs -= coeff * clo[j];
16721688
}
16731689
}
16741690
if (nSingletons>1) {
16751691
//printf("%d singletons nOther %d\n",nSingletons,nOther);
1676-
nOther=0;
1692+
if (nMixed<3)
1693+
nOther=0;
16771694
}
16781695
if (!nOther) {
16791696
if (nSameCoeff == nInteger) {

0 commit comments

Comments
 (0)