Fact-checked by Grok 2 weeks ago

Degree matrix

In , the degree matrix (also known as the valency matrix) of a G = (V, E) with set V = \{v_1, \dots, v_n\} is a D \in \mathbb{R}^{n \times n} where the diagonal entry D_{ii} equals the d(v_i) of v_i, and all off-diagonal entries are zero. For an undirected simple , the d(v_i) is the number of edges incident to v_i; in weighted graphs, it is the sum of the weights of edges adjacent to v_i. For directed graphs, variants use either in-degrees or out-degrees on the diagonal, depending on the context. The degree matrix plays a central role in spectral graph theory and matrix representations of graphs, particularly in the construction of the graph Laplacian matrix L = D - A, where A is the adjacency matrix of G. This Laplacian is symmetric and positive semi-definite for undirected graphs, with eigenvalues that are real and non-negative, providing insights into graph connectivity, clustering, and spectral properties. In weighted graphs, the formulation extends to L = D - W, where W is the weight matrix, and the quadratic form x^T L x = \frac{1}{2} \sum_{i,j} w_{ij} (x_i - x_j)^2 underscores its semi-definiteness. Key properties of the degree matrix include its diagonal structure, which simplifies computations in graph algorithms, and its dependence on vertex ordering, typically aligned with the rows and columns of the . It is also integral to the incidence matrix formulation of the Laplacian, where L = B B^T for the unoriented B, linking combinatorial and algebraic graph properties.

Fundamentals

Definition

In graph theory, an undirected graph G = (V, E) consists of a finite set V of vertices and a set E of unordered pairs \{i, j\} with i, j \in V (possibly i = j) representing edges between vertices. The degree of a vertex i \in V, denoted d_i, is the number of edges incident to it. In simple graphs without loops or multiple edges, this equals the number of distinct neighbors of i. In general undirected graphs allowing loops and multiple edges, the degree is given by d_i = \sum_{j \neq i} m_{ij} + 2 m_{ii}, where m_{ij} is the multiplicity (number) of edges between distinct vertices i and j, and m_{ii} is the number of loops at i; each loop contributes 2 to the degree, while each multiple edge contributes once to each endpoint. In weighted graphs, the degree d_i is the sum of the weights of edges incident to v_i, with a loop's weight contributing twice. The degree matrix D of G with |V| = n is the n \times n where the diagonal entry D_{ii} = d_i for each i = 1, \dots, n, and all off-diagonal entries are zero. Formally, D = \operatorname{diag}(d_1, d_2, \dots, d_n), where the d_i are defined as above. This matrix encodes the degrees in a compact form, distinct from the which captures direct connections between vertices.

Notation and prerequisites

In , the degree matrix is commonly introduced using undirected simple graphs, which consist of a finite nonempty set of vertices V = \{v_1, v_2, \dots, v_n\} and a set of edges E \subseteq \binom{V}{2}, where each edge connects exactly two distinct vertices without . These graphs assume no self-loops (edges from a vertex to itself) or multiple edges between the same pair of vertices, ensuring a straightforward counting of connections per vertex. However, the concept extends to multigraphs with loops and multiple edges, as well as weighted and directed graphs. While the degree matrix is primarily defined for undirected graphs, directed graphs introduce asymmetries via in-degrees and out-degrees, typically requiring separate matrices rather than a single degree matrix. Standard notation denotes the degree matrix of a graph G as D(G) or simply D, represented in boldface as D to indicate its matrix form, with diagonal entries given by lowercase d_i, the degree of vertex v_i. Formally, D is the n \times n diagonal matrix \diag(d_1, d_2, \dots, d_n), where each d_i counts the number of edges incident to v_i. In the context of weighted graphs, degrees are computed as the sum of weights on incident edges, extending the diagonal entries accordingly while maintaining the diagonal structure. The concept of the degree matrix originated in early 20th-century as part of efforts to represent graph properties via matrices, with formalization in during the 1950s and 1960s through analyses of adjacency and Laplacian matrices.

Construction

From graph degrees

The degree matrix D of an undirected G = (V, E) with vertex set V = \{1, 2, \dots, n\} is constructed by first determining the degree d_i of each i \in V, defined as the number of edges in E incident to i. The matrix D is then the n \times n D = \operatorname{diag}(d_1, d_2, \dots, d_n), where all off-diagonal entries are zero. The construction proceeds in the following steps: (1) For each i, compute d_i by counting the edges connected to i; (2) assign d_i to the (i,i)-th entry of D; (3) set all off-diagonal entries to 0. This direct method ensures D captures the local connectivity of each without relying on other representations. A implementation for building D from the edge set E (assuming 1-based indexing and an undirected simple graph) is:
Initialize degrees array of size n to 0
For each edge {u, v} in E:
    degrees[u] ← degrees[u] + 1
    degrees[v] ← degrees[v] + 1
Initialize n × n matrix D to the [zero matrix](/page/Zero_matrix)
For i = 1 to n:
    D[i, i] ← degrees[i]
Equivalently, the diagonal entries can be expressed as D_{i,i} = \sum_{j \neq i} \mathbf{1}_{\{i,j\} \in E} for i = 1 to n, where \mathbf{1} is the . Isolated vertices, which have no incident edges, yield d_i = 0 and thus a zero entry on the corresponding diagonal position in D, preserving the matrix's diagonal structure and indicating no contribution to the graph's from that . For sparse graph representations (e.g., adjacency lists or edge lists), computing the degrees requires scanning all edges once, incrementing counts for each endpoint, which takes O(|E|) time overall since \sum_i d_i = 2|E|; constructing the diagonal matrix then adds O(n) time.

Relation to adjacency matrix

The degree matrix D of an undirected can be constructed directly from its A by taking the whose entries are the row sums of A. Specifically, for a with n vertices, the i-th diagonal entry D_{ii} equals the d_i of i, given by d_i = \sum_{j=1}^n A_{ij}. This relation holds because the A has entries A_{ij} = 1 if vertices i and j are adjacent and $0 otherwise, so the row sum counts the number of neighbors of i. In matrix form, this is expressed as D = \operatorname{diag}(A \mathbf{1}), where \mathbf{1} is the n \times 1 all-ones vector. For weighted undirected graphs, the A contains the weights w_{ij} of between i and j (with A_{ij} = 0 if no exists), and the d_i is defined as the sum of the weights of all incident to i, so d_i = \sum_{j=1}^n A_{ij}. Thus, the degree matrix D is again the with these weighted on the diagonal, D = \operatorname{diag}(A \mathbf{1}). This generalization preserves the structural connection between the and while accounting for weights.

Examples

Path graph

A path graph P_n consists of n vertices labeled $1 through n, connected by edges between consecutive vertices, specifically the edge set E = \{\{i, i+1\} \mid 1 \leq i < n\}. In P_n, the two endpoint vertices (1 and n) each have 1, while the n-2 internal vertices (2 through n-1) each have 2. The degree matrix D of P_n is the n \times n whose diagonal entries d_{ii} equal the of i, with all off-diagonal entries zero. For the small P_3, with vertices 1--2--3, the degrees are 1, 2, and 1, yielding D = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix}. This structure reveals a clear diagonal pattern: 1's at the ends corresponding to the low-degree endpoints, and 2's in the middle for the higher-degree internal vertices.

Cycle graph

A cycle graph C_n is an undirected graph consisting of n vertices labeled 1 through n, connected by edges between consecutive vertices \{i, i+1\} for i = 1 to n-1, and an additional edge between vertices n and 1, forming a closed loop. In C_n, every has exactly two incident edges, resulting in a degree of 2 for all vertices; thus, C_n is a 2-regular . The degree matrix D for C_n is therefore the n \times n with 2 on each diagonal entry, which can be expressed as D = 2I_n, where I_n is the n \times n . This uniform structure contrasts with the degree matrix of a , where endpoint degrees are 1 and interior degrees are 2; closing the path into a equalizes all degrees to 2, yielding a simple scalar multiple of the .

Properties

Basic characteristics

The degree matrix D of an undirected G = (V, E) with set V = \{v_1, \dots, v_n\} is defined as the n \times n D = \operatorname{diag}(d(v_1), \dots, d(v_n)), where d(v_i) denotes the of v_i. As a , D is inherently symmetric, since all off-diagonal entries are zero. Moreover, with non-negative diagonal entries (as degrees are non-negative integers), D is positive semi-definite, meaning the \mathbf{x}^T D \mathbf{x} \geq 0 for all real vectors \mathbf{x} \in \mathbb{R}^n. The trace of D, given by \operatorname{tr}(D) = \sum_{i=1}^n d(v_i), equals twice the number of edges in G, i.e., \operatorname{tr}(D) = 2 |E|, by the . This relation underscores the matrix's connection to global graph structure. Due to its diagonal form, D has exactly n nonzero entries in an n \times n matrix, making it highly sparse and computationally efficient for storage and operations in sparse matrix representations. For a disconnected graph with multiple connected components, if the vertices are reordered to group those within each component, D takes a block-diagonal form, where each block corresponds to the degree matrix of an individual component. This structure reflects the independence of degree computations across components.

Eigenvalues and trace

The degree matrix D of a graph is a diagonal matrix, and thus its eigenvalues are precisely the diagonal entries, which are the vertex degrees d_1, d_2, \dots, d_n. Each eigenvalue d_i has algebraic multiplicity one, assuming all degrees are distinct, though multiplicities increase if degrees repeat. The corresponding eigenvectors are the vectors e_i of \mathbb{R}^n, where the i-th basis vector satisfies D e_i = d_i e_i, reflecting the matrix's diagonal structure. This simplicity arises directly from the properties of diagonal matrices in linear algebra, applied within the -theoretic context. The of D, denoted \operatorname{tr}(D), equals the sum of its eigenvalues, which is \sum_{i=1}^n d_i. For an undirected graph, this sum is twice the number of edges, $2|E|, by the . The determinant of D is the product of its eigenvalues, given by \det(D) = \prod_{i=1}^n d_i. Thus, D is singular if and only if the has at least one isolated , where some d_i = 0.

Applications

Spectral graph theory

In , the degree matrix D plays a crucial role in normalizing operators to account for varying degrees, enabling the analysis of eigenvalues that reveal structural properties such as and . One key application is in the construction of the normalized Laplacian \mathcal{L} = I - D^{-1/2} A D^{-1/2}, where A is the and D^{-1/2} scales the rows and columns by the inverse square roots of the degrees; this normalization ensures that the eigenvalues of \mathcal{L} lie between 0 and 2, providing bounds on graph cuts and mixing times independent of degree irregularities. This formulation, introduced by , facilitates the study of expander graphs and Cheeger's inequality, linking the second smallest eigenvalue to the graph's conductance. The degree matrix also features prominently in the spectral analysis of random walks on graphs, where the transition matrix P = D^{-1} A defines the probabilities of moving from one vertex to its neighbors, with D normalizing for the fact that higher-degree vertices have more outgoing edges and thus lower per-edge transition probabilities. The eigenvalues of P determine the walk's convergence rate to the stationary distribution, which is proportional to the degrees (i.e., the entries of D); this spectral gap, influenced by D's diagonal values, quantifies how quickly the walk mixes, with applications to sampling and approximation algorithms. In irregular graphs, D's role ensures that the random walk behaves equitably across vertices of different degrees, avoiding bias toward high-degree nodes in the spectral decomposition. In spectral partitioning and graph clustering, the matrix influences the eigenvectors used to identify balanced cuts, as seen in methods that leverage the normalized Laplacian to embed vertices into a lower-dimensional space where clustering algorithms like k-means can be applied. The degrees in D affect the weighting of edges in the cut , promoting partitions that minimize the normalized cut value, which balances the number of edges crossing the partition against the volumes (sum of degrees) of the clusters. This approach, building on earlier work, ensures robustness to degree heterogeneity by scaling the similarity matrix appropriately. Chung's work further expands the normalized Laplacian framework with variants such as the random-walk normalized Laplacian \mathcal{L}_{rw} = I - D^{-1} A and the signless version, both incorporating D to adapt spectral properties for directed or weighted graphs; these allow finer control over eigenvalue interpretations, particularly for directed walks where D's out-degrees normalize asymmetries. For instance, the eigenvalues of \mathcal{L}_{rw} directly relate to the relaxation times of Markov chains, highlighting D's essential role in bridging combinatorial graph properties with probabilistic behaviors.

Graph Laplacians

The graph Laplacian matrix is a fundamental operator in spectral graph theory, constructed using the degree matrix D and the adjacency matrix A. The unnormalized Laplacian is defined as L = D - A, where D is the diagonal matrix with the vertex degrees on its main diagonal, providing the necessary degree-based subtraction that ensures L captures the graph's connectivity structure. This formulation highlights D's central role in balancing the adjacency contributions, transforming the simple edge connections in A into a differential operator analogous to the continuous Laplacian. A key property arising from D's construction is that the rows of L sum to zero, as each row i of D - A has d_i on the diagonal minus the sum of the i-th row of A, which equals d_i, yielding zero overall; this makes L singular with a including the all-ones . The eigenvalues of L are real and non-negative, with the smallest eigenvalue being zero (with multiplicity equal to the number of connected components), and the largest eigenvalue bounded above by twice the maximum \Delta = \max d_i, reflecting D's influence in scaling the relative to degrees. These spectral bounds underscore D's contribution to confining the operator's action within degree-dependent limits. The associated with L further illustrates D's enabling role: for a x \in \mathbb{R}^n, x^T L x = \sum_{(i,j) \in E} (x_i - x_j)^2, where the sum is over all edges, and this equality derives from expanding x^T (D - A) x = \sum_i d_i x_i^2 - 2 \sum_{(i,j) \in E} x_i x_j, which simplifies to the edge-difference sum; here, D weights the self-terms to match the degree-incidence structure. This form measures the smoothness of x over the , with D's diagonal entries ensuring the quadratic penalizes variations proportionally to local . In addition to the unnormalized form, normalized Laplacians incorporate D more explicitly to handle irregular degree distributions. The symmetric normalized Laplacian is \mathcal{L} = D^{-1/2} L D^{-1/2} = I - D^{-1/2} A D^{-1/2}, where D^{-1/2} scales rows and columns by the inverse square roots of degrees, making \mathcal{L} suitable for non-regular graphs by degree-normalizing the operator. The combinatorial Laplacian L emphasizes raw edge counts via D - A, while the normalized variant \mathcal{L} or the random-walk form D^{-1} L adjusts for degree heterogeneity, with D's inverse highlighting its pivotal diagonal role in achieving scale-invariance across vertices. Both forms leverage D to derive positive semidefiniteness and bounded spectra (0 to 2 for \mathcal{L}), facilitating applications in partitioning and diffusion processes.

References

  1. [1]
    Degree Matrix -- from Wolfram MathWorld
    A diagonal matrix sometimes also called the valency matrix corresponding to a graph that has the vertex degree of in the. th position (Skiena 1990, p. 235; ...Missing: definition | Show results with:definition
  2. [2]
    [PDF] Chapter 17 Graphs and Graph Laplacians - UPenn CIS
    . The degree matrix D is defined as before, namely by D = diag(d(v1),...,d(vm)). Page 14. 746. CHAPTER 17. GRAPHS AND GRAPH LAPLACIANS. The weight matrix W can ...
  3. [3]
    degreeMatrix -- Returns the degree matrix of a graph - Macaulay2
    Description. The degree matrix is the n by n diagonal matrix (where n is the number of vertices in the vertex set of the graph G) indexed by the vertices of G ...Missing: theory definition
  4. [4]
    [PDF] graph theory: basic definitions and theorems
    GRAPH THEORY: BASIC DEFINITIONS AND THEOREMS. 1. Definitions. Definition 1. A graph G = (V,E) consists of a set V of vertices (also called nodes) and a set ...
  5. [5]
    Graph theory glossary - Harvard Mathematics Department
    degree (n.): the degree of a vertex of a graph is the number of other vertices that it is adjacent to. For instance, in a polygon all vertices have degree 2; in ...
  6. [6]
    [PDF] Section 10.2
    The degree of a vertex in a undirected graph is the number of edges incident with it, except that a loop at a vertex contributes two to the degree of that ...
  7. [7]
    [PDF] Spectra of Simple Graphs - Whitman College
    May 13, 2013 · Definition 2.10. The degree matrix, D, of a graph, G, is the diagonal matrix D = diag(d1,d2,...,dn) where di is the degree of vertex i.
  8. [8]
    [PDF] GRAPH THEORY WITH APPLICATIONS
    This book introduces graph theory, presenting basic material and applications to math and real-world problems, with new proofs and efficient methods.
  9. [9]
    [PDF] arXiv:2305.07560v1 [math.CO] 12 May 2023
    May 12, 2023 · A weighted graph is called w-regular if the weighted degree of every vertex equals w. Throughout the paper, we regularly write “a weighted graph ...
  10. [10]
    [PDF] Lectures on Spectral Graph Theory Fan R. K. Chung
    Spectral graph theory has a long history. In the early days, matrix theory and linear algebra were used to analyze adjacency matrices of graphs. Algebraic.
  11. [11]
    [PDF] Spectral and Algebraic Graph Theory - Computer Science
    One must introduce necessary linear algebra and show some interesting interpretations of graph eigenvalues. • One must derive the eigenvalues of some example ...<|separator|>
  12. [12]
    [PDF] 1 Graphs and linear algebra - Cornell: Computer Science
    Jun 11, 2019 · We let d ∈ Rn denote the vector of weighted node degrees, and let D denote the matrix in which the weighted node degrees appear on the diagonal.
  13. [13]
    [PDF] Graphs and Matrices - Arizona Math
    Regular Graphs. A graph is said to be regular if all its vertices have the same degree. If the degree of each vertex of G is k, then G is said to be k-regular.
  14. [14]
    adjacency matrix - PlanetMath
    Mar 22, 2013 · The sum of the cells in any given column (or row) is the degree of the corresponding vertex. Therefore, the sum of all the cells in MG ...
  15. [15]
    [PDF] Graph Theory - UMD MATH
    Jul 21, 2021 · Both the adjacency matrix and the Laplacian matrix contain all information about the graph and both can be used to analyze the graph. 3. Page 4 ...
  16. [16]
    Graph Sparsification - Norbert Wiener Center - University of Maryland
    For any x ∈ V, the degree of x, dx , is the sum of weights of ... Let D denote the N × N degree matrix, D = diag(dx ). ... Let G be an undirected weighted graph on ...
  17. [17]
    [PDF] Laws and a Recursive Generator for Weighted Time-Evolving Graphs
    Weight of node i (sum of weights of incident edges). A. 0-1 Adjacency matrix of the un-weighted graph. Aw. Real-value adjacency matrix of the weighted graph ai ...
  18. [18]
    [PDF] an introduction to spectral graph theory - UChicago Math
    The degree d(v) of a vertex v is the number of vertices in G that are adjacent to v. There are two matrices we can get from a graph G. One is called adjacency.
  19. [19]
    [PDF] graph definitions - Basic Combinatorics
    The degree matrix. D = D(G) of G is the n by n matrix with ii entry equal to the degree of vertex i for each i, and all other entries 0. The Laplacian of G is ...
  20. [20]
    [PDF] 18.S995 - L30-31 - MIT Mathematics
    The degree matrix D(G) is defined as the diagonal matrix ... matrix, is defined as the difference between degree matrix ... If G is a cycle graph then L(G) and each ...
  21. [21]
    [PDF] Lecture 7: Positive Semidefinite Matrices - CSE - IIT Kanpur
    In general, any matrix of the form BT B is positive semi-definite. The matrix. B need not have orthogonal columns (it can even be rectangular). But this ...
  22. [22]
    Degrees in graphs I: the Handshake Lemma - The Network Pages
    Dec 12, 2016 · The handshake lemma states that the if we compute the sum the degrees over all the vertices in the graph, then we arrive at an even number.
  23. [23]
    [PDF] 18.S995 - L26 - MIT Mathematics
    ... graph G, often also referred to as Kirchhoff matrix, is defined as the difference between degree matrix and adjacency matrix. L = D A. (1.15a). Hence. Lij = 8 ...
  24. [24]
    [PDF] Graph Theory Fundamentals - FSU Math
    The adjacency matrix for a graph is n X n and each element contains 0 for non-neighbors and the edge weight for neighbors. A = Page 5.
  25. [25]
    [PDF] A Tutorial on Spectral Clustering
    In this section we will see how spectral clustering can be derived as an approximation to such graph partitioning problems. Given a similarity graph with ...
  26. [26]
    AMS eBooks: CBMS Regional Conference Series in Mathematics
    Spectral Graph Theory · Fan R. K. Chung · View full volume as PDF · Download chapters as PDF · Front/Back Matter · Chapters.