Class BarabasiAlbertGenerator

java.lang.Object
org.graph4j.generators.BarabasiAlbertGenerator

public class BarabasiAlbertGenerator extends Object
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 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

      public BarabasiAlbertGenerator(Graph initialGraph, int edgesPerVertex, int numVertices)
      Parameters:
      initialGraph - the initial connected graph.
      edgesPerVertex - the number of edges per vertex.
      numVertices - the total number of vertices.
  • Method Details

    • createGraph

      public Graph createGraph()