Info

此问题已关闭。 请重新打开它进行编辑或回答。

help with Algorithm to route unsplittable flows on a single primary path

1 次查看(过去 30 天)
What I have done is taken the network from paper 1 (all network specifications are from there and implemented the optimization from paper 2 in the network from 1 and I am trying to measure the effect on link utilization. How would you change the given Algorithm to route unsplittable flows on the specified single primary path only
% delta_edp : if link e on path p used for demand d % x_dp : if path used for demand % y_e : if link e used in any primary path % l_dp : the fraction of traffic via path p %link
global hd ce Ye delta_edp X_dp;
link(1,:)=[1 2];
link(2,:)=[1 3];
link(3,:)=[1 4];
link(4,:)=[2 6];
link(5,:)=[3 6];
link(6,:)=[3 7];
link(7,:)=[4 8];
link(8,:)=[4 9];
link(9,:)=[6 10];
link(10,:)=[7 10];
link(11,:)=[8 11];
link(12,:)=[8 12];
link(13,:)=[9 12];
link(14,:)=[9 13];
link(15,:)=[1 5];
link(16,:)=[5 13];
%primary path
Pd_pr(1,:)=[2, 6, 10];
Pd_pr(2,:)=[3,7,11];
Pd_pr(3,:)=[3,7,12];
Pd_pr(4,:)=[15, 16,0];
%sencondary path
Pd_s(1,:)=[1,4,9];
Pd_s(2,:)=[2,5,9];
Pd_s(3,:)=[3,8,13];
Pd_s(4,:)=[3,8,14];
path=[Pd_pr;Pd_s];
%link capacity
ce=[50 50 200 50 50 50 150 50 50 50 50 50 50 50 50 50];
%demand
demand=[1 10;1 11;1 12;1 13];
%associated flow values for demand
hd=[45 45 50 40];
%value of X_dp
X_dp=zeros(4,8);
%Algorithm
for jj=1:4 %4 demands
for kk=1:8 %8Paths
demandStart=demand(jj,1);
demandEnd=demand(jj,2);
pathStart=path(kk,1);
linkStart=link(pathStart,1);
pathEnd=path(kk,3);
if pathEnd==0
pathEnd=path(kk,2);
end
linkEnd=link(pathEnd,2);
if pathEnd==0
pathEnd=path(kk,2);
end
if demandStart==linkStart && demandEnd==linkEnd
X_dp(jj,kk)=1;
end
end
end

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by