# Lancichinetti–Fortunato–Radicchi benchmark

Part of a series on :
Network science :
Theory :
Graph
Complex network
Contagion
Small-world
Scale-free
Community structure
Percolation
Evolution
Controllability
Graph drawing
Social capital
Link analysis
Optimization
Reciprocity
Closure
Homophily
Transitivity
Preferential attachment
Balance theory
Network effect
Social influence :
Network types :
Informational (computing)
Telecommunication
Transport
Social
Scientific collaboration
Biological
Artificial neural
Interdependent
Semantic
Spatial
Dependency
Flow
on-Chip :
Graphs :
MetricsAlgorithms :
Centrality
Degree
Motif
Clustering
Degree distribution
Assortativity
Distance
Modularity
Efficiency :
Models :
ListsCategories :
Topics
Software
Network scientists
Category:Network theory
Category:Graph theory :
vte :
Lancichinetti–Fortunato–Radicchi benchmark is an algorithm that generates benchmark networks (artificial networks that resemble real-world networks). They have a priori known communities and are used to compare different community detection methods. The advantage of the benchmark over other methods is that it accounts for the heterogeneity in the distributions of node degrees and of community sizes.

## The algorithm

The node degrees and the community sizes are distributed according to a power law, with different exponents. The benchmark assumes that both the degree and the community size have power law distributions with different exponents, $\gamma$ and $\beta$, respectively. $N$ is the number of nodes and the average degree is $\langle k\rangle$. There is a mixing parameter $\mu$, which is the average fraction of neighboring nodes of a node that do not belong to any community that the benchmark node belongs to. This parameter controls the fraction of edges that are between communities. Thus, it reflects the amount of noise in the network. At the extremes, when $\mu =0$ all links are within community links, if $\mu =1$ all links are between nodes belonging to different communities.
One can generate the benchmark network using the following steps.
Step 1: Generate a network with nodes following a power law distribution with exponent $\gamma$ and choose extremes of the distribution $k_{\min }$ and $k_{\max }$ to get desired average degree is $\langle k\rangle$.
Step 2: $(1-\mu )$ fraction of links of every node is with nodes of the same community, while fraction $\mu$ is with the other nodes.
Step 3: Generate community sizes from a power law distribution with exponent $\beta$. The sum of all sizes must be equal to $N$. The minimal and maximal community sizes $s_{\min }$ and $s_{\max }$ must satisfy the definition of community so that every non-isolated node is in at least in one community:
    $s_{\min }>k_{\min }$
    $s_{\max }>k_{\max }$
Step 4: Initially, no nodes are assigned to communities. Then, each node is randomly assigned to a community. As long as the number of neighboring nodes within the community does not exceed the community size a new node is added to the community, otherwise stays out. In the following iterations the “homeless” node is randomly assigned to some community. If that community is complete, i.e. the size is exhausted, a randomly selected node of that community must be unlinked. Stop the iteration when all the communities are complete and all the nodes belong to at least one community.
Step 5: Implement rewiring of nodes keeping the same node degrees but only affecting the fraction of internal and external links such that the number of links outside the community for each node is approximately equal to the mixing parameter $\mu$.

## Testing

Consider a partition into communities that do not overlap. The communities of randomly chosen nodes in each iteration follow a $p(C)$ distribution that represents the probability that a randomly picked node is from the community $C$. Consider a partition of the same network that was predicted by some community finding algorithm and has $p(C_{2})$ distribution. The benchmark partition has $p(C_{1})$ distribution. The joint distribution is $p(C_{1},C_{2})$. The similarity of these two partitions is captured by the normalized mutual information.
    $I_{n}={\frac {\sum _{C_{1},C_{2}}p(C_{1},C_{2})\log _{2}{\frac {p(C_{1},C_{2})}{p(C_{1})p(C_{2})}}}{{\frac {1}{2}}H(\{p(C_{1})\})+{\frac {1}{2}}H(\{p(C_{2})\})}}$
If $I_{n}=1$ the benchmark and the detected partitions are identical, and if $I_{n}=0$ then they are independent of each other.