Code Monkey home page Code Monkey logo

Comments (5)

svigerske avatar svigerske commented on July 20, 2024 1

Problem is that the linear constraint handlers decides that some constraints are redundant:

  [linear] <c135>:  -1200.00001211119<t_chi[2,Winding,1]>[B] +<t_rul[2,Winding,33]>[C] <= 1199.99998788881;
[cons_linear.c:16471] debug: linear constraint <c135> is redundant: activitybounds=[-1200.00001211119,1200], sides=[-1e+20,1199.99998788881]

But the difference between 1200 and 1199.99998788881 matters here.
If the constraints are removed, more variables are fixed to their bound. For this fixing, the nonlinear constraints are violated, though.

Being more strict in the redundancy check for linear constraints helps:

diff --git a/src/scip/cons_linear.c b/src/scip/cons_linear.c
index dffbd4428b..3675f41121 100644
--- a/src/scip/cons_linear.c
+++ b/src/scip/cons_linear.c
@@ -16465,7 +16465,7 @@ SCIP_DECL_CONSPRESOL(consPresolLinear)
             cutoff = TRUE;
             break;
          }
-         else if( SCIPisFeasGE(scip, minactivity, consdata->lhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
+         else if( SCIPisGE(scip, minactivity, consdata->lhs) && SCIPisLE(scip, maxactivity, consdata->rhs) )
          {
             SCIPdebugMsg(scip, "linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
                SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
@@ -16476,7 +16476,7 @@ SCIP_DECL_CONSPRESOL(consPresolLinear)
                (*ndelconss)++;
             break;
          }
-         else if( !SCIPisInfinity(scip, -consdata->lhs) && SCIPisFeasGE(scip, minactivity, consdata->lhs) )
+         else if( !SCIPisInfinity(scip, -consdata->lhs) && SCIPisGE(scip, minactivity, consdata->lhs) )
          {
             SCIPdebugMsg(scip, "linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
                SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
@@ -16484,7 +16484,7 @@ SCIP_DECL_CONSPRESOL(consPresolLinear)
             if( !consdata->upgraded )
                (*nchgsides)++;
          }
-         else if( !SCIPisInfinity(scip, consdata->rhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
+         else if( !SCIPisInfinity(scip, consdata->rhs) && SCIPisLE(scip, maxactivity, consdata->rhs) )
          {
             SCIPdebugMsg(scip, "linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
                SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);

Also https://git.zib.de/integer/scip/-/merge_requests/2913

from scip.

svigerske avatar svigerske commented on July 20, 2024

Could you write out a CIP file with the model instances? There seems to be a writeProblem() function for model.

from scip.

Joao-Dionisio avatar Joao-Dionisio commented on July 20, 2024

Could you write out a CIP file with the model instances? There seems to be a writeProblem() function for model.

Sure, here they are:
without_temperature.zip
with_temperature.zip

from scip.

svigerske avatar svigerske commented on July 20, 2024

Removing these temperature constraints leads to fixing all variables in the problem (starting with the dualfix presolver). Some fixings seem to be done in a way that some remaining constraints are infeasible:

  [nonlinear] <c7>: <rul[1,Winding,1]>+(<rul[1,Winding,0]>+exp(((<real_temp[1,1]>*0.166667+(-16.3333))*log(2)))*(-1)+<chi[1,Winding,0]>*6000)*(-1) <= 0;
violation: right hand side is violated by 1.21111886528524e-05

This output is from this change:

diff --git a/src/scip/scip_solve.c b/src/scip/scip_solve.c
index d9280d3c14..57ef787163 100644
--- a/src/scip/scip_solve.c
+++ b/src/scip/scip_solve.c
@@ -1431,7 +1431,7 @@ SCIP_RETCODE presolve(
       SCIP_Bool stored;
 
       SCIP_CALL( SCIPcreateSol(scip, &sol, NULL) );
-      SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, FALSE, FALSE, &stored) );
+      SCIP_CALL( SCIPtrySolFree(scip, &sol, TRUE, FALSE, FALSE, FALSE, FALSE, &stored) );
 
       if( scip->set->nactivepricers == 0 )
       {

Disabling the dualfix presolver helps, but not sure that this is the culprit.

from scip.

Joao-Dionisio avatar Joao-Dionisio commented on July 20, 2024

Thank you for the very quick response, Stefan! Closing the issue as completed now.

from scip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.