LocalClusteringCoefficient - Maple Help

GraphTheory

 LocalClusteringCoefficient
 compute the local clustering coefficient

 Calling Sequence LocalClusteringCoefficient(G) LocalClusteringCoefficient(G, v)

Parameters

 G - graph v - (optional) a vertex of G

Description

 • LocalClusteringCoefficient returns the local clustering coefficient for a specified vertex in the given graph G, or if no vertex is specified, a list of the coefficients for each vertex in G.
 • The local clustering coefficient is a number between 0 and 1 measuring how close the neighborhood of v is to a clique.
 • For a node v with n neighbors, the local cluster coefficient is the number of edges between neighbors of v (counting undirected edges twice) and the number $n\left(n-1\right)$, which is the maximum number of (directed) edges possible between n neighbors.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(\left[1,2,3,4,5,6\right],\left\{\left\{1,3\right\},\left\{1,6\right\},\left\{2,4\right\},\left\{2,6\right\},\left\{3,6\right\},\left\{4,5\right\},\left\{4,6\right\},\left\{5,6\right\}\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 6 vertices and 8 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G\right)$

Compute the clustering coefficient for vertex 6

 > $\mathrm{LocalClusteringCoefficient}\left(G,6\right)$
 $\frac{{3}}{{10}}$ (2)

Produce a list of all local clustering coefficients

 > $\mathrm{LocalClusteringCoefficient}\left(G\right)$
 $\left[{1}{,}{1}{,}{1}{,}\frac{{2}}{{3}}{,}{1}{,}\frac{{3}}{{10}}\right]$ (3)

Compatibility

 • The GraphTheory[LocalClusteringCoefficient] command was introduced in Maple 2016.