help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Outputting dual cost from GLPSOL


From: xypron
Subject: [Help-glpk] Outputting dual cost from GLPSOL
Date: Sat, 13 Dec 2008 18:25:21 -0800 (PST)

Hello Andrew,

I have patched GLPK-4.36 such that GLPSOL can output dual cost, upper
bounds, 
and lower bounds for constraints and variables.

For example/transp.mod

for {i in I, j in J}
  printf "shipment[%-10s, %-10s].dual = %10f\n", i, j, x[i,j].dual;
for {i in I}
  printf "supply[%-10s].dual = %f\n",i,supply[i].dual;
for {j in J}
  printf "demand[%-10s].dual = %f\n",j,demand[j].dual;

outputs

shipment[Seattle   , New-York  ].dual =   0.000000
shipment[Seattle   , Chicago   ].dual =   0.000000
shipment[Seattle   , Topeka    ].dual =   0.036000
shipment[San-Diego , New-York  ].dual =   0.000000
shipment[San-Diego , Chicago   ].dual =   0.009000
shipment[San-Diego , Topeka    ].dual =   0.000000
supply[Seattle   ].dual = 0.000000
supply[San-Diego ].dual = 0.000000
demand[New-York  ].dual = 0.225000
demand[Chicago   ].dual = 0.153000
demand[Topeka    ].dual = 0.126000

Upper and lower bounds can be accessed as 
.ub and .lb

It would make sense to add row primal value and column status and flag a 
variable causing unboundedness.

The changed files and diffs can be downloaded from
http://glpk.dyndns.org/viewvc/svn/glpk/glpk/branches/glpk-4.34-dot/

Changes are in
include/glpmpl.h
src/glpapi16.c
src/glpmpl01.c
src/glpmpl03.c
src/glpmpl04.c

Best regards

Xypron
-- 
View this message in context: 
http://www.nabble.com/Outputting-dual-cost-from-GLPSOL-tp20996696p20996696.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

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