[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Fwd: glpk, reduced prices at each step
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Fwd: glpk, reduced prices at each step |
Date: |
Wed, 8 Apr 2009 13:22:26 +0300 |
> Would to be able to get the reduced prices of each column for the
> objective at each basis as the simplex solving method moves from state
> to state.
> What would the best way to accomplish this be?
> Example sudo code (if there was a glp_simplex_step function):
> simplex_reduced_price_record(lp,objectiveIndexs,objetiveValues){
> resultIndexs = []
> resultValues = []
> i = 0
> while(status(lp) != optimal){
> i = i + 1
> indexs = objectiveIndexs
> values = objectiveValues
> glpk.glp_lpx_transform_row(lp, size, indexs, values)
>
> resultIndexs[i] = indexs
> resultValues[i] = values
>
> glp_simplex_step(lp)
> }
> return(resultIndexs,resultValues)
> }
The simplex solver glp_simplex stores reduced costs of all (auxiliary
and structural variables) in the problem object, so you can obtain them
with routines glp_get_row_dual and glp_get_col_dual. There is no need to
use lpx_transform_row. Note that reduced costs of auxiliary variables
returned by glp_get_row_dual are the same as simplex multipliers pi
(shadow prices). For definitions please see the glpk reference manual,
Chapter "Advanced API Routines", Section "Background".