MATLAB package to generate synthetic and empirical networks.
For some standard networks, it uses Python's networkx library for standard network generation. For other networks, it borrows code from other sources (e.g., Ann's website and the Brain Connectivity Toolbox). You can also easily add other methods for generating networks.
Clone network-generator
to your MATLAB environment. Rename directory to +net
. No need to add to path.
You need python and networkx installed for some topologies (see API).
To generate a topology, call net.generate()
. Specify the topology and any other parameters in name-value pairs (à la plot
). For example,
n = net.generate('erdosrenyi',...
'n',20,...
'p',0.3,...
'dir',true);
imagesc(n.A)
To generate a weight distribution, call net.distr_weights()
. Specify the topology, the weight distribution, and any other parameters in name-value pairs. For example,
w = net.distr_weights(n.A,'truncnorm',...
'mu',0,...
'sigma',0.1,...
'range',[0 2]);
histogram(w.A(w.A>0))
For topologies and their parameters, see API.
- Erdos-Renyi network
- Random network
- Weighted random network
- Random geometric network
- Watts-Strogatz network
- Scale-free network
- Modular network
- Modular small-world network
- Hierarchical modular small-world network
- Generative growth network
- Multivariate autoregressive model
- Euclidean distance
- Graphical lasso
- Weighted Stochastic Block Model
- Write a function that generates a topology, and add to the
+generators
directory (see examples there). Add any auxiliaury code in+imported
. - Update
+generators/README.md
. - Submit a pull request if you want to share your code.
- Write a function that generates a distribution of weights, and add to the
+weights
directory (see examples there). - Update
+weights/README.md
. - Submit a pull request if you want to share your code.