[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [Help-glpk] MIP Problem

**From**: |
Andrew Makhorin |

**Subject**: |
Re: [Help-glpk] MIP Problem |

**Date**: |
Tue, 13 Oct 2009 04:32:21 +0400 |

>* I'm trying to solve this simple problem:*
>* \* Problem: Unknown *\*
>* Maximize*
>* obj: + 0.8 Z.1 + 0.2 Z.2*
>* Subject To*
>* r.1: - Z.1 + U.1 <= 0.1*
>* r.2: - Z.1 + U.1 >= -0.1*
>* r.3: + Z.1 + U.1 <= 1*
>* r.4: + Z.1 + U.1 >= 0.7*
>* r.5: - Z.2 + U.1 <= 0.5*
>* r.6: - Z.2 + U.1 >= 0.125*
>* r.7: + Z.2 + U.1 <= 0.75*
>* r.8: + Z.2 + U.1 >= 0.34*
>* Bounds*
>* 0 <= Z.1 <= 1*
>* 0 <= Z.2 <= 1*
>* 0 <= U.1 <= 1*
>* Generals*
>* Z.1*
>* Z.2*
>* U.1*
>* End*
>* If I try to solve it from a C program using the simplex method it *
>* finds this solution:*
>* Z.1 = 0.55*
>* Z.2 = 0.3*
>* U.1 = 0.388977*
>* But if I try to solve it using the command:*
>* glpsol --simplex --cpxlp program_name.txt*
>* it says:*
>* glp_read_lp: reading problem data from `mip.txt'...*
>* glp_read_lp: 8 rows, 3 columns, 16 non-zeros*
>* glp_read_lp: 3 integer columns, all of which are binary*
>* glp_read_lp: 26 lines were read*
>* ipp_basic_tech: 0 row(s) and 0 column(s) removed*
>* PROBLEM HAS NO PRIMAL FEASIBLE SOLUTION*
>* Time used: 0.0 secs*
>* Memory used: 0.0 Mb (35140 bytes)*
>* It says that the variable are integer but they should not be integer.*
>* Anyone could help me? What's wrong with it?*
Nothing is wrong. Your instance is mip, because it has integer
variables defined in the section 'Generals'. The simplex solver,
glp_simplex, ignores integrality conditions and, thus, finds
optimal solution to lp relaxation. However, glpsol solves your
instance as mip and reports that it has no integer feasible points.