WOLFRAM

gives the list of vertex in-degrees for all vertices in the graph g.

gives the vertex in-degree for the vertex v.

VertexInDegree[{vw,},]

uses rules vw to specify the graph g.

Details

  • The vertex in-degree for a vertex v is the number of incoming directed edges to v.
  • For an undirected graph g, an edge is taken to be both an in-edge and an out-edge. »

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Find the in-degree for each vertex:

Out[1]=1

Find the in-degree for a specified vertex:

Out[1]=1

Scope  (6)Survey of the scope of standard use cases

VertexInDegree works with directed graphs:

Out[6]=6

Undirected graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Vertex in-degree for a vertex:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

VertexInDegree works with large graphs:

Applications  (4)Sample problems that can be solved with this function

Highlight the vertex in-degree for directed graphs including CycleGraph:

Out[4]=4

StarGraph:

Out[7]=7

GridGraph:

Out[10]=10

CompleteKaryTree:

Out[13]=13

PathGraph:

Out[16]=16

RandomGraph:

Out[19]=19

Show the in-degree histogram for BernoulliGraphDistribution[n,p]:

Out[2]=2

The in-degree distribution follows BinomialDistribution[n-1,p]:

Out[3]=3

The vertex in-degree distribution for PriceGraphDistribution follows a power-law:

Out[2]=2

Create a food chain where an edge indicates what animals and insects eat:

The in-degree corresponds to the number of prey and what an animal preys on:

Out[4]=4

The species with in-degree zero are called basal species or producers:

Out[5]=5
Out[6]=6

Properties & Relations  (10)Properties of the function, and connections to other functions

The in-degree of an undirected graph is the number of edges incident to each vertex:

Out[1]=1
Out[2]=2

Self-loops are counted twice:

Out[4]=4
Out[5]=5

Undirected graphs correspond to directed graphs with each edge both an in- and out-edge:

Out[1]=1
Out[2]=2

For an undirected graph, the vertex in-degree and out-degree are equal to the vertex degree:

Out[1]=1
Out[2]=2

For a directed graph, the sum of the vertex in-degree and out-degree is the vertex degree:

Put the vertex degree, in-degree, and out-degree before, above, and below the vertex, respectively:

Out[2]=2
Out[3]=3

The sum of the in-degrees of all vertices of an undirected graph is twice the number of edges:

Out[1]=1
Out[2]=2

The sum of the in-degrees of all vertices of a directed graph is equal to the number of edges:

Out[1]=1

The vertex in-degrees of an undirected graph can be obtained from the adjacency matrix:

Out[1]=1
Out[3]=3
Out[4]=4

The vertex in-degrees of a directed graph can be obtained from the adjacency matrix:

Out[3]=3
Out[4]=4

The vertex in-degrees for an undirected graph can be obtained from the incidence matrix:

Out[1]=1
Out[2]=2
Out[4]=4

A connected directed graph is Eulerian iff every vertex has equal in-degree and out-degree:

Out[2]=2
Out[3]=3
Wolfram Research (2010), VertexInDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInDegree.html (updated 2015).
Wolfram Research (2010), VertexInDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInDegree.html (updated 2015).

Text

Wolfram Research (2010), VertexInDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInDegree.html (updated 2015).

Wolfram Research (2010), VertexInDegree, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInDegree.html (updated 2015).

CMS

Wolfram Language. 2010. "VertexInDegree." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/VertexInDegree.html.

Wolfram Language. 2010. "VertexInDegree." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/VertexInDegree.html.

APA

Wolfram Language. (2010). VertexInDegree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexInDegree.html

Wolfram Language. (2010). VertexInDegree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexInDegree.html

BibTeX

@misc{reference.wolfram_2025_vertexindegree, author="Wolfram Research", title="{VertexInDegree}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/VertexInDegree.html}", note=[Accessed: 07-June-2025 ]}

@misc{reference.wolfram_2025_vertexindegree, author="Wolfram Research", title="{VertexInDegree}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/VertexInDegree.html}", note=[Accessed: 07-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_vertexindegree, organization={Wolfram Research}, title={VertexInDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexInDegree.html}, note=[Accessed: 07-June-2025 ]}

@online{reference.wolfram_2025_vertexindegree, organization={Wolfram Research}, title={VertexInDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexInDegree.html}, note=[Accessed: 07-June-2025 ]}