help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] problem with dual


From: name name
Subject: Re: [Help-glpk] problem with dual
Date: Fri, 5 Aug 2011 17:12:22 +0200

How can I get the upper bound for the rows?


  No.   Row name   St Activity  Lower bound Upper bound Marginal
------ ------------ -- --------- ----------- ----------- --------
    1 constraint1  NL        48          48                  0.2
    2 constraint2  NL        35          35                  0.5
    3 constraint3  NL        24          24                  0.5
    4 constraint4  NL        10          10                  0.5
    5 constraint5  NL         8           8                    1


0.2
0.5
0.5
0.5
1

On Fri, Aug 5, 2011 at 4:38 PM, Andrew Makhorin <address@hidden> wrote:
> I can't see where the probleme is coming
>
> model primar is
>
> \* Problem: Unknown *\
>
> Minimize
>  objective: + x_1 + x_2 + x_3 + x_4 + x_5
>
> Subject To
>  constraint1: + 5 x_1 >= 48
>  constraint2: + 2 x_2 >= 35
>  constraint3: + 2 x_3 >= 24
>  constraint4: + 2 x_4 >= 10
>  constraint5: + x_5 >= 8
>
> End
>
> I solve and get
>
> getObjectiveValue
> master obj:52.1
>
> then I wont to pass a dual solution for this I do
> GLPK.glp_get_col_dual(lp,colId+1) for all collone and I got this.

Optimal basic solution to your lp I obtained with glpsol is the
following:

Rows:       5
Columns:    5
Non-zeros:  5
Status:     OPTIMAL
Objective:  objective = 52.1 (MINimum)

  No.   Row name   St Activity  Lower bound Upper bound Marginal
------ ------------ -- --------- ----------- ----------- --------
    1 constraint1  NL        48          48                  0.2
    2 constraint2  NL        35          35                  0.5
    3 constraint3  NL        24          24                  0.5
    4 constraint4  NL        10          10                  0.5
    5 constraint5  NL         8           8                    1

  No. Column name  St Activity  Lower bound Upper bound Marginal
------ ------------ -- --------- ----------- ----------- --------
    1 x_1          B        9.6           0
    2 x_2          B       17.5           0
    3 x_3          B         12           0
    4 x_4          B          5           0
    5 x_5          B          8           0

Note that all columns (variables) are basic at the optimum, so they all
have zero reduced costs, that is, dual values.



reply via email to

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