Package org.graph4j.generators
Class BarabasiAlbertGenerator
java.lang.Object
org.graph4j.generators.BarabasiAlbertGenerator
The Barabási–Albert (BA) model generates random scale-free networks using a
preferential attachment mechanism.
The network begins with an initial graph. New vertices are added to the
network, being connected to existing vertices with a probability that is
proportional to the number of links that the existing vertices already have.
Vertices with higher degrees ("hubs") will quickly accumulate even more
neighbors, while vertices with lower degrees are unlikely to be chosen
as the destination for a new edge. The new vertices have a "preference" to
attach themselves to the already heavily linked vertices.
- Author:
- Cristian Frăsinaru
-
Constructor Summary
ConstructorsConstructorDescriptionBarabasiAlbertGenerator(int initialNumVertices, int edgesPerVertex, int numVertices) The initial graph will be a complete graph.BarabasiAlbertGenerator(Graph initialGraph, int edgesPerVertex, int numVertices) -
Method Summary
-
Constructor Details
-
BarabasiAlbertGenerator
public BarabasiAlbertGenerator(int initialNumVertices, int edgesPerVertex, int numVertices) The initial graph will be a complete graph.- Parameters:
initialNumVertices- the initial number of vertices.edgesPerVertex- the number of edges per vertex.numVertices- the total number of vertices.
-
BarabasiAlbertGenerator
- Parameters:
initialGraph- the initial connected graph.edgesPerVertex- the number of edges per vertex.numVertices- the total number of vertices.
-
-
Method Details
-
createGraph
-