[SCIP] Reading LP file vs C API question

Kovács Gergely gkovacsds at gmail.com
Mon Oct 25 18:57:27 CEST 2021


Dear All,
please take a loot at the 2 small LP examples below.
These are LP files written using the SCIP API, after creating this problem  
by code.
It's kind of a sparse linear matrix solving.
The "bad" example does not calculate the solution I need.
In the "good" example I deleted the bounds regarding vars e1..e5, then if  
I solve it using reading the LP file (building the problem not by API  
calls) the correct solution is calculated.
My question is how can I programatically (using C API calls) achieve the  
"good" situation when some vars have no bounds attached at all? Is there a  
special constant for SCIPcreateVar regarding lower/upper limit so these  
vars don't have any bounds attached?

Thank you,
Geri

*** "BAD" ***

\ SCIP STATISTICS
\   Problem name     : scipproblem1
\   Variables        : 10 (0 binary, 0 integer, 0 implicit integer, 10  
continuous)
\   Constraints      : 5
Minimize
  Obj: +1 e1 +1 e2 +1 e3 +1 e4 +1 e5
Subject to
  row_0: +1 e1 +1000.010001776 x1 -1.776e-06 x3 = +0
  row_1: +1 e2 +1 x4 +1 x5 = +0
  row_2: +1 e3 -1.776e-06 x1 +1.776e-06 x3 -1 x4 = +0
  row_3: +1 e4 -1 x2 +1 x3 = +0
  row_4: +1 e5 -1 x2 = -5
Bounds
  e1 free
  e2 free
  e3 free
  e4 free
  e5 free
  -1000 <= x1 <= 1000
  -1000 <= x2 <= 1000
  -1000 <= x3 <= 1000
  -1000 <= x4 <= 1000
  -1000 <= x5 <= 1000
End


*** "GOOD" ***

\ SCIP STATISTICS
\   Problem name     : scipproblem1
\   Variables        : 10 (0 binary, 0 integer, 0 implicit integer, 10  
continuous)
\   Constraints      : 5
Minimize
  Obj: +1 e1 +1 e2 +1 e3 +1 e4 +1 e5
Subject to
  row_0: +1 e1 +1000.010001776 x1 -1.776e-06 x3 = +0
  row_1: +1 e2 +1 x4 +1 x5 = +0
  row_2: +1 e3 -1.776e-06 x1 +1.776e-06 x3 -1 x4 = +0
  row_3: +1 e4 -1 x2 +1 x3 = +0
  row_4: +1 e5 -1 x2 = -5
Bounds
  -1000 <= x1 <= 1000
  -1000 <= x2 <= 1000
  -1000 <= x3 <= 1000
  -1000 <= x4 <= 1000
  -1000 <= x5 <= 1000
End


More information about the Scip mailing list