Community Structures
LightGraphs.jl contains many algorithm to detect and analyze community structures in graphs. These include:
LightGraphs.core_periphery_deg
LightGraphs.global_clustering_coefficient
LightGraphs.label_propagation
LightGraphs.local_clustering
LightGraphs.local_clustering_coefficient
LightGraphs.maximal_cliques
LightGraphs.modularity
LightGraphs.triangles
Full Docs
LightGraphs.maximal_cliques
— Function.maximal_cliques(g)
Return a vector of vectors representing the node indices in each of the maximal cliques found in the undirected graph g
.
julia> using LightGraphs
julia> g = SimpleGraph(3)
julia> add_edge!(g, 1, 2)
julia> add_edge!(g, 2, 3)
julia> maximal_cliques(g)
2-element Array{Array{Int64,N},1}:
[2,3]
[2,1]
global_clustering_coefficient(g)
Return the global clustering coefficient of graph g
.
LightGraphs.local_clustering
— Method.local_clustering(g, v)
local_clustering(g, vs)
Return a tuple (a, b)
, where a
is the number of triangles in the neighborhood of v
and b
is the maximum number of possible triangles. If a list of vertices vs
is specified, return two vectors representing the number of triangles and the maximum number of possible triangles, respectively, for each node in the list.
This function is related to the local clustering coefficient r
by $r=\frac{a}{b}$.
LightGraphs.local_clustering_coefficient
— Method.local_clustering_coefficient(g, v)
local_clustering_coefficient(g, vs)
Return the local clustering coefficient for node v
in graph g
. If a list of vertices vs
is specified, return a vector of coefficients for each node in the list.
LightGraphs.triangles
— Method.triangles(g[, v])
triangles(g, vs)
Return the number of triangles in the neighborhood of node v
in graph g
. If a list of vertices vs
is specified, return a vector of number of triangles for each node in the list. If no vertices are specified, return the number of triangles for each node in the graph.
LightGraphs.core_periphery_deg
— Function.core_periphery_deg(g)
Compute the degree-based core-periphery for graph g
. Return the vertex assignments (1
for core and 2
for periphery) for each node in g
.
References: Lip)
LightGraphs.label_propagation
— Method.label_propagation(g, maxiter=1000)
Community detection using the label propagation algorithm. Return two vectors: the first is the label number assigned to each node, and the second is the convergence history for each node. Will return after maxiter
iterations if convergence has not completed.
References
LightGraphs.modularity
— Function.modularity(g, c)
Return a value representing Newman's modularity Q
for the undirected graph g
given the partitioning vector c
.