Readablewiki

Degree matrix

Content sourced from Wikipedia, licensed under CC BY-SA 3.0.

Degree matrix: a short, clear guide

- What it is: For a graph G with n vertices, the degree matrix D is an n×n diagonal matrix. Each diagonal entry Dii equals the degree of vertex i (how many edges touch that vertex).

- How to build it: Dii = deg(v_i). In undirected graphs, a loop at a vertex counts as 2 toward its degree.

- Directed graphs: degree can refer to indegree (incoming edges) or outdegree (outgoing edges). Use the appropriate definition for your problem.

- Special case: If G is k-regular (every vertex has degree k), then D = kI (all diagonal entries are k).

- Key fact: The sum of all degrees equals twice the number of edges, so the trace of D (the sum of diagonal entries) is 2|E|.

- Relation to Laplacian: The degree matrix is used with the adjacency matrix A to form the Laplacian L = D − A, which helps analyze graph connectivity and flows.


This page was last edited on 2 February 2026, at 06:15 (CET).