Community Structures

Erdos.jl contains many algorithm to detect and analyze community structures in graphs.

Erdos.local_clusteringFunction
local_clustering(g, vlist = vertices(g))

Returns two vectors, respectively containing the first and second result of local_clustering_coefficients(g, v) for each v in vlist.

source
Erdos.local_clusteringMethod
local_clustering(g, v)

Returns 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. It is related to the local clustering coefficient by r=a/b.

source
Erdos.trianglesFunction
triangles(g, vlist = vertices(g))

Returns a vector containing the number of triangles for vertices vlist.

source
Erdos.trianglesMethod
triangles(g, v)

Returns the number of triangles in the neighborhood for node v.

source
Erdos.core_periphery_degMethod
core_periphery_deg(g)

A simple degree-based core-periphery detection algorithm (see Lip). Returns the vertex assignments (1 for core and 2 for periphery).

source
Erdos.modularityMethod
modularity(g, c)

Computes Newman's modularity Q for graph g given the partitioning c.

source
Erdos.maximal_cliquesMethod

Finds all maximal cliques of an undirected graph.

julia> using Erdos
julia> g = Graph(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]
source
Erdos.community_detection_betheFunction
community_detection_bethe(g::AGraph, k=-1; kmax=15)

Community detection using the spectral properties of the Bethe Hessian matrix associated to g (see Saade et al.). k is the number of communities to detect. If omitted or if k < 1 the optimal number of communities will be automatically selected. In this case the maximum number of detectable communities is given by kmax. Returns a vector containing the vertex assignments.

source
Erdos.label_propagationMethod
label_propagation(g; maxiter=1000)

Community detection using the label propagation algorithm (see Raghavan et al.). g is the input Graph, maxiter is the maximum number of iterations. Returns a vertex assignments and the convergence history

source