({{, (RefLink[DegreeGraphDistribution, paclet:ref/DegreeGraphDistribution])[dlist] 
represents a degree graph distribution with vertex degree dlist.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[DegreeGraphDistribution, paclet:ref/DegreeGraphDistribution]) can be used with such functions as (RefLink[RandomGraph, paclet:ref/RandomGraph]) and (RefLink[GraphPropertyDistribution, paclet:ref/GraphPropertyDistribution]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Generate a pseudorandom graph:

RandomGraph[DegreeGraphDistribution[{4,4,3,3,2,2}]]

Probability density functions of the global clustering coefficient:

𝒟[n_,k_]:=GraphPropertyDistribution[GlobalClusteringCoefficient[g],g\[Distributed]DegreeGraphDistribution[ConstantArray[k,n]]]

SmoothHistogram[Table[RandomVariate[𝒟[20,k],500],{k,5,8}],Automatic, "PDF",Filling->Axis]

OpenersExampleSection1(Spacer1)Scope  (3)

Generate simple undirected graphs:

RandomGraph[DegreeGraphDistribution[{4,4,2,2,1,1}]]

Generate a set of pseudorandom graphs:

RandomGraph[DegreeGraphDistribution[{3,3,2,2,1,1}],4]

Compute probabilities and statistical properties:

𝒟=GraphPropertyDistribution[Length[First[ConnectedComponents[g]]]/VertexCount[g],g\[Distributed]DegreeGraphDistribution[{3,3,2,2,1,1}]];

NProbability[x>0.95,x\[Distributed]𝒟]

OpenersExampleSection3(Spacer1)Applications  (2)

In a medical study of an outbreak of influenza, each subject reported its number of potentially contagious interactions within the group. Simulate interaction networks:

𝒢=DegreeGraphDistribution[{2,4,4,4,3,3,2}];

RandomGraph[𝒢,4]

Find the probability that subject 1 has interacted with subject 2:

NProbability[x==1,x\[Distributed]GraphPropertyDistribution[Boole[EdgeQ[g,1\[UndirectedEdge]2]],g\[Distributed]𝒢]]

Analyze whether a network is drawn from a degree graph distribution:

g=ExampleData[{"NetworkGraph","ZacharyKarateClub"}]

𝒢=DegreeGraphDistribution[VertexDegree[g]];

Compare the empirical and theoretical basic properties:

{VertexCount[g],EdgeCount[g]}

(Subscript[𝒟, 1])=GraphPropertyDistribution[VertexCount[h],h\[Distributed]𝒢];
(Subscript[𝒟, 2])=GraphPropertyDistribution[EdgeCount[h],h\[Distributed]𝒢];
{Mean[(Subscript[𝒟, 1])],Mean[(Subscript[𝒟, 2])]}

The empirical and theoretical global clustering coefficient:

N[GlobalClusteringCoefficient[g]]

𝒟=GraphPropertyDistribution[GlobalClusteringCoefficient[h],h\[Distributed]𝒢];
N[Mean[𝒟]]

OpenersExampleSection4(Spacer1)Properties & Relations  (7)

Distribution of the number of vertices:

𝒟[dlist_]:=GraphPropertyDistribution[VertexCount[g],g\[Distributed]DegreeGraphDistribution[dlist]]

𝒟[{5,2,2,5,3,4,3}]

Distribution of the number of edges:

𝒟[dlist_]:=GraphPropertyDistribution[EdgeCount[g],g\[Distributed]DegreeGraphDistribution[dlist]]

𝒟[{5,2,2,5,3,4,3}]

Distribution of the degree of a vertex:

dlist={14,13,12,11,11,11,10,10,10,9,8,8,7,6,5,5,5,5,5,5};

f[g_?GraphQ]:=RandomChoice[VertexDegree[g]]

RandomVariate[GraphPropertyDistribution[f[g],g\[Distributed]DegreeGraphDistribution[dlist]],10]

Probability density function:

𝒟=EmpiricalDistribution[dlist];

DiscretePlot[PDF[𝒟,x],{x,0,15},ExtentSize->1/2]

The mean of the degree of a vertex:

Mean[𝒟]

The sum of the degree sequence of a graph is always even:

ds1={3,3,2,2,1,1};
Total[ds1]

RandomGraph[DegreeGraphDistribution[ds1]]

Degree sequences with odd total degree cannot be realized as a graph:

ds2={3,3,2,2,2,1};
Total[ds2]

RandomGraph[DegreeGraphDistribution[ds2]]

(m,(Subscript[d, 2]),…,(Subscript[d, n])) is a degree sequence of a simple graph iff ((Subscript[d, 2])-1,…,(Subscript[d, m+1])-1,(Subscript[d, m+2]),…,(Subscript[d, n])) is:

g=RandomGraph[{7,9}]

Ordered degree sequence:

d=Sort[VertexDegree[g],Greater]

Reconstruct the degree sequence without the largest degree vertex:

Join[Take[d,{2,First[d]+1}]-1,Drop[d,First[d]+1]]

RandomGraph[DegreeGraphDistribution[%]]

SimpleGraphQ/@{g,%}

The graphs with the same degree sequence can be non-isomorphic:

g=RandomGraph[{10,12}]

IsomorphicGraphQ[g,#]&/@ Table[RandomGraph[DegreeGraphDistribution[VertexDegree[g]]],{10}]

A degree sequence with distinct degrees is realized as a graph with self-loops:

RandomGraph[DegreeGraphDistribution[Range[7]]]

LoopFreeGraphQ[%]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

Randomly colored vertices:

HighlightGraph[RandomGraph[DegreeGraphDistribution[Table[3,{10^2}]],VertexSize->{"Scaled",0.02}],Table[Style[i,RandomChoice[ColorData[45,"ColorList"]]],{i,10^2}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[BernoulliGraphDistribution, paclet:ref/BernoulliGraphDistribution])  ▪  (RefLink[UniformGraphDistribution, paclet:ref/UniformGraphDistribution])  ▪  (RefLink[PriceGraphDistribution, paclet:ref/PriceGraphDistribution])  ▪  (RefLink[BarabasiAlbertGraphDistribution, paclet:ref/BarabasiAlbertGraphDistribution])  ▪  (RefLink[WattsStrogatzGraphDistribution, paclet:ref/WattsStrogatzGraphDistribution])  ▪  (RefLink[ZipfDistribution, paclet:ref/ZipfDistribution])  ▪  (RefLink[WaringYuleDistribution, paclet:ref/WaringYuleDistribution])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Random Graphs, paclet:guide/RandomGraphs])}})}})