无标度网络(或称无尺度网络)的概念是随着对复杂网络的研究而出现的。“网络”其实就是数学中图论研究的图,由一顶点以及它们之间所连的边构成。在网络理论中则换一套说法,用“节点”代替“顶点”,用“连结”代替“边”。复杂网络的概念,是用来描述由大量节点以及这些节点之间错综复杂的联系所构成的网络。ER模型随机网络有一个重要特性,就是虽然节点之间的连接是随机形成的,但最后产生的网络的度分布是高度平等的。度分布是指节点的度的分布情况。在网络中,每个节点都与另外某些节点相连,这种连接的数目叫做这个节点的度。在网络中随机抽取一个节点,它的度是多少呢?这个概率分布就称为节点的度分布。 自二十世纪60年代开始,对复杂网络的研究主要集中在随机网络上。随机网络,又称随机图,是指通过随机过程制造出的复杂网络。最典型的随机网络是保罗·埃尔德什和阿尔弗雷德·雷尼提出的ER模型。ER模型是基于一种“自然”的构造方法:假设有n个节点,并假设每对节点之间相连的可能性都是常数。这样构造出的网络就是ER模型网络。
中国香功Matlab程序如下:
SFNG:
拉大剧
function SFNet = SFNG(Nodes, mlinks, seed)
seed = full(seed);
pos = length(seed);
rand('state',sum(100*clock));
Net = zeros(Nodes, Nodes, 'single');
Net(1:pos,1:pos) = seed;
sumlinks = sum(sum(Net));
while pos < Nodes
pos = pos + 1;
linkage = 0;
while linkage ~= mlinks
rnode = ceil(rand * pos);
deg = sum(Net(:,rnode)) * 2;
rlink = rand * 1;
农业生产合作社示范章程草案 if rlink < deg / sumlinks && Net(pos,rnode) ~= 1 && Net(rnode,pos) ~= 1
Net(pos,rnode) = 1;
Net(rnode,pos) = 1;
linkage = linkage + 1;
sumlinks = sumlinks + 2;
end
end
end
clear Nodes deg linkage pos rlink rnode sumlinks mlinks
SFNet = Net;
CNET:
function CNet(Net)
format compact
format long e
theta=linspace(0,2*pi,length(Net)+1);
xy = zeros(length(Net)+1,2);
x = cos(theta);
y = sin(theta);
xy(1:length(Net)+1,1) = x(1:length(Net)+1);
xy(1:length(Net)+1,2) = y(1:length(Net)+1);
figure, gplot(Net,xy,'.-');
set(gcf, 'Color', [1 1 1]);
axis('equal');
xlim([-1.1 1.1]);
ylim([-1.1 1.1]);
axis off;
Plplot:
function equation = PLplot(Net)
% Power-Law Degree Distribution Graphing
% Finds out how many connections each node has
connections = single(sum(Net));
刘顺元
% Initialize variable that will hold how many nodes have each degree
frequency = single(zeros(1,length(Net)));
% Initialize variable that will hold the graphing quanitites
plotvariables = zeros(2,length(Net));
P = [];
for T = 1:length(Net)朱瑞峰近况
% Variable will be used as a list of possible degrees a node can have
P(1,T) = T;
if connections(1,T) ~= 0
frequency(1,connections(1,T)) = frequency(1,connections(1,T)) + 1;
end
end
for c = 1:length(frequency)
% Disregard degrees with no frequency
if frequency(1,c) ~= 0
[X,Y] = find(plotvariables == 0);
plotvariables(1,min(Y)) = P(1,c);
plotvariables(2,min(Y)) = frequency(1,c);
end
end
% Find the last non-zero element in plotvariables
for d = 1:length(plotvariables)
if plotvariables(1,d) == 0 & plotvariables(2,d) == 0
break
end
end
x = plotvariables(1,1:d-1);
y = plotvariables(2,1:d-1);
[g,f,b] = fit(x',y','power1');
H = loglog(x,y,'r+');
hold on;
plot(g);
xlim([.9 (max(sum(Net)) + 10)]);
倪勤ylim([.9 length(Net)]);
legend off;
H = xlabel('Degrees');
H = ylabel('Frequency');
% Use this feature to extract variables from cfit variables
%a = g.a;
%b = g.b;
%rsquare = f.rsquare;
equation = g;
pubfile:
seed =[0 1 0 0 1;1 0 0 1 0;0 0 0 1 0;0 1 1 0 0;1 0 0 0 0]
Net = SFNG(80, 1, seed);
PL_Equation = PLplot(Net)
CNet(Net)
有80个节点的模型网络