Filter löschen
Filter löschen

scale-free network help

2 Ansichten (letzte 30 Tage)
Nhl
Nhl am 30 Jun. 2014
Bearbeitet: Nhl am 3 Jul. 2014
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-γ

Antworten (0)

Kategorien

Mehr zu Networks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by