Skip to content
Snippets Groups Projects
Commit f10ea2ed authored by Ant01n3's avatar Ant01n3
Browse files

Some work on preferential attachement generators.

Modified the old PreferentialAttachment to correctly use the
random generator of GeneratorBase (there was a bug if one changed
the random seed, it was not taken into account).

Also added a Barabàsi-Albert generator (BarabasiAlbertGenerator ...)
that does exaclty the same job but can produce graphs, not only trees.
Indeed the generator adds one node at each call to nextEvents(), for
this node it can add one edge (chosen randomly, with a bias toward
node with high degrees). However doing so creates a tree. One can
now make two ore more edges for each node added. The number of edges
generated at each node can be set. It can also be chosen randomly
(uniformly this time).

The BarabasiAlbertGenerator is stricly the same as the
PreferentialAttachmentGenerator when the number of edges added per
node is one. We can however keep the old generator for compatibility
reasons, or replace it by the BarabasiAlbertGenerator by changing
the name of one of the two.
parent 4ad586f9
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment