WOLFRAM

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

gives the vertex degree for the vertex v.

VertexDegree[{vw,},]

uses rules vw to specify the graph g.

Details

  • VertexDegree is also known as valence.
  • The vertex degree for a vertex v is the number of edges incident to v.
  • For a directed graph g, an edge is incident to a vertex whether it is an in-edge or an out-edge.

Examples

open allclose all

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

Find the degree for each vertex:

Out[1]=1

Find the degree for a specified vertex:

Out[1]=1

Vertex degrees of the HararyGraph:

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

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

VertexDegree works with undirected graphs:

Out[3]=3

Directed graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Vertex degree for a vertex:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

VertexDegree works with large graphs:

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

Highlight the vertex by its vertex degree for CycleGraph:

Out[11]=11

StarGraph:

Out[14]=14

GridGraph:

Out[17]=17

CompleteKaryTree:

Out[20]=20

An unbalanced tree:

Out[23]=23

PathGraph:

Out[26]=26

RandomGraph:

Out[29]=29

Create a social network:

Find the people with more influence:

Out[4]=4

The degree distribution for a Bernoulli random graph follows a BinomialDistribution:

Out[1]=1

Generate vertex degrees from 1000 instances of random graphs:

Out[2]=2

Find the probability that a Bernoulli random graph has max degree greater than 50:

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

The vertex degree distribution for BarabasiAlbertGraphDistribution follows a power-law:

Out[2]=2

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

The degree of a vertex of an undirected graph is the number of edges incident to the vertex:

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

Self-loops are counted twice:

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

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 degrees of all vertices of a graph is twice the number of edges:

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

Every graph has an even number of vertices with odd degree:

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

Connected simple graphs have minimum vertex degree of at least :

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

A graph with minimum vertex degree at least 2 contains a cycle:

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

The vertex degrees of an undirected graph can be obtained from its adjacency matrix:

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

The vertex degrees of a directed graph can be obtained from its adjacency matrix:

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

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

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

The vertex degrees for a directed graph can be obtained from the incidence matrix:

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

Each vertex of a -regular graph has the same vertex degree :

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

All vertices of a simple graph have maximum degree less than the number of vertices:

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

A simple graph without isolated vertices has at least one pair of vertices with equal degrees:

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

A connected undirected graph is Eulerian iff every vertex has an even degree:

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

Text

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

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

CMS

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

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

APA

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

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

BibTeX

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

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

BibLaTeX

@online{reference.wolfram_2025_vertexdegree, organization={Wolfram Research}, title={VertexDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexDegree.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_vertexdegree, organization={Wolfram Research}, title={VertexDegree}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexDegree.html}, note=[Accessed: 25-March-2025 ]}