help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] dual values


From: name name
Subject: Re: [Help-glpk] dual values
Date: Thu, 6 Oct 2011 09:27:31 +0200

I'm not interested in dual value of x_16 but  in others (x_1 to x_15)

I got

6.0  1.0  1.0  5.0  2.0  7.0  7.0  6.0  3.0  3.0  7.0  8.0  -22.0  2.0  5.0

sholdn't it be

6.0  1.0  1.0  5.0  2.0  7.0  0.0  6.0  3.0  3.0  0.0  0.0  0.0  2.0  5.0

?

On Thu, Oct 6, 2011 at 7:50 AM, glpk xypron <address@hidden> wrote:
Hello,

you will have remarked that glpsol outputs:
PROBLEM HAS NO DUAL FEASIBLE SOLUTION
because any unbounded value of x_16 will solve the problem.

If you add constraints for x_16 you will get the expected result, e.g.

var x_1;
var x_2;
var x_3;
var x_4;
var x_5;
var x_6;
var x_7;
var x_8;
var x_9;
var x_10;
var x_11;
var x_12;
var x_13;
var x_14;
var x_15;
var x_16, <= 1, >=0;

minimize
 objective: + 6 * x_1 + x_2 + x_3 + 5 * x_4 + 2 * x_5 + 7 * x_6 + 7 * x_7 + 6 * x_8
 + 3 * x_9 + 3 * x_10 + 7 * x_11 + 8 * x_12 + 8 * x_13 + 2 * x_14 + 5 * x_15;

s.t. constraint1: + x_1 = 1;
s.t. constraint2: + x_2 = 1;
s.t. constraint3: + x_3 = 1;
s.t. constraint4: + x_4 = 1;
s.t. constraint5: + x_5 = 1;
s.t. constraint6: + x_6 = 1;
s.t. constraint7: + x_7 + x_16 = 1;
s.t. constraint8: + x_8 = 1;
s.t. constraint9: + x_9 = 1;
s.t. constraint10: + x_10 = 1;
s.t. constraint11: + x_16 + x_11 = 1;
s.t. constraint12: + x_16 + x_12 = 1;
s.t. constraint13: + x_13 + x_16 = 1;
s.t. constraint14: + x_14 = 1;
s.t. constraint15: + x_15 = 1;

solve;

printf "x_7.dual=%f\n", x_7.dual;
printf "x_11.dual=%f\n",x_11.dual;
printf "x_12.dual=%f\n",x_12.dual;
printf "x_13.dual=%f\n",x_13.dual;

end;

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Wed, 5 Oct 2011 12:28:46 +0200
> Betreff: [Help-glpk] dual values

> Hello,
>
> I'm adding a column in a model and when I calculate the dual values I got
> wrong results
>
> Minimize
>  objective: + 6 x_1 + x_2 + x_3 + 5 x_4 + 2 x_5 + 7 x_6 + 7 x_7 + 6 x_8
>  + 3 x_9 + 3 x_10 + 7 x_11 + 8 x_12 + 8 x_13 + 2 x_14 + 5 x_15
>
> Subject To
>  constraint1: + x_1 = 1
>  constraint2: + x_2 = 1
>  constraint3: + x_3 = 1
>  constraint4: + x_4 = 1
>  constraint5: + x_5 = 1
>  constraint6: + x_6 = 1
>  constraint7: + x_7 + x_16 = 1
>  constraint8: + x_8 = 1
>  constraint9: + x_9 = 1
>  constraint10: + x_10 = 1
>  constraint11: + x_16 + x_11 = 1
>  constraint12: + x_16 + x_12 = 1
>  constraint13: + x_13 + x_16 = 1
>  constraint14: + x_14 = 1
>  constraint15: + x_15 = 1
>
> End
>
> I have added x-16.
> Shouldn't the dual for the variables x_7, x_11 , x_12 and x_13 be equal to
> 0
> ?
>
> Thank you
>
> Onor

--
Follow me at http://twitter.com/#!/xypron

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


reply via email to

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