3.55556

3.6 | 9 ratings Rate this file 55 Downloads (last 30 days) File Size: 60.73 KB File ID: #11947
image thumbnail

B-A Scale-Free Network Generation and Visualization

by Mathew George

 

12 Aug 2006 (Updated 27 Apr 2007)

A set of functions designed to create and visualize scale-free networks.

| Watch this File

File Information
Description

*Description and Cautions

-The SFNG m-file is used to simulate the B-A algorithm and returns scale-free networks of given node sizes. Understanding the B-A algorithm is key to using this code to its fullest. Due to Matlab resource limitations, it may not be possible to generate networks much larger than 15000 nodes, and increasing the mlinks variable increases processing time severely. This code was developed so that one could generate a network of small size, and then use that network as a seed to build a greater sized network, continuing this process until the actual desired network size is reached. This is for processor and time management purposes. However, realize that the initial seed does not have to have scale-free properties, while the later seeds may happen to have these properties. Therefore, it is prudent not to make the initial seed size much larger than a few nodes (most commonly 5 interconnected nodes). In addition, the mlinks should be kept constant throughout the creation of the scale-free network.

-The PLplot m-file takes a scale-free network in adjacency matrix format and draws a best fit line to the frequency of degrees distribution of the nodes. Degree is the number of links that connect to and from a single node For scale-free networks, the frequency of degrees distribution forms a power-law curve, with an exponent usually between -2 and -3. This code is designed to allow only non-zero frequencies to be graphed in log-log format. The function returns the equation of the power-law fit in a cfit variable.

-The CNet m-file function creates a network graph using the gplot function with circular coordinates. It allows for a simple, yet intuitive, visualization of a given network.

*Parameters

SFNG

-Nodes is the desired network size, including the seed network size (i.e. Nodes minus seed network size equals the number of nodes to be added).

-mlinks controls the number of links a new node can make to the existing network nodes.

-seed is the original network to which the B-A algorithm links additional nodes with a specific preferential attachment procedure. This undirected adjacency matrix can be created manually, or one could use the Adjacency Matrix GUI. Each node must have at least one link. The seed variable can be replaced with a developed scale-free network to generate a larger one. Make sure the new Nodes variable is greater than the size of the seed network.

PLplot
-Net is the input network which is to be graphed.

CNet
-Net is the input network which is to be graphed.

Note that variables Nodes, mlinks, and size must be whole numbers and variables seed and Net must be undirected adjacency matrices. The diagonal elements of any adjacency matrix used with these functions must all be zero.

*Sample Output

Here is a small example to demonstrate how to use the code. This code creates a seed network of 5 nodes, generates a scale-free network of 300 nodes from the seed network, and then performs the two graphing procedures.

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(300, 1, seed);
PL_Equation = PLplot(Net)
CNet(Net)

*References

One explanation of the B-A Algorithm can be found on this PDF website http://arxiv.org/PS_cache/cond-mat/pdf/0107/0107420.pdf

Undirected Adjecency Matrices are defined on Wikipedia.org http://en.wikipedia.org/wiki/Adjacency_matrix

The Adjacency Matrix GUI file by Steve Chuang can be found on the Matlab File Exchange http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=6937&objectType=file

*Acknowledgements
 
Special thanks to Mark Ballerini with the Massapequa High School Science Research Program and Zoltan Dezso at the University of Notre Dame for their invaluable help in researching network theory as well as to my family for providing motivation and encouragement in pursuing science.

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
22 Aug 2006 Deng Mingsen

It could not download now

12 Dec 2006 P S

Link to zip file is deal

16 Jan 2007 marcel blattner

Would be nice if one could download the file !!!!!!!!

05 Apr 2007 yu xue

Ok! Thank you

17 Jun 2007 tian wei

It's a good code for the network analysis!Thanks for you hard work!

24 Jul 2007 Mathew George

For those keeping up, this file has been fixed and can now be downloaded and the Published m-file can be viewed now.

Thanks for your interest!

26 Nov 2007 mark kazmierski

I use Matlab2007b and while executing an example I get an error: Undefined function or method 'fit' for input arguments of type 'double'.

Any idea where I can find fit function?

16 Oct 2008 Tingting Zhou

It is good. Unfortunately my case is to generate the directed network and the mlinks would be more than 5. I'd like to get your opinion on how to modify the code in this case. Many thanks.

13 Nov 2009 Budhachandra Khundrakpam

The code is elegant. Congrats for the good work. My problem is I am interested in generating large SF Network of the size 50000 X 50000. I tried out different iterations, it seems in matlab, the in-built command zeros can't take size more than 17000 X 17000. Above this, it shows out of memory. Could you suggest how to solve this.

13 Oct 2010 Wang

Thank you!

15 Apr 2011 Thi Ha Kyaw

Thank you very much, Mathew George. With your codes and a little bit of my modification, I have managed to produce a new type of complex network model. It saves my time a lot. Thanks for the posting.

26 May 2011 Nizar Dahir

Very nice work thank you,
I just wanted to remark that this model of complex networks does not incorporates the "rich get richer property".

when attaching nodes to the networks the propability of node attachmnet should be proportional to the exsiting node degrees.

Please login to add a comment or rating.
Updates
27 Apr 2007

Broken Link when first submitted. Resubmitting upon community request.

Tag Activity for this File
Tag Applied By Date/Time
statistics Mathew George 22 Oct 2008 08:34:52
probability Mathew George 22 Oct 2008 08:34:52
scale free network visual graph power law generate ba algorithm Mathew George 22 Oct 2008 08:34:52
scale free network visual graph power law generate ba algorithm Michiel 26 Jan 2010 10:15:21
statistics Michiel 26 Jan 2010 10:15:25
probability Michiel 26 Jan 2010 10:15:27
scale free network visual graph power law generate ba algorithm Olivia Howe 15 Feb 2011 08:15:35
probability Olivia Howe 15 Feb 2011 08:15:40

Contact us at files@mathworks.com