In themathematical field ofalgebraic graph theory, thedegree matrix of anundirected graph is adiagonal matrix which contains information about thedegree of eachvertex—that is, the number of edges attached to each vertex.[1] It is used together with theadjacency matrix to construct theLaplacian matrix of a graph: the Laplacian matrix is the difference of the degree matrix and the adjacency matrix.[2]
Given a graph with, thedegree matrix for is adiagonal matrix defined as[1]
where the degree of a vertex counts the number of times an edge terminates at that vertex. In anundirected graph, this means that each loop increases the degree of a vertex by two. In adirected graph, the termdegree may refer either toindegree (the number of incoming edges at each vertex) oroutdegree (the number of outgoing edges at each vertex).
The following undirected graph has a 6x6 degree matrix with values:
| Vertex labeled graph | Degree matrix |
|---|---|
Note that in the case of undirected graphs, an edge that starts and ends in the same node increases the corresponding degree value by 2 (i.e. it is counted twice).
The degree matrix of ak-regular graph has a constant diagonal of.
According to thedegree sum formula, thetrace of the degree matrix is twice the number of edges of the considered graph.