help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] ILP problem , unexpected solution


From: Andrew Makhorin
Subject: Re: [Help-glpk] ILP problem , unexpected solution
Date: Tue, 29 Dec 2009 17:21:34 +0300

> I run your code with a call to glp_write_lp added.
> Below here is your instance passed to glp_simplex in cplex format:

> \* Problem: sample *\

> Maximize
>  obj: 0 x1

> Subject To
>  p: + x4 + x3 + x2 + x1 <= 5
>  q: - x2 + 10 x1 <= 5
>  r: - 2 x3 + x2 <= 5
>  o: - 0.5 x4 + 2 x3 = 1

> Bounds
>  0 <= x1 <= 1
>  0 <= x2 <= 1
>  0 <= x3 <= 1
>  0 <= x4 <= 1

> Generals
>  x1
>  x2
>  x3
>  x4

> End

Below here is the solution. (Note that in your program x1, x2,
x3, and x4 are declared as int.)

Problem:
Rows:       4
Columns:    4
Non-zeros:  10
Status:     OPTIMAL
Objective:  obj = 0 (MAXimum)

   No.   Row name   St   Activity     Lower bound   Upper bound
------ ------------ -- ------------- ------------- -------------
     1 p            B              1                           5 
     2 q            NU             5                           5
     3 r            B             -1                           5 
     4 o            NS             1             1             =

   No. Column name  St   Activity     Lower bound   Upper bound
------ ------------ -- ------------- ------------- -------------
     1 x1           B            0.5             0             1 
     2 x4           NL             0             0             1
     3 x3           B            0.5             0             1 
     4 x2           NL             0             0             1







reply via email to

[Prev in Thread] Current Thread [Next in Thread]