资源简介
有关复杂网络无标度网络的幂律分布MATLAB仿真程序,希望对大家有帮助!

代码片段和文件信息
function Nodes=Powerlaw_with_Expected_Exponent(Nmgamanode_attribution)
%This program generates a power law degree distribution graph with expected gama
%Ref[Universal behavior of load distribution in Scale free networksPRL V87200112]
%Input:
%N--the number of nodes
%m--the mean degree =2m
%gama--the expected exponentblong to (2infinit)whose corelation with the control
% parameter alfa is: gama=1+1/alfawhere alfa is [01)
%node_attribution--if node_attribution==1Nodes is adjacent matrix; if
% node_attribution=2Nodes is adjacent list.
%Output
%Nodes--return the adjacent matrix if node_attribution=1.the adjacent list
% if node_attribution=2
%
if node_attribution==1
Nodes=zeros(NN);
p=zeros(N1);
pp=zeros(N1);
node_1_Len=zeros(N1);
node_2_Len=zeros(N1);
alfa=1/(gama-1);
edge_num=N*m;
%1.get nodes‘ weight
for i=1:N
p(i)=1/(i^alfa);
end
%2.normalized node weights
sum_p=sum(p);
pp(1)=p(1)/sum_p;
for i=2:N
pp(i)=pp(i-1)+p(i)/sum_p;
end
%3.add edge
for i=1:edge_num
%i
ADD_ONE_EDGE=0;
while ADD_ONE_EDGE==0
node_1_Len=find(pp>rand(1));
node_1=node_1_Len(1);
node_2_Len=find(pp>rand(1));
node_2=node_2_Len(1);
while node_2==node_1%avoid self-loop
node_2_Len=find(pp>rand(1));
node_2=node_2_Len(1);
end
if Nodes(node_1node_2)==0
Nodes(node_1node_2)=1;
Nodes(node_2node_1)=1;
ADD_ONE_EDGE=1;
else
ADD_ONE_EDGE=0;
end%Nodes(node_1node_2)
end%while ADD_ONE_EDGE==0
end% for i=1:edge_num
end%node_attribution
if TEST==1
t=toc
for i=1:N
Degree(i)=nnz(Nodes(i:));
end
plot_distribution(DegreeLine_color1);
fname=[‘PLRG‘num2str(N)‘k‘num2str(m)‘gama‘num2str(gama)];
Write_Sparse_Matrix(Nodes[fname‘.adj‘]);
Write_into_Pajek(Nodes[fname‘.net‘]);
end
return
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2180 2008-07-24 23:15 Powerlaw_with_Expected_Exponent.m
----------- --------- ---------- ----- ----
2180 1
- 上一篇:FIR高通/低通/带通/带阻滤波器设计
- 下一篇:mgpc 多变量预测控制
相关资源
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 阵列天线的matlab仿真
- 天线阵的波束形成在MATLAB仿真程序及
- OFDM系统MATLAB仿真代码
- CRC循环冗余校验的matlab仿真程序
- (7,4)循环码-信道编码的matlab仿真
- MIMO雷达DOA估计中的克拉美罗界计算
- Boost电路的MATLAB仿真
- 基于气动力的导弹姿态控制(附MATL
- 有源电力滤波器的Matlab仿真_高勇
- 3点GPS定位MATLAB仿真
- 一维光子晶体MATLAB仿真代码吸收率折
- 清洁机器人路径规划matlab仿真程序
- 基于倒谱图判断浊音的基音周期MATL
- 粒子群算法优化pid源码 matlab仿真.ra
- 小卫星多普勒频偏MATLAB仿真程序及参
- 基于Matlab的OFDM系统仿真的设计
- 《MATLAB仿真在现代通信中的应用》徐
- 自抗扰控制ADRC的MATLAB仿真+书籍资料
- Ldpc编译码方案MATLAB仿真
- 基于模型预测控制的车辆轨迹跟踪问
- 合成孔径雷达成像csChirp Scaling算法M
- 冲击电压发生器MATLAB仿真,主要是单
- 信道的MATLAB仿真
- 基于傅里叶叠层的图像重建算法matl
- 信息论大作业 LZ78算法编译码 matlab仿
- 跳频通信系统MATLAB仿真
- 机械臂SEA柔顺控制matlab仿真
- 群速度色散的matlab仿真
- 异步电机降压启动matlab仿真
评论
共有 条评论