【实例简介】用matlab编程实现无标度度网络算法
【实例截图】
【核心代码】
% This is the BA_Scale Model by Fan Jin.
% At first there are only m nodes and no edge, then the m 1st node is
% connected with the above m nodes
% usage: Nodes = BA(N,m)
% the parameter:N----network size
% m----a new node with m new edges
% can randomly initialize the N and the m by yourself
% the diagonal elements of the matrix also equal to -degree
% Nodes----the final coupling matrix
% The following message(s) may not be displayed correctly for they contain Chinese charactors.
% list----生成的一个辅助向量,该向量中的元素为每条边端点的节点。for example, 假设网络中节点4的度为7,则在list向量中会存在7个4,而这7个4的位置不一定是连续在一起的。
% preferential attachment体现在随机的从list向量中选取元素,选中哪个元素,该元素表示的节点即被选中。由于list向量中每个节点的个数与它的度有关,因此,度越大的点被选中的概率越大。
function [Nodes,Cii]=BA(N,m)
% N&#