STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
SGLReferenceGenerators

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.

Parameters
nNumber of vertices in the generated graph.
dThe number of outgoing edges to generate for each vertex
Returns
A view over the generated graph.

! 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.

Parameters
nxSize of the x-dimension of the sparse mesh.
nySize of the y-dimension of the sparse mesh.
pProbability of adding a particular edge to the mesh.
bidirectionalTrue to add back-edges in a directed graph, false for forward edges only.
Returns
A view over the generated graph.

Example