**Please check the code below for input data.**

```
%% Input variables
Tasks=[50];
points=length(Tasks);
obj=zeros(1,points);
M=2;
T=30; % 1 hour 60 min
No=25; % vehicles at time t=0
tau=zeros(M,50);
Emn=zeros(M,50);
mu=[11.62 13.65]./60;
lambda=[11.12 13.03]./60;
for kt=1:points
K=Tasks(1,kt);
qk=zeros(K,1); % size of each task in bits
ck=zeros(K,1); % computation required for each task in cycles/bit
gk=zeros(K,1); % delay threshold of each task in seconds
for k=1:K
a=10e6;
b=50e6;
qk(k,1)=a+(b-a)*rand;
a=1000;
b=1500;
ck(k,1)=a+(b-a)*rand;
a=150;
b=3600;
gk(k,1)=a+(b-a)*rand;
end
for m=1:M
for t=1:T
x=exp((mu(1,m)-lambda(1,m))*t);
Emt(m,t)=floor(No*exp((mu(1,m)-lambda(1,m))*t)); %MxT
end
end
for m=1:M
n=1;
Emn(m,n)=Emt(m,1);
to=1;
for t=2:T
if Emt(m,t)~=Emn(m,n)
tau(m,n)=t-to;
to=t;
n=n+1;
Emn(m,n)=Emt(m,t); % expected number of vehicles during each slot
end
if t==T
tau(m,n)=T-sum(tau(m,:));
end
end
end
totalslots=sum((tau(:,:)~=0),2);
Nmax=max(totalslots);
tau=tau(:,1:Nmax)*60;
Emn=Emn(:,1:Nmax);
%%%%%%%%% comp. capacity of vehicles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
F=zeros(M,Nmax);
mean=1e9;
sigma=0.3e9;
for m=1:M
EMN=nonzeros(Emn(m,:));
N=length(EMN);
for n=1:N
sz=Emn(m,n); %number of vehicles in slot n
compcap = normrnd(mean,sigma,[1,sz]);
totcompcap=sum(compcap);
F(m,n)=totcompcap;
end
end
cap=tau.*F;
Ck=repmat(ck,1,Nmax,M);
Gk=repmat(gk,1,Nmax,M);
Qk=repmat(qk,1,Nmax,M);
for m=1:M
for n=1:Nmax
for k=1:K
if(F(m,n)==0)
Cap(1,n,m)=0;
else
Fm(k,n,m)=F(m,n);
Cap(1,n,m)=cap(m,n);
end
end
end
end
o=zeros(K,Nmax,M);
```

The output is pasted below.

## Calling SDPT3 4.0: 2070 variables, 1000 equality constraints

For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 1000

dim. of linear var = 2070

SDPT3: Infeasible path-following algorithms

## version predcorr gam expon scale_data

NT 1 0.000 1 0

it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

## 0|0.000|0.000|1.8e+06|4.5e+01|2.4e+18| 4.708209e+15 0.000000e+00| 0:0:00| spchol 1 1

1|0.976|0.967|4.4e+04|1.5e+00|7.9e+16| 1.122326e+14 -4.880831e+04| 0:0:00| spchol 1 1

2|0.953|0.985|2.0e+03|2.2e-02|1.2e+15| 3.002522e+12 -1.567647e+04| 0:0:00| spchol 1 1

3|0.991|0.886|1.8e+01|2.5e-03|1.4e+14| 1.822109e+12 -2.726057e+04| 0:0:00| spchol 1 1

4|1.000|0.962|4.4e-05|9.8e-05|7.0e+12| 1.684505e+12 -6.427311e+02| 0:0:01| spchol 1 1

5|1.000|0.424|4.5e-06|5.6e-05|5.1e+12| 1.442882e+12 -1.109443e+02| 0:0:01| spchol 1 1

6|1.000|0.586|5.1e-07|2.3e-05|2.8e+12| 1.064458e+12 3.496964e+01| 0:0:01| spchol 1 1

7|1.000|0.779|7.1e-08|5.1e-06|9.9e+11| 6.012234e+11 4.201797e+01| 0:0:01| spchol 1 1

8|1.000|0.894|1.8e-08|5.5e-07|2.5e+11| 2.240577e+11 4.702660e+01| 0:0:01| spchol 1 1

9|1.000|0.912|3.8e-09|4.8e-08|1.3e+10| 1.234299e+10 4.711449e+01| 0:0:01| spchol 1 1

10|0.985|0.984|9.9e-10|7.8e-10|2.0e+08| 1.893187e+08 4.711939e+01| 0:0:01| spchol 1 1

11|0.989|0.989|3.3e-10|1.0e-11|2.2e+06| 2.099657e+06 4.711947e+01| 0:0:01| spchol 1 1

12|0.989|0.989|6.0e-09|3.3e-13|2.7e+04| 2.312907e+04 4.711970e+01| 0:0:01| spchol 1 1

13|0.987|0.989|7.7e-07|6.7e-15|3.9e+02| 3.214404e+02 4.712429e+01| 0:0:01| spchol 1 1

14|0.837|0.972|7.8e-07|7.1e-16|6.6e+01| 6.898113e+01 4.729968e+01| 0:0:01| spchol 1 1

15|1.000|0.906|7.2e-07|3.1e-16|3.6e+01| 4.645839e+01 4.780776e+01| 0:0:01| spchol 1 1

16|1.000|0.951|6.5e-07|8.1e-17|7.4e+00| 2.450732e+01 4.818591e+01| 0:0:01| spchol 1 1

17|0.989|0.969|6.3e-07|1.0e-16|4.4e-01| 1.934589e+01 4.834032e+01| 0:0:01| spchol 1 1

18|0.982|0.975|6.2e-07|5.5e-17|1.0e-02| 1.925014e+01 4.835960e+01| 0:0:01| spchol 1 1

19|0.971|0.969|6.2e-07|7.7e-17|5.1e-04| 1.946460e+01 4.836064e+01| 0:0:01| spchol 1 1

20|0.987|0.985|6.2e-07|1.2e-16|2.1e-05| 1.954642e+01 4.836076e+01| 0:0:01| spchol 1 1

21|0.986|0.984|6.2e-07|5.5e-17|7.8e-07| 1.959370e+01 4.836077e+01| 0:0:01| spchol 1 1

22|0.990|0.988|6.2e-07|3.4e-21|2.0e-08| 1.960524e+01 4.836078e+01| 0:0:01| spchol 1 1

23|0.992|0.988|6.2e-07|7.7e-17|4.3e-10| 1.960976e+01 4.836078e+01| 0:0:01| spchol 1 1

24|0.994|0.989|6.2e-07|1.3e-16|8.3e-12| 1.961017e+01 4.836078e+01| 0:0:02| spchol 1 1

25|0.998|0.989|6.2e-07|6.7e-17|1.3e-13| 1.961018e+01 4.836078e+01| 0:0:02|

stop: relative gap < infeasibility

## number of iterations = 25

primal objective value = 1.96101688e+01

dual objective value = 4.83607761e+01

gap := trace(XZ) = 8.28e-12

relative gap = 1.20e-13

actual relative gap = -4.17e-01

rel. primal infeas (scaled problem) = 6.16e-07

rel. dual " " " = 1.28e-16

rel. primal infeas (unscaled problem) = 0.00e+00

rel. dual " " " = 0.00e+00

norm(X), norm(y), norm(Z) = 2.8e+03, 5.0e+07, 2.5e+13

norm(A), norm(b), normÂ© = 3.9e+04, 1.0e+00, 2.5e+13

Total CPU time (secs) = 1.55

CPU time per iteration = 0.06

termination code = -1

DIMACS: 6.2e-07 0.0e+00 4.1e-16 0.0e+00 -4.2e-01 1.2e-13

Status: Inaccurate/Solved

Optimal value (cvx_optval): -48.3608