Bug

View: New views
4 Messages — Rating Filter:   Alert me  

Bug

by manuel.munoz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bug: lp_solve fail to solve the following model:
               
                max: x;
                x <= 0;
                free x;
               
It gives 1e+30, but the optimal solution is 0.

--

--------------------------------------------------
http://www.uca.es/teloydisren
http://knuth.uca.es/R
--------------------------------------------------
Nombre: Manuel Muñoz Márquez
Departamento: Departamento de Estadística e Investigación
Operativa
Institución: Escuela Superior de Ingeniería de Cádiz
Organización: Universidad de Cádiz
Dirección:     c/ Sacramento 82
                     Escuela Superior de Ingeniería de Cádiz
                     11002--Cádiz
Tlf.: 956016084, 956015311
FAX: 956016050
--------------------------------------------------
Name: Manuel Munoz-Marquez
Department: Statistics and Operations Research Department
Institution: Escuela Superior de Ingenieria de Cadiz
Organization: Universidad de Cadiz
Address: c/ Sacramento 82
Escuela Superior de Ingenieria de Cadiz
11002--Cadiz, Spain

Tlf.:  34956016084, 34956015313
FAX: 34956016050

e-mail: manuel.munoz@...
--------------------------------------------------


Re: Bug

by peter_notebaert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is because your model is too simple. It has no constraints. x<=0; is seen as a bound as it is written here and not as a constraint.

To force it as constraint, give it a label:

max: x;
R1: x <= 0;
free x;

You can see this also if let lp_solve you write the model:

lp_solve model.lp -wlp con

gives:

/* Objective function */
max: +x;

/* Variable bounds */
x >= -Inf;

With the label it gives:

/* Objective function */
max: +x;

/* Constraints */
R1: +x <= 0;

/* Variable bounds */
x >= -Inf;


Peter

--- In lp_solve@..., Manuel Muñoz Márquez <manuel.munoz@...> wrote:

>
> Bug: lp_solve fail to solve the following model:
>                
>                 max: x;
>                 x <= 0;
>                 free x;
>                
> It gives 1e+30, but the optimal solution is 0.
>
> --
>
> --------------------------------------------------
> http://www.uca.es/teloydisren
> http://knuth.uca.es/R
> --------------------------------------------------
> Nombre: Manuel Muñoz Márquez
> Departamento: Departamento de Estadística e Investigación
> Operativa
> Institución: Escuela Superior de Ingeniería de Cádiz
> Organización: Universidad de Cádiz
> Dirección:     c/ Sacramento 82
>                      Escuela Superior de Ingeniería de Cádiz
>                      11002--Cádiz
> Tlf.: 956016084, 956015311
> FAX: 956016050
> --------------------------------------------------
> Name: Manuel Munoz-Marquez
> Department: Statistics and Operations Research Department
> Institution: Escuela Superior de Ingenieria de Cadiz
> Organization: Universidad de Cadiz
> Address: c/ Sacramento 82
> Escuela Superior de Ingenieria de Cadiz
> 11002--Cadiz, Spain
>
> Tlf.:  34956016084, 34956015313
> FAX: 34956016050
>
> e-mail: manuel.munoz@...
> --------------------------------------------------
>



Re: Re: Bug

by manuel.munoz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El mié, 04-11-2009 a las 10:59 +0000, peter_notebaert escribió:

>  
> That is because your model is too simple. It has no constraints. x<=0;
> is seen as a bound as it is written here and not as a constraint.
>
> To force it as constraint, give it a label:
>
> max: x;
> R1: x <= 0;
> free x;
>

I can see. But why I can write, by example, x+y <10 without a label but
not x <= 0?

Thank you, Peter.


--

--------------------------------------------------
http://www.uca.es/teloydisren
http://knuth.uca.es/R
--------------------------------------------------
Nombre: Manuel Muñoz Márquez
Departamento: Departamento de Estadística e Investigación
Operativa
Institución: Escuela Superior de Ingeniería de Cádiz
Organización: Universidad de Cádiz
Dirección:     c/ Sacramento 82
                     Escuela Superior de Ingeniería de Cádiz
                     11002--Cádiz
Tlf.: 956016084, 956015311
FAX: 956016050
--------------------------------------------------
Name: Manuel Munoz-Marquez
Department: Statistics and Operations Research Department
Institution: Escuela Superior de Ingenieria de Cadiz
Organization: Universidad de Cadiz
Address: c/ Sacramento 82
Escuela Superior de Ingenieria de Cadiz
11002--Cadiz, Spain

Tlf.:  34956016084, 34956015313
FAX: 34956016050

e-mail: manuel.munoz@...
--------------------------------------------------


Re: Re: Bug

by peter_notebaert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Look in the reference guide in the explanation of the lp-format (
http://lpsolve.sourceforge.net/5.5/lp-format.htm)

Peter

2009/11/4 Manuel Muñoz Márquez <manuel.munoz@...>

>
>
> El mié, 04-11-2009 a las 10:59 +0000, peter_notebaert escribió:
>
> >
> > That is because your model is too simple. It has no constraints. x<=0;
> > is seen as a bound as it is written here and not as a constraint.
> >
> > To force it as constraint, give it a label:
> >
> > max: x;
> > R1: x <= 0;
> > free x;
> >
>
> I can see. But why I can write, by example, x+y <10 without a label but
> not x <= 0?
>
> Thank you, Peter.
>
>
> --
>
> --------------------------------------------------
> http://www.uca.es/teloydisren
> http://knuth.uca.es/R
> --------------------------------------------------
> Nombre: Manuel Muñoz Márquez
> Departamento: Departamento de Estadística e Investigación
> Operativa
> Institución: Escuela Superior de Ingeniería de Cádiz
> Organización: Universidad de Cádiz
> Dirección: c/ Sacramento 82
> Escuela Superior de Ingeniería de Cádiz
> 11002--Cádiz
> Tlf.: 956016084, 956015311
> FAX: 956016050
> --------------------------------------------------
> Name: Manuel Munoz-Marquez
> Department: Statistics and Operations Research Department
> Institution: Escuela Superior de Ingenieria de Cadiz
> Organization: Universidad de Cadiz
> Address: c/ Sacramento 82
> Escuela Superior de Ingenieria de Cadiz
> 11002--Cadiz, Spain
>
> Tlf.: 34956016084, 34956015313
> FAX: 34956016050
>
> e-mail: manuel.munoz@... <manuel.munoz%40uca.es>
> --------------------------------------------------
>
>  
>