DegreeGraphDistribution[dlist]
represents a degree graph distribution with vertex degree dlist.
DegreeGraphDistribution
DegreeGraphDistribution[dlist]
represents a degree graph distribution with vertex degree dlist.
Details and Options
- DegreeGraphDistribution can be used with such functions as RandomGraph and GraphPropertyDistribution.
Examples
open all close allBasic 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], gDegreeGraphDistribution[ConstantArray[k, n]]]SmoothHistogram[Table[RandomVariate[𝒟[20, k], 500], {k, 5, 8}], Automatic, "PDF", Filling -> Axis]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], gDegreeGraphDistribution[{3, 3, 2, 2, 1, 1}]];NProbability[x > 0.95, x𝒟]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, xGraphPropertyDistribution[Boole[EdgeQ[g, 12]], g𝒢]]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𝒢];
Subscript[𝒟, 2] = GraphPropertyDistribution[EdgeCount[h], h𝒢];
{Mean[Subscript[𝒟, 1]], Mean[Subscript[𝒟, 2]]}The empirical and theoretical global clustering coefficient:
N[GlobalClusteringCoefficient[g]]𝒟 = GraphPropertyDistribution[GlobalClusteringCoefficient[h], h𝒢];
N[Mean[𝒟]]Properties & Relations (7)
Distribution of the number of vertices:
𝒟[dlist_] := GraphPropertyDistribution[VertexCount[g], gDegreeGraphDistribution[dlist]]𝒟[{5, 2, 2, 5, 3, 4, 3}]Distribution of the number of edges:
𝒟[dlist_] := GraphPropertyDistribution[EdgeCount[g], gDegreeGraphDistribution[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], gDegreeGraphDistribution[dlist]], 10]𝒟 = 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]]
is a degree sequence of a simple graph iff
is:
g = RandomGraph[{7, 9}]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[%]Related Guides
History
Text
Wolfram Research (2010), DegreeGraphDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/DegreeGraphDistribution.html.
CMS
Wolfram Language. 2010. "DegreeGraphDistribution." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DegreeGraphDistribution.html.
APA
Wolfram Language. (2010). DegreeGraphDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DegreeGraphDistribution.html
BibTeX
@misc{reference.wolfram_2026_degreegraphdistribution, author="Wolfram Research", title="{DegreeGraphDistribution}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/DegreeGraphDistribution.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_degreegraphdistribution, organization={Wolfram Research}, title={DegreeGraphDistribution}, year={2010}, url={https://reference.wolfram.com/language/ref/DegreeGraphDistribution.html}, note=[Accessed: 13-June-2026]}