Defined in File LFRGenerator.hpp
public NetworKit::Algorithm
(Class Algorithm)
public NetworKit::StaticGraphGenerator
(Class StaticGraphGenerator)
The LFR clustered graph generator as introduced by Andrea Lancichinetti, Santo Fortunato, and Filippo Radicchi.
The community assignment follows the algorithm described in “Benchmark graphs for testing community detection algorithms”. The edge generation is however taken from their follow-up publication “Benchmarks for testing community detection algorithms on
directed and weighted graphs with overlapping communities”. Parts of the implementation follow the choices made in their implementation which is available at
https://sites.google.com/site/andrealancichinetti/software but other parts differ, for example some more checks for the realizability of the community and degree size distributions are done instead of heavily modifying the distributions.The edge-switching markov-chain algorithm implementation in NetworKit is used which is different from the implementation in the original LFR benchmark.
Public Functions
Initialize the LFR generator for n nodes.
Note
You need to set a degree sequence, a community size sequence and a mu using the additionally provided set- or generate-methods.
n – The number of nodes.
Set the given degree sequence.
degreeSequence – The degree sequence that shall be used by the generator
Generate and set a power law degree sequence using the given average and maximum degree with the given exponent.
avgDegree – The average degree that shall be reached.
maxDegree – The maximum degree that shall be generated.
nodeDegreeExp – The (negative) exponent of the powerlaw degree sequence.
Set the given community size sequence.
communitySizeSequence – The community sizes that shall be used.
Set the partition, this replaces the community size sequence and the random assignment of the nodes to communities.
zeta – The partition to use
Generate a powerlaw community size sequence with the given minimum and maximum size and the given exponent.
minCommunitySize – The minimum community size to generate
maxCommunitySize – The maximum community size to generate
communitySizeExp – The (negative) exponent of the power law community size sequence
Set the mixing parameter, this is the fraction of neighbors of each node that do not belong to the node’s own community.
mu – The mixing parameter that shall be set.
Set the mixing parameter separately for each node. This is for each node the fraction of neighbors that do not belong to the node’s own community.
mu – The mixing parameter for each node.
Set the internal degree of each node using a binomial distribution such that the expected mixing parameter is the given mu.
The mixing parameter is for each node the fraction of neighbors that do not belong to the node’s own community.
mu – The expected mu that shall be used.
Generates the graph and the community structure. The algorithm is not parallel.
Returns the generated graph using move semantics.
The generated graph.