Why my CVX problem is infeasible?

clc;clear all;
n = 100; % number of sensor nodes
x0 = rand(n,1); % initial values of each node
d = [1 1 1]; % room size
dim = length(d);
pos = rand(n,dim)*diag(d(1:dim)); % positions of nodes
dist = sqrt((repmat(pos(:,1),1,n)-repmat(pos(:,1)',n,1)).^2 + ...
(repmat(pos(:,2),1,n) - repmat(pos(:,2)',n,1)).^2 + ...
(repmat(pos(:,3),1,n) - repmat(pos(:,3)',n,1)).^2); % matrix of distance between each node
thresh = 2*sqrt(2*log(n)/n); % transmission radius
G = double(dist <= thresh) - eye(n); % connectivity matrix
neighbors = cell(n,1);
nneighbors = zeros(n,1);
for i = 1:n
neighbors{i} = find(G(i,:)); % Identify neighborhoods
nneighbors(i) = numel(neighbors{i}); % number of neighbors
end
cvx_begin SDP
variable P(n,n) nonnegative % probabilistic matric of two neighboring nodes to communicate
variable DD(n,1) nonnegative
variable D(n,n) diagonal
variable W(n,n) symmetric semidefinite % update matrix of randomized gossip
variable s nonnegative % spectral radius of matrix W-11'/n
% minimize (norm(W.*dist,'fro') + s)
% minimize (norm(W.*dist,'fro'))
minimize (s)
subject to
for i = 1:n
DD(i) == sum(P(i,:))+sum(P(:,i));
end
D == diag(DD)
W == eye(n)-1/(2*n)*D+(P+P')/(2*n)
W-1/n*ones(n,n) <= s*eye(n)
sum(P,2) == 1
P == P.*G
cvx_end

2 Comments

What programming language is that? Is that http://cvxr.com/cvx/ ?
I use the CVX on Matlab, the solver is SDP.

Sign in to comment.

Answers (0)

Categories

Asked:

on 29 Feb 2016

Commented:

on 1 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!