This function generates networks from the generalized Barabási-Albert model. In this model, the preferential attachment function is power-law, i.e. \(A_k = k^\alpha\), and node fitnesses are all equal to \(1\). It is a wrapper of the more powerful function generate_net
.
generate_BA(N = 1000,
num_seed = 2 ,
multiple_node = 1 ,
m = 1 ,
alpha = 1)
The output is a PAFit_net
object, which is a List contains the following four fields:
a three-column matrix, where each row contains information of one edge, in the form of (from_id, to_id, time_stamp)
. from_id
is the id of the source, to_id
is the id of the destination.
a string indicates whether the network is "directed"
or "undirected"
.
a numeric vector contains the true PA function.
fitness values of nodes in the network. The fitnesses are all equal to \(1\).
Integer. Total number of nodes in the network (including the nodes in the seed graph). Default value is 1000
.
Integer. The number of nodes of the seed graph (the initial state of the network). The seed graph is a cycle. Default value is 2
.
Positive integer. The number of new nodes at each time-step. Default value is 1
.
Positive integer. The number of edges of each new node. Default value is 1
.
Numeric. This is the attachment exponent in the attachment function \(A_k = k^\alpha\).
Thong Pham thongphamthe@gmail.com
1. Albert, R. & Barabási, A. (1999). Emergence of scaling in random networks. Science, 286,509–512 (https://www.science.org/doi/10.1126/science.286.5439.509).
For subsequent estimation procedures, see get_statistics
.
For other functions to generate networks, see generate_net
, generate_ER
, generate_BB
and generate_fit_only
.
library("PAFit")
# generate a network from the BA model with alpha = 1, N = 100, m = 1
net <- generate_BA(N = 100)
str(net)
plot(net)
Run the code above in your browser using DataLab