Learn R Programming

netdiffuseR (version 1.16.2)

rgraph_ba: Barabasi-Albert model

Description

Generates a scale-free random graph.

Usage

rgraph_ba(m0 = 1L, m = 1L, t = 10L, graph = NULL)

Arguments

m0
Integer scalar. Number of initial vertices in the graph.
m
Integer scalar. Number of new edges per vertex added.
t
Integer scalar. Number of time periods (steps).
graph
Any class of accepted graph format (see netdiffuseR-graphs).

Value

  • If graph is not provided, a static graph, otherwise an expanded graph (t aditional vertices) of the same class as graph.

    The resulting graph will have graph$meta$undirected = FALSE if it is of class diffnet and attr(graph, "undirected")=FALSE otherwise.

concept

Scale-free random graph

Barabasi-Albert model

Random graph

Details

Creates an undirected random graph of size t + m0.

References

Albert-László Barabási, & Albert, R. (1999). Emergence of Scaling in Random Networks. Science, 286(5439), 509–512. http://doi.org/10.1126/science.286.5439.509

Albert-László Barabási. (2016). Network Science: (1st ed.). Cambridge University Press. Retrieved from http://barabasi.com/book/network-science

See Also

Other simulation functions: rdiffnet, rewire_graph, rgraph_er, rgraph_ws

Examples

Run this code
# Using another graph as a base graph
graph <- rgraph_ba()
graph

graph <- rgraph_ba(graph=graph)

Run the code above in your browser using DataLab