Function Repository Resource:

ClusteringCoefficientsByDegree

Source Notebook

Collect the clustering coefficients of a graph by vertex degree

Contributed by: Soutick Saha

ResourceFunction["ClusteringCoefficientsByDegree"][graph]

returns the Association of VertexDegree and LocalClusteringCoefficient in a graph Graph.

ResourceFunction["ClusteringCoefficientsByDegree"][graph]

returns LocalClusteringCoefficient values for each vertex grouped by VertexDegree.

Details

The output is an Association of VertexDegree keys and lists of LocalClusteringCoefficient values.
In many real-world networks, like the internet and traffic networks, the mean LocalClusteringCoefficient values decrease with the VertexDegree. ResourceFunction["ClusteringCoefficientsByDegree"] helps to visualize this effect.

Examples

Basic Examples (2) 

ClusteringCoefficientsByDegree of GolombGraph:

In[1]:=
graph = GraphData["GolombGraph"]
Out[1]=
In[2]:=
scaleFreeNetwork = ResourceFunction["ClusteringCoefficientsByDegree"][graph]
Out[2]=

Compute the values for a directed graph:

In[3]:=
graph = Graph[
  DirectedEdge @@@ RandomSample[Tuples[Range[15], {2}], 120]]
Out[3]=
In[4]:=
ResourceFunction["ClusteringCoefficientsByDegree"][graph]
Out[4]=

Neat Examples (1) 

Visualize the ClusteringCoefficientsByDegree of the gene co-expression network in a rat brain:

In[5]:=
Short[brainGeneCoExpressionNetwork = ResourceFunction["ClusteringCoefficientsByDegree"][
   ResourceData["Rat Brain Graph 1"]]]
Out[5]=
In[6]:=
ListLogLogPlot[Mean /@ brainGeneCoExpressionNetwork, Sequence[
 AxesLabel -> {"VertexDegree", "Mean LocalClusteringCoefficient"}, ImageSize -> 600]]
Out[6]=

Publisher

WolframChemistry

Version History

  • 1.0.0 – 06 November 2024

Source Metadata

Related Resources

License Information