[SCIP] Reading LP file vs C API question

Kovács Gergely gkovacsds at gmail.com
Mon Oct 25 19:13:56 CEST 2021


Sorry, please ignore my last email, if I set a var's bounds to  
0..SCIPinfinity, it seems to behave like that. I get 0 objective value,  
it's all OK.


On Mon, 25 Oct 2021 18:57:27 +0200, Kovács Gergely <gkovacsds at gmail.com>  
wrote:

> 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


-- 
Using Opera's mail client: http://www.opera.com/mail/



More information about the Scip mailing list