scale-free network help

2 次查看(过去 30 天)
Nhl
Nhl 2014-6-30
编辑: Nhl 2014-7-3
Hello; I have a homework about scale-free network. I must write a matlab program for scale-free network with matlab. There are many ready programmes in the internet. I try to write a programme by heliping ready programme and I add some codes. But I don't understand exactly the algorithm. My programme:
%clc N=100; % network size m_ilk_b_d_s=3; % initial node number adj=zeros(N,N); for i= 1: m_ilk_b_d_s adj( i, m_ilk_b_d_s-1) = 1; adj( m_ilk_b_d_s-1, i) = 1; end k =zeros (N,1) ; for i = 1:m_i_b_d_s k( i ) = (sum(adj ( i , : ) )+sum(adj (: , i ) ) ) ; end while m_i_b_d_s < N m_i_b_d_s = m_i_b_d_s + 1; for i = 1:m_i_b_d_s − 1 P = k( i ) /sum(k) ; %Preferential attachment i f (rand (1,1) < P k( i ) = k( i ) + 2; % Why add these 2? k(m) = k(m) + 2; adj ( i ,m_i_b_d_s) = 1; adj (m_i_b_d_s, i ) = 1; end% i f end;% for end;% while m return
Can anyone help me description. Thanks......The program also must find:
(N:network size, k: link number)
*path length L=ln N/ln<k>
*clustering coefficint C=<k>/N
*gamma(γ) P(k) ~ k-γ

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Networks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by