[Osi-tickets] [COIN-OR Open Solver Interface] #69: Positivity box constraints on the variables are in even if they should not...

COIN-OR Open Solver Interface coin-trac at coin-or.org
Tue Oct 28 14:53:16 EDT 2008


#69: Positivity box constraints on the variables are in even if they should
not...
-----------------------------+----------------------------------------------
  Reporter:  coniglio        |       Owner:  mjs 
      Type:  defect          |      Status:  new 
  Priority:  major           |   Milestone:      
 Component:  Osi Base Class  |     Version:  0.96
Resolution:                  |    Keywords:      
-----------------------------+----------------------------------------------
Old description:

> After loading a .mps or .lp instance, with a plain:
>     OsiClpSolverInterface solver;
>     if (extention == "lp") solver.readLp(filename.c_str());
>     else solver.readMps(filename.c_str());
> when checking the lower and upper bounds on the variables, with:
>     const double* clb = solver.getColLower();
>     const double* cub = solver.getColUpper();
> I am finding the lower bounds in clb to be always set to 0, even if the
> variables in the instance file were unbounded.
>
> Simple example: I get a (0,0) solution to the problem:
>   Minimize
>   obj:  x0 + x1
>   Subject To
>   c0:  x0 + x1 >= -1
>   End
> whereas the optimum should be attained at (-0.5, -0.5).

New description:

 After loading a .mps or .lp instance, with a plain:
     !OsiClpSolverInterface solver;
     if (extention == "lp") solver.readLp(filename.c_str());
     else solver.readMps(filename.c_str());
 when checking the lower and upper bounds on the variables, with:
     const double* clb = solver.getColLower();
     const double* cub = solver.getColUpper();
 I am finding the lower bounds in clb to be always set to 0, even if the
 variables in the instance file were unbounded.

 Simple example: I get a (0,0) solution to the problem:
   Minimize
   obj:  x0 + x1
   Subject To
   c0:  x0 + x1 >= -1
   End
 whereas the optimum should be attained at (-0.5, -0.5).

Comment (by mjs):

 The default bounds for an LP in .lp or .mps format are 0 <= x < infinity.
 To get a variable unrestricted in sign, you need to explicitly reset the
 lower bound in the bounds section to -infinity (.lp format) or MI or FR
 (.mps format).  Most modeling languages that I know of behave that way,
 including AMPL, GAMS, and MPL.

 Apologies if you already knew that, but the example you provide doesn't
 contain the necessary bounds.

 (BTW, the optimum is attained at any combination of x0 and x1 s.t. x0 =
 -x1 - 1 if both variables are free.)

-- 
Ticket URL: <https://projects.coin-or.org/Osi/ticket/69#comment:1>
COIN-OR Open Solver Interface <http://projects.coin-or.org/Osi>
An API for a variety of LP and MIP solvers (and more).



More information about the Osi-tickets mailing list