Hi, This is an example from Convex Optimization Book. I only want to check the strong duality by using dual variables returned by cvx. For the first problem it does hold. But for the dual problem it is not. Even when I remove negative instances which make the result complex number, the strong duality does not hold. Why? Actually I have the same difficulty with the dual variables returned by cvx, in one of my own problems and when I tried to figure out it using a simple problem using cvx, I encountered this even with problems from the book.
% Section 11.8.4: Network rate optimization
% Boyd & Vandenberghe "Convex Optimization"
% Argyrios Zymnis - 05/03/08
% some comments
rand('state',1)
L = 20;
n = 10;
k = 7; %average links per flow
A = double(rand(L,n) <= k/L);
c = 0.9*rand(L,1)+0.1;
% Solve network rate problem
cvx_begin
variable x(n);
dual variable LA % I added this
maximize(sum(log(x)))
subject to
LA:A*x <= c
cvx_end
primal_obj = cvx_optval;
c'*LA-sum(log(A'*LA))-n % I added this
% Solve dual problem to obtain link prices
cvx_begin
variable lambda(L);
dual variable xd % I added this
minimize(c'*lambda-sum(log(A'*lambda))-n)
subject to
xd:lambda >= 0
cvx_end
sum(log(xd))% I added this
dual_obj = cvx_optval;