Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v9-minor'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed Mar 31, 2024
2 parents f6cca7e + 6a1262e commit 3fe72b2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Fixed bugs
- in SCIPsolveProbingLP() when objective has been changed do not return cutoff due to exceeding the cutoff bound
- set probing LP to be a relaxation only when objective has not been changed
- declare contradicting infinities in getMinActivity() and getMaxActivity() as non-tight
- reject farkas solution with large values to bound magnification of errors in SCIPgetFarkasProof()

Miscellaneous
-------------
Expand Down
53 changes: 29 additions & 24 deletions src/scip/conflict_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
* 2^53 = 9007199254740992
*/
#define NUMSTOP 9007199254740992.0
/* because row violations might be magnified, we stop the infeasibility analysis if a dual weight is bigger than
* 10^7 = 10000000
*/
#define SOLSTOP 10000000.0

/** returns the current number of conflict sets in the conflict set storage */
int SCIPconflictGetNConflicts(
Expand Down Expand Up @@ -1210,17 +1214,26 @@ SCIP_RETCODE SCIPgetFarkasProof(
/* allocate temporary memory */
SCIP_CALL( SCIPsetAllocBufferArray(set, &dualfarkas, nrows) );
BMSclearMemoryArray(dualfarkas, nrows);
localrowinds = NULL;
localrowdepth = NULL;
nlocalrows = 0;

/* get dual Farkas values of rows */
SCIP_CALL( SCIPlpiGetDualfarkas(lpi, dualfarkas) );

localrowinds = NULL;
localrowdepth = NULL;
nlocalrows = 0;
/* check whether the Farkas solution is numerically stable */
for( r = 0; r < nrows; ++r )
{
if( REALABS(dualfarkas[r]) > SOLSTOP )
{
*valid = FALSE;
goto TERMINATE;
}
}

/* calculate the Farkas row */
(*valid) = TRUE;
(*validdepth) = 0;
*valid = TRUE;
*validdepth = 0;

for( r = 0; r < nrows; ++r )
{
Expand Down Expand Up @@ -1254,7 +1267,7 @@ SCIP_RETCODE SCIPgetFarkasProof(
/* due to numerical reasons we want to stop */
if( REALABS(SCIPaggrRowGetRhs(farkasrow)) > NUMSTOP )
{
(*valid) = FALSE;
*valid = FALSE;
goto TERMINATE;
}
}
Expand Down Expand Up @@ -1310,7 +1323,7 @@ SCIP_RETCODE SCIPgetFarkasProof(
}
else
{
(*valid) = FALSE;
*valid = FALSE;
SCIPsetDebugMsg(set, " -> proof is not valid to due infinite activity delta\n");
}
}
Expand Down Expand Up @@ -1347,7 +1360,6 @@ SCIP_RETCODE SCIPgetDualProof(
SCIP_Real* redcosts;
int* localrowinds;
int* localrowdepth;
SCIP_Real maxabsdualsol;
SCIP_Bool infdelta;
int nlocalrows;
int nrows;
Expand Down Expand Up @@ -1386,7 +1398,7 @@ SCIP_RETCODE SCIPgetDualProof(
retcode = SCIPlpiGetSol(lpi, NULL, primsols, dualsols, NULL, redcosts);
if( retcode == SCIP_LPERROR ) /* on an error in the LP solver, just abort the conflict analysis */
{
(*valid) = FALSE;
*valid = FALSE;
goto TERMINATE;
}
SCIP_CALL( retcode );
Expand All @@ -1399,20 +1411,13 @@ SCIP_RETCODE SCIPgetDualProof(
#endif

/* check whether the dual solution is numerically stable */
maxabsdualsol = 0;
for( r = 0; r < nrows; r++ )
{
SCIP_Real absdualsol = REALABS(dualsols[r]);

if( absdualsol > maxabsdualsol )
maxabsdualsol = absdualsol;
}

/* don't consider dual solution with maxabsdualsol > 1e+07, this would almost cancel out the objective constraint */
if( maxabsdualsol > 1e+07 )
for( r = 0; r < nrows; ++r )
{
(*valid) = FALSE;
goto TERMINATE;
if( REALABS(dualsols[r]) > SOLSTOP )
{
*valid = FALSE;
goto TERMINATE;
}
}

/* clear the proof */
Expand Down Expand Up @@ -1477,7 +1482,7 @@ SCIP_RETCODE SCIPgetDualProof(
/* due to numerical reasons we want to stop */
if( REALABS(SCIPaggrRowGetRhs(farkasrow)) > NUMSTOP )
{
(*valid) = FALSE;
*valid = FALSE;
goto TERMINATE;
}
}
Expand Down Expand Up @@ -1533,7 +1538,7 @@ SCIP_RETCODE SCIPgetDualProof(
}
else
{
(*valid) = FALSE;
*valid = FALSE;
SCIPsetDebugMsg(set, " -> proof is not valid to due infinite activity delta\n");
}
}
Expand Down

0 comments on commit 3fe72b2

Please sign in to comment.