
Last chance! 50% off unlimited learning
Sale ends in
This is a growing network model, which resembles of how the forest fire spreads by igniting trees close by.
sample_forestfire(nodes, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE)
The number of vertices in the graph.
The forward burning probability, see details below.
The backward burning ratio. The backward burning
probability is calculated as bw.factor*fw.prob
.
The number of ambassador vertices.
Logical scalar, whether to create a directed graph.
A simple graph, possibly directed if the directed
argument is
TRUE
.
The forest fire model intends to reproduce the following network characteristics, observed in real networks:
Heavy-tailed in-degree distribution.
Heavy-tailed out-degree distribution.
Communities.
Densification power-law. The network is densifying in time, according to a power-law rule.
Shrinking diameter. The diameter of the network decreases in time.
The network is generated in the following way. One vertex is added at a
time. This vertex connects to (cites) ambs
vertices already present
in the network, chosen uniformly random. Now, for each cited vertex
We generate two random
number, fw.prob
, bw.factor
.) The new vertex cites
The same procedure is applied to all the newly cited vertices.
Jure Leskovec, Jon Kleinberg and Christos Faloutsos. Graphs over time: densification laws, shrinking diameters and possible explanations. KDD '05: Proceeding of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, 177--187, 2005.
barabasi.game
for the basic preferential attachment
model.
# NOT RUN {
g <- sample_forestfire(10000, fw.prob=0.37, bw.factor=0.32/0.37)
dd1 <- degree_distribution(g, mode="in")
dd2 <- degree_distribution(g, mode="out")
plot(seq(along=dd1)-1, dd1, log="xy")
points(seq(along=dd2)-1, dd2, col=2, pch=2)
# }
Run the code above in your browser using DataLab