WOLFRAM NOTEBOOK

Examples in Multiparadigm Data Science:
GlobalClusteringCoefficient

A simulation of information diffusion in a social network using density heat maps
to analyze connectivity and nearness in a small-world network.
GlobalClusteringCoefficient efficiently calculates the connectivity of undirected graphs, directed graphs
and multigraphs from SocialMediaData, using ColorData and Grid for easy visual interpretation of the results.
Define a function to compute the GlobalClusteringCoefficient of a set of random graphs:
In[1]:=
{graphs,coeffs}=Transpose[SortBy[{#,GlobalClusteringCoefficient[#]}&/@RandomGraph[WattsStrogatzGraphDistribution[200,0.1,3],{10000}],Last]];
Create a heat map of selected graphs with respect to the coefficient values using ColorData and Grid:
In[2]:=
min=Min[coeffs];max=Max[coeffs];nf=Nearest[coeffsgraphs];values=Range[min,max,(max-min)/(4^2-1)];Grid[Partition[Map[SetProperty[First[nf[#]]1,{VertexStyleDirective[White,EdgeForm[White]],EdgeStyleWhite,BackgroundColorData[{"SolarColors","Reversed"},Rescale[#,{min,max}]],ImageSize{100,100}}]&,values],4]]
Out[2]=

Go Further:

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.