gives a list of mean neighbor degrees of vertices for the graph g.
MeanNeighborDegree[g,"In"]
gives a list of mean neighbor in-degrees.
MeanNeighborDegree[g,"Out"]
gives a list of mean neighbor out-degrees.
MeanNeighborDegree[{vw,…},…]
uses rules vw to specify the graph g.
MeanNeighborDegree
gives a list of mean neighbor degrees of vertices for the graph g.
MeanNeighborDegree[g,"In"]
gives a list of mean neighbor in-degrees.
MeanNeighborDegree[g,"Out"]
gives a list of mean neighbor out-degrees.
MeanNeighborDegree[{vw,…},…]
uses rules vw to specify the graph g.
Details
- The mean neighbor degree is also known as the average neighbor degree.
- The mean neighbor degree of the vertex
is the mean of vertex degrees of neighbors of
. - For weighted graphs, the mean neighbor degree of the vertex
is given by
over all neighbors
of
with edge weight
between
and
.
is the degree of the vertex
and
is the total of weights
. - MeanNeighborDegree works with undirected graphs, directed graphs, weighted graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (2)
Compute mean neighbor degrees:
g = ExampleData[{"NetworkGraph", "FamilyGathering"}];MeanNeighborDegree[g]HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]Rank the vertices. Highest-ranked vertices are adjacent to high-degree vertices:
g = ExampleData[{"NetworkGraph", "FamilyGathering"}];Part[VertexList[g], Ordering[MeanNeighborDegree[g]]]Scope (8)
MeanNeighborDegree works with undirected graphs:
MeanNeighborDegree[[image]]MeanNeighborDegree[[image]]MeanNeighborDegree[[image]]MeanNeighborDegree[[image]]MeanNeighborDegree[[image]]Use rules to specify the graph:
MeanNeighborDegree[{1 -> 2, 3 -> 1, 3 -> 2, 2 -> 3, 2 -> 4, 3 -> 4}]Compute the mean neighbor in- and out-degree:
MeanNeighborDegree[[image], "In"]MeanNeighborDegree[[image], "Out"]MeanNeighborDegree works with large graphs:
g = RandomGraph[UniformGraphDistribution[10 ^ 4, 10 ^ 5]];MeanNeighborDegree[g] // Mean//TimingApplications (4)
Find the average number of connections for the internet at the level of autonomous systems:
g = ExampleData[{"NetworkGraph", "Internet"}];N[Mean[VertexDegree[g]]]The presence of high-degree hubs in the network increases the mean neighbor degree:
N[Mean[MeanNeighborDegree[g]]]A citation network from the High Energy Physics Phenomenology section of the arXiv e-Print archive. Compute the average number of citations per article:
g = ExampleData[{"NetworkGraph", "HighEnergyPhysicsPhenomenology"}];d = VertexInDegree[g];
N[Mean[d]]The mean number of citing articles for citations:
N[Mean[MeanNeighborDegree[g, "In"]]]Compute the average number of references:
N[Mean[VertexOutDegree[g]]]The mean number of cited articles for references:
m = MeanNeighborDegree[g, "Out"];
N[Mean[m]]Highlight social hubs in the Zachary karate club network:
g = ExampleData[{"NetworkGraph", "ZacharyKarateClub"}];N[Mean[MeanNeighborDegree[g]]]HighlightGraph[g, _ ? (VertexDegree[g, #] ≥ %&)]A social network of frequent association ties between dolphins living off Doubtful Sound, NZ:
g = ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]Compute the probability that a dolphin with just one tie has a neighbor with nine ties or more:
data = MeanNeighborDegree[g];𝒟 = EmpiricalDistribution[Transpose[{VertexDegree[g], data}]];N[Probability[x ≥ 9d == 1, {d, x}𝒟]]Find the probability in a derived model:
𝒢 = DegreeGraphDistribution[VertexDegree[g]];f[g_ ? GraphQ, dolphin_] := MeanNeighborDegree[g][[dolphin]]NProbability[x ≥ 9, xGraphPropertyDistribution[f[g, 5], g𝒢]]Properties & Relations (4)
Isolated vertices have mean neighbor degree 0:
Graph[Range[4], {}]MeanNeighborDegree[%]Directed edges are treated as undirected:
g = [image];
h = [image];MeanNeighborDegree[g]MeanNeighborDegree[h]Use VertexDegree to compute the mean neighbor degree:
g = Graph[{12, 23, 31, 34}, VertexShapeFunction -> "Name"]MeanNeighborDegree[g][[VertexIndex[g, 3]]]Mean[Table[VertexDegree[g, v], {v, {1, 2, 4}}]]MeanDegreeConnectivity gives the means over vertices gathered by degree:
g = GridGraph[{3, 4, 5}]MeanDegreeConnectivity[g]Find the 3-mean degree connectivity:
Part[%, 4]VertexList[g, v_ /; VertexDegree[g, v] == 3]The mean of mean neighbor degrees:
Mean[MeanNeighborDegree[g][[Table[VertexIndex[g, v], {v, %}]]]]See Also
MeanDegreeConnectivity VertexDegree VertexInDegree VertexOutDegree
Function Repository: HypergraphNeighborhoodVolumes
Related Guides
Text
Wolfram Research (2012), MeanNeighborDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanNeighborDegree.html (updated 2015).
CMS
Wolfram Language. 2012. "MeanNeighborDegree." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/MeanNeighborDegree.html.
APA
Wolfram Language. (2012). MeanNeighborDegree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanNeighborDegree.html
BibTeX
@misc{reference.wolfram_2026_meanneighbordegree, author="Wolfram Research", title="{MeanNeighborDegree}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/MeanNeighborDegree.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_meanneighbordegree, organization={Wolfram Research}, title={MeanNeighborDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/MeanNeighborDegree.html}, note=[Accessed: 12-June-2026]}