[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Dual variables as result from a LP solver
From: |
Brady Hunsaker |
Subject: |
Re: [Help-glpk] Dual variables as result from a LP solver |
Date: |
Wed, 22 Sep 2004 09:24:12 -0400 |
On Wed, 2004-09-22 at 09:03, address@hidden wrote:
> Hi subscribers,
>
> I want to solve several hundred LPs to get the results of the dual
> variables.
> Naturally I could do some coding within GLPK, but I don't want to
> reinvent the wheel. Has someone done this?
> An alternative would be to convert an original problem to the dual
> problem. Does someone know a free program, who can handle this?
>
> All suggestion are welcomed,
> Harald.
>
If using the API, use the routine lpx_get_row_dual (and possibly
lpx_get_col_dual) after you have solved the LP. I find that different
texts and solvers sometimes treat sign (plus/minus) differently, so you
may want to be sure that the sign convention GLPK uses is what you
expect.
If you don't want to use the API, glpsol's output with the --output
option includes a column "Marginal", which contains the dual values.
For several hundred LPs this probably doesn't make sense unless you
write a parser to extract the dual values from the output. But using
the API is probably easier.
Brady
p.s. Harald, I have not forgotten your other example, but this month has
been too busy for me to do much. I do hope to look at it within a few
weeks.
--
Brady Hunsaker
Assistant Professor
Industrial Engineering
University of Pittsburgh
http://www.engr.pitt.edu/hunsaker/