在小世界网络中的聚类
聚类可以用来量化网络的抗干扰性,并且高度聚类是华兹(Watts)与史楚盖兹(Strogatz)的小世界网络捕捉到的一大特性. 在流行病学中,即使一个稳健的网络遭到微扰也可以让疾病进行同样的传播.
RandomGraph[WattsStrogatzGraphDistribution[40, 0.05, 5]]GlobalClusteringCoefficient[%]{graphs, coeffs} = Transpose[SortBy[{#, GlobalClusteringCoefficient[#]}& /@ RandomGraph[WattsStrogatzGraphDistribution[30, 0.1, 3], {10000}], Last]];min = Min[coeffs];max = Max[coeffs];nf = Nearest[coeffs -> graphs];values = Range[min, max, (max - min) / (4 ^ 2 - 1)];Grid[Partition[Map[Annotate[First[nf[#]] 1, {VertexStyle -> Directive[White, EdgeForm[White]], EdgeStyle -> White, Background -> ColorData[{"SolarColors", "Reversed"}, Rescale[#, {min, max}]], ImageSize -> {100, 100}}]&, values], 4]]