Dual values and duality gaps in LP

63 views
Skip to first unread message

Mohammad M

unread,
Aug 26, 2014, 12:55:02 PM8/26/14
to yal...@googlegroups.com
I am trying to use dual values to create Bender cuts, but the dual values that I get seems not to be correct. I am solving a LP problem, and as primal has an optimal answer, there shouldn't be duality gap (as I know from LP), but when I use dual values to recalculate objective values, I will get a huge gap. I tried different solvers like gurobi, cplex, .., and I have got different answers but all doesnt look like correct (primal is alwyays feasible and has optimal answer). I don't know YALMIP change anything for calculating dual values or there is any special structure to get dual values for constraints. I used dual function to get dual values. Anyone could apply BD in YALMIP?

Johan Löfberg

unread,
Aug 26, 2014, 1:42:54 PM8/26/14
to yal...@googlegroups.com
If all solvers and modelling languages give you something which you think is incorrect, I think you have to go back and accept that you have understood something wrong.

c = randn(5,1);
A
= randn(20,5);
b
= rand(20,1);
x
= sdpvar(5,1);
Constraint = A*x <= b;
Objective = c'*x;
solvesdp(Constraint,-Objective)
[double(Objective) b'
*dual(Constraint)]




Mohammad M

unread,
Aug 26, 2014, 1:50:24 PM8/26/14
to yal...@googlegroups.com
I didn't try other modeling languages like GAMS personally i just try different solvers, but some of my friends used GAMS/CLPEX and they got the correct answer ...

Johan Löfberg

unread,
Aug 26, 2014, 2:01:25 PM8/26/14
to yal...@googlegroups.com
So please illustrate, with an absolutely minimal example, what you consider to be a wrong dual solution.
Reply all
Reply to author
Forward
0 new messages