Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
%function []=solv_opt()
clear all;
n = 20; m = 10;
w = rand(1, n);
w= w./sum(w);
lambda=randi([1,5],1,n);
V = rand(m,n)/3;
for v=1:1:60
s=v*.1;
cvx_begin quiet
variables X(m,n) C
minimize(C)
subject to
sum(X,1)<=C
sum(X,2)<=C
sum(X.*V) == ones(1,n)*s;
X(:)>=0
cvx_end
l(v)=C;
obj=0
for u=1:n
obj = obj + w(u)*(1-exp(-s*lambda(u)));
end
z(v)=obj;
end
for v=1:1:120
T=v*.1;
cvx_begin quiet
variables X(m,n) p(n)
obj=0
for u=1:n
obj = obj + w(u)*(1-exp(-p(u)*lambda(u)));
end
maximize(obj)
subject to
sum(X,1)<=1
sum(X,2)<=1
sum(X.*V,1)*T == p'
p>=0
X(:)>=0
cvx_end
x(v)=T;
obj=0
for u=1:n
obj = obj + w(u)*(1-exp(-p(u)*lambda(u)));
end
y(v)=obj;
end
figure;
plot(x,y,'r', 'linewidth', 5);
grid on;
hold on;
plot(l,z,'b', 'linewidth', 5);
set(gca, 'fontsize', 18)
legend('Our Algorithm','Baseline Algorithm');
axis([0 12 0 1])
xlabel('Makespan', 'fontsize', 18)
ylabel('Weighted Accuracy', 'fontsize', 18)