STAPL API Reference |
Modules Classes |
Generate a scale-free network based on the Barabasi-Albert preferential attachment model. More...
Generate a scale-free network based on the Barabasi-Albert preferential attachment model.
Generates an x-by-y sparse mesh.
This implementation is based on Sanders and Schulz [^1].
Vertices with lower vertex IDs are more likely to be the target for edges. Note that if add_reverse_edge is false, the outgoing edge distribution is constant, as each vertex will have exactly 'd' edges.
The returned view owns its underlying container.
n | Number of vertices in the generated graph. |
d | The number of outgoing edges to generate for each vertex |
! https://i.imgur.com/2nwNn5l.png
Example
[^1] Scalable Generation of Scale-free Graphs. Peter Sanders, Christian Schulz. arXiv:1602.07106v1. [cs.DS] 23 Feb 2016. http://arxiv.org/pdf/1602.07106v1.pdf
The generated sparse mesh will contain x vertices in the horizontal direction and y vertices in the vertical direction. This is distributed n/p in the y-direction.
The returned view owns its underlying container.
Each edge is added with a probability of p. Thus, p = 1 generates a complete mesh, and p = 0.5 generates a mesh with 50% of the edges of a complete mesh.
nx | Size of the x-dimension of the sparse mesh. |
ny | Size of the y-dimension of the sparse mesh. |
p | Probability of adding a particular edge to the mesh. |
bidirectional | True to add back-edges in a directed graph, false for forward edges only. |
Example