gives the list of local clustering coefficients of all vertices in the graph g.
LocalClusteringCoefficient[g,v]
gives the local clustering coefficient of the vertex v in the graph g.
LocalClusteringCoefficient[{vw,…},…]
uses rules vw to specify the graph g.
LocalClusteringCoefficient
gives the list of local clustering coefficients of all vertices in the graph g.
LocalClusteringCoefficient[g,v]
gives the local clustering coefficient of the vertex v in the graph g.
LocalClusteringCoefficient[{vw,…},…]
uses rules vw to specify the graph g.
Details
- LocalClusteringCoefficient is also known as clustering coefficient.
- The local clustering coefficient of the vertex v is the fraction of pairs of neighbors of v that are connected over all pairs of neighbors of v.
- LocalClusteringCoefficient works with undirected graphs, directed graphs, and multigraphs.
Examples
open all close allBasic Examples (2)
Compute local clustering coefficients:
g = ExampleData[{"NetworkGraph", "Friendship"}];LocalClusteringCoefficient[g]HighlightGraph[g, VertexSize -> Thread[VertexList[g] -> %]]Distribution of local clustering coefficients in a graph:
g = RandomGraph[BarabasiAlbertGraphDistribution[10000, 50]];Histogram[LocalClusteringCoefficient[g]]Scope (6)
LocalClusteringCoefficient works with undirected graphs:
LocalClusteringCoefficient[[image]]LocalClusteringCoefficient[[image]]LocalClusteringCoefficient[[image]]Find the local clustering coefficient of a vertex:
LocalClusteringCoefficient[[image], 1]Use rules to specify the graph:
LocalClusteringCoefficient[{1 -> 2, 1 -> 3, 2 -> 3, 2 -> 4, 3 -> 1, 3 -> 2, 3 -> 4}]LocalClusteringCoefficient works with large graphs:
g = RandomGraph[WattsStrogatzGraphDistribution[10000, 0.05, 20]];LocalClusteringCoefficient[g]//Short//TimingApplications (2)
Local clustering coefficients of the internet at the level of autonomous systems:
g = ExampleData[{"NetworkGraph", "Internet"}];c = LocalClusteringCoefficient[g];
Histogram[c]Plot the mean as a function of the vertex degree:
d = Union[VertexDegree[g]];ListLogLogPlot[Table[{i, Mean[Pick[c, VertexDegree[g], i]]}, {i, d}]]Local clustering coefficients of Zachary's Karate Club:
g = ExampleData[{"NetworkGraph", "ZacharyKarateClub"}]c = LocalClusteringCoefficient[g]Highlight vertices based on their local clustering coefficients:
HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][c[[i]]]], {i, VertexCount[g]}]]Properties & Relations (4)
The local clustering coefficients take values between 0 and 1:
g = RandomGraph[BarabasiAlbertGraphDistribution[50, 3]]{Min[LocalClusteringCoefficient[g]], Max[LocalClusteringCoefficient[g]]}The local clustering coefficient of a vertex with less than two neighbors is 0:
Graph[{12, 23}, VertexShapeFunction -> "Name"]LocalClusteringCoefficient[%, 3]All local clustering coefficients of a complete graph with at least three vertices are 1:
CompleteGraph[5]LocalClusteringCoefficient[%]MeanClusteringCoefficient gives the mean of LocalClusteringCoefficient:
Graph[{12, 13, 23, 24, 34}]{MeanClusteringCoefficient[%], Mean[LocalClusteringCoefficient[%]]}Related Guides
Text
Wolfram Research (2012), LocalClusteringCoefficient, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalClusteringCoefficient.html (updated 2015).
CMS
Wolfram Language. 2012. "LocalClusteringCoefficient." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/LocalClusteringCoefficient.html.
APA
Wolfram Language. (2012). LocalClusteringCoefficient. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LocalClusteringCoefficient.html
BibTeX
@misc{reference.wolfram_2026_localclusteringcoefficient, author="Wolfram Research", title="{LocalClusteringCoefficient}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/LocalClusteringCoefficient.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_localclusteringcoefficient, organization={Wolfram Research}, title={LocalClusteringCoefficient}, year={2015}, url={https://reference.wolfram.com/language/ref/LocalClusteringCoefficient.html}, note=[Accessed: 13-June-2026]}