This is a package for generating Lancichinetti-Fortunato-Radicchi model benchmarks graphs, which are widely used in the study of community detection algorithms.
Installation is straightforward. First, enter Pkg mode by hitting ]
, and then run the following command:
pkg> add LFRBenchmarkGraphs
Import the necessary packages.
using GraphMakie, CairoMakie, LFRBenchmarkGraphs, Graphs
Generate an example LFR graph using the LFR benchmark. The LFR benchmark is a popular benchmark for community detection algorithms. It generates graphs with a power-law degree distribution and a community structure.
g,cid = lancichinetti_fortunato_radicchi(1000, 15, 40);
We use the GraphMakie
package to visualize the graph, with the default layout algorithm.
f = Figure()
ax = Axis(f[1, 1], title = "LFR graph", xticklabelsvisible = false, yticklabelsvisible = false)
graphplot!(ax, g; edge_width = 0.1, node_color = cid, node_size = 6)
colsize!(f.layout, 1, Aspect(1, 1.0))
resize_to_layout!(f)
f