help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] [Fwd: help to get dual solution from glp_simplex]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: help to get dual solution from glp_simplex]
Date: Fri, 07 Oct 2011 01:30:49 +0400

-------- Forwarded Message --------
From: Sergio Barbosa Villas-Boas sbVB <address@hidden>
To: address@hidden, Leonas Sakalauskas <address@hidden>
Subject: help to get dual solution from glp_simplex
Date: Thu, 06 Oct 2011 17:06:09 -0300

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi, gurus
 
I'm using glpk with linux, writing in C++.
 
I succeeded in getting results of Simplex by using glp_simplex.
The results are the primal solution.
 
Now I need to get the dual solution (also known as shadow price).
I tried the code below (simplified)
 
////////////////////////////////////////////////////////// begin
 
// load data to lp ....
 
// create param setting method to DUAL
    glp_smcp parm;
    glp_init_smcp(&parm);
    parm.meth = GLP_DUAL;
 
// call simplex
    glp_simplex(lp, &parm);
 
////////////////////////////////////////////////////////// end
 
The glp_simplex function returns the same solution as it the method was
GLP_PRIMAL.
 
I would appreciate if someone could give me an example of how to write code
to get the dual solution (shadow price).
 
Thanks in advance.
 
- ----------------------------------------------------
 +------+  Sergio Barbosa Villas-Boas
/------/|  address@hidden
| sbVB |/  http://www.sbVB.com.br
+------+   Skype: sbvbsbvb
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJOjgoxAAoJEIRc3wIxcT+7sUsH/Rnwb78J7KUKgTndXnNwjgYE
Th/2e149ZK9pqyaI00TnuKf5YK+E2Sl7TDv31CaAbNDnX+eS0r7QJzdqfH3JXo6F
LMSslOCARpsdC3rymBZ2qAA55+9AaoBEQfqLewLHAWngjypVPwFfYhS2c0Ei/6ih
mLt1ly92bFAEoAtOrQVs2MbsU2Mytqc2f/1fggP9fuFwv+e3Lh8La6kyg1HHmzp+
Sl720hh6fDh6nvrbE9rwf+/1SHEy9J38Z/UTtlmh2ykbAR8mzWCxMLqsj9s4LxGj
56JAO3o+VeoQa0oLOwNFBOC7yHrIx7miMtL5BKiTEvqV8uV+RFsAKzqeoKH0cxM=
=gE5n
-----END PGP SIGNATURE-----






reply via email to

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