gives the list of vertex out-degrees for all vertices in the graph g.
VertexOutDegree[g,v]
gives the vertex out-degree for the vertex v.
VertexOutDegree[{vw,…},…]
uses rules vw to specify the graph g.
VertexOutDegree
gives the list of vertex out-degrees for all vertices in the graph g.
VertexOutDegree[g,v]
gives the vertex out-degree for the vertex v.
VertexOutDegree[{vw,…},…]
uses rules vw to specify the graph g.
Details
- The vertex out-degree for a vertex v is the number of outgoing directed edges from v.
- For an undirected graph g, an edge is taken to be both an in-edge and an out-edge. »
Examples
open all close allBasic Examples (2)
Scope (6)
VertexOutDegree works with directed graphs:
VertexOutDegree[[image]]VertexOutDegree[[image]]VertexOutDegree[[image]]Vertex out-degree for a vertex:
VertexOutDegree[[image], 5]Use rules to specify the graph:
VertexOutDegree[{1 -> 2, 2 -> 3, 3 -> 1, 3 -> 4}]VertexOutDegree works with large graphs:
GridGraph[{10, 10, 10, 10}, DirectedEdges -> True];VertexOutDegree[%]//Timing//ShortApplications (4)
Highlight the vertex by its vertex out-degree for CycleGraph:
HighlightVertexOutDegree[g_, vd_] := HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][vd[[i]] / Max[vd]]], {i, VertexCount[g]}]];g = CycleGraph[8, DirectedEdges -> True, VertexSize -> Large];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]g = StarGraph[10, DirectedEdges -> True, VertexSize -> Large];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]g = GridGraph[{10, 10}, DirectedEdges -> True, VertexSize -> Large];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]g = CompleteKaryTree[3, 3, DirectedEdges -> True, VertexSize -> Large];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]g = PathGraph[Range[20], DirectedEdges -> True, VertexSize -> Large];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]g = RandomGraph[BarabasiAlbertGraphDistribution[50, 5], VertexSize -> {"Scaled", 0.03}, BaseStyle -> EdgeForm[None]];vd = VertexOutDegree[g];HighlightVertexOutDegree[g, vd]Show the out-degree histogram for BernoulliGraphDistribution[n,p]:
g = RandomGraph[BernoulliGraphDistribution[10^4, 0.01], DirectedEdges -> True];Histogram[VertexOutDegree[g], Automatic, "PDF"]The out-degree distribution follows BinomialDistribution[n-1,p]:
DiscretePlot[PDF[BinomialDistribution[10^4 - 1, 0.01], k], {k, 70, 130}]A PriceGraphDistribution is constructed, adding new vertices with a constant number of edges:
g = RandomGraph[PriceGraphDistribution[50, 3, 1]]In this case, three edges from each new vertex (except initially) are added:
VertexOutDegree[g]//UnionHistogram[VertexOutDegree[g]]Create a food chain where an edge indicates what animals and insects eat:
web = {"Aphid""Ladybug", "Beetle""Mouse", "Caterpillar""Beetle", "Caterpillar""Mouse", "Caterpillar""Towhee", "Grasshopper""Mouse", "Grasshopper""Towhee", "Ladybug""Towhee", "Louse""Mouse", "Mosquito""Dragonfly", "Mosquito""Towhee", "Mouse""Owl", "Sunflower""Aphid", "Sunflower""Caterpillar", "Sunflower""Grasshopper", "Sunflower""Louse", "Towhee""Owl"};shapes = {"Sunflower" -> [image], "Aphid" -> [image], "Ladybug" -> [image], "Towhee" -> [image], "Owl" -> [image], "Grasshopper" -> [image], "Louse" -> [image], "Caterpillar" -> [image], "Beetle" -> [image], "Mosquito" -> [image], "Dragonfly" -> [image], "Mouse" -> [image]};g = Graph[web];The out-degree corresponds to the number of predators for the species:
Graph[EdgeList[g], VertexShape -> shapes, VertexLabels -> Table[i -> VertexOutDegree[g, i], {i, VertexList[g]}], VertexSize -> 0.7]Animals with zero out-degree are called top species or apex predators:
VertexOutDegree[g]Pick[VertexList[g], %, 0]Properties & Relations (7)
The out-degree of an undirected graph is the number of edges incident to each vertex:
Graph[{12, 23, 31}, VertexLabels -> "Name", ImagePadding -> 10]VertexOutDegree[%]Graph[{12, 23, 31, 33}, VertexLabels -> "Name", ImagePadding -> 10]VertexOutDegree[%]Undirected graphs correspond to directed graphs with each edge both an in- and out-edge:
{g = Graph[{12, 23, 31}], gd = Graph[Flatten[EdgeList[g] /. {u_v_ :> {uv, vu}}]]}{VertexOutDegree[g], VertexOutDegree[gd]}For an undirected graph, the vertex in-degree and out-degree are equal to the vertex degree:
WheelGraph[6]VertexInDegree[%] == VertexOutDegree[%] == VertexDegree[%]For a directed graph, the sum of the vertex in-degree and out-degree is the vertex degree:
g = Graph[{12, 23, 31, 24}];Put the vertex degree, in-degree, and out-degree before, above, and below the vertex, respectively:
Graph[EdgeList[g], VertexLabels -> Table[i -> Placed[{VertexDegree[g][[i]], VertexInDegree[g][[i]], VertexOutDegree[g][[i]]}, {Before, Above, Below}], {i, VertexCount[g]}], VertexSize -> Small, ImagePadding -> 10]VertexDegree[g] == VertexInDegree[g] + VertexOutDegree[g]The sum of the out-degrees of all vertices of an undirected graph is twice the number of edges:
CycleGraph[4]Total[VertexOutDegree[%]] == 2EdgeCount[%]The sum of the out-degrees of all vertices of a directed graph is equal to the number of edges:
Total[VertexOutDegree[[image]]] == EdgeCount[[image]]A connected directed graph is Eulerian iff every vertex has equal in-degree and out-degree:
g = [image];VertexInDegree[g] == VertexOutDegree[g]{ConnectedGraphQ[g], EulerianGraphQ[g]}Related Guides
Text
Wolfram Research (2010), VertexOutDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexOutDegree.html (updated 2015).
CMS
Wolfram Language. 2010. "VertexOutDegree." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/VertexOutDegree.html.
APA
Wolfram Language. (2010). VertexOutDegree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexOutDegree.html
BibTeX
@misc{reference.wolfram_2026_vertexoutdegree, author="Wolfram Research", title="{VertexOutDegree}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/VertexOutDegree.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_vertexoutdegree, organization={Wolfram Research}, title={VertexOutDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexOutDegree.html}, note=[Accessed: 13-June-2026]}