V - the graph vertex typeE - the graph edge typepublic class BarabasiAlbertGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
The generator is described in the paper: A.-L. Barabási and R. Albert. Emergence of scaling in random networks. Science, 286:509-512, 1999.
The generator starts with a complete graph of m0 nodes and grows the network by adding n-m0 additional nodes. The additional nodes are added one by one and each of them is connected to m previously added nodes, where the probability of connecting to a node is proportional to its degree.
Note that the Barabàsi-Albert model is designed for undirected networks. Nevertheless, this generator also works with directed networks where the probabilities are proportional to the sum of incoming and outgoing degrees. For a more general discussion see the paper: M. E. J. Newman. The Structure and Function of Complex Networks. SIAM Rev., 45(2):167--256, 2003.
| Constructor and Description | 
|---|
| BarabasiAlbertGraphGenerator(int m0,
                            int m,
                            int n)Constructor | 
| BarabasiAlbertGraphGenerator(int m0,
                            int m,
                            int n,
                            long seed)Constructor | 
| BarabasiAlbertGraphGenerator(int m0,
                            int m,
                            int n,
                            Random rng)Constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | generateGraph(Graph<V,E> target,
             VertexFactory<V> vertexFactory,
             Map<String,V> resultMap)Generates an instance. | 
public BarabasiAlbertGraphGenerator(int m0,
                                    int m,
                                    int n)
m0 - number of initial nodesm - number of edges of each new node added during the network growthn - final number of nodesIllegalArgumentException - in case of invalid parameterspublic BarabasiAlbertGraphGenerator(int m0,
                                    int m,
                                    int n,
                                    long seed)
m0 - number of initial nodesm - number of edges of each new node added during the network growthn - final number of nodesseed - seed for the random number generatorIllegalArgumentException - in case of invalid parameterspublic BarabasiAlbertGraphGenerator(int m0,
                                    int m,
                                    int n,
                                    Random rng)
m0 - number of initial nodesm - number of edges of each new node added during the network growthn - final number of nodesrng - the random number generator to useIllegalArgumentException - in case of invalid parameterspublic void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, Map<String,V> resultMap)
generateGraph in interface GraphGenerator<V,E,V>target - the target graphvertexFactory - the vertex factoryresultMap - not used by this generator, can be nullCopyright © 2017. All rights reserved.