Hubbry Logo
Degree matrixDegree matrixMain
Open search
Degree matrix
Community hub
Degree matrix
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Degree matrix
Degree matrix
from Wikipedia

In the mathematical field of algebraic graph theory, the degree matrix of an undirected graph is a diagonal matrix which contains information about the degree of each vertex—that is, the number of edges attached to each vertex.[1] It is used together with the adjacency matrix to construct the Laplacian matrix of a graph: the Laplacian matrix is the difference of the degree matrix and the adjacency matrix.[2]

Definition

[edit]

Given a graph with , the degree matrix for is a diagonal matrix defined as[1]

where the degree of a vertex counts the number of times an edge terminates at that vertex. In an undirected graph, this means that each loop increases the degree of a vertex by two. In a directed graph, the term degree may refer either to indegree (the number of incoming edges at each vertex) or outdegree (the number of outgoing edges at each vertex).

Example

[edit]

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).

Properties

[edit]

The degree matrix of a k-regular graph has a constant diagonal of .

According to the degree sum formula, the trace of the degree matrix is twice the number of edges of the considered graph.

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In , the degree matrix (also known as the valency matrix) of a graph G=(V,E)G = (V, E) with vertex set V={v1,,vn}V = \{v_1, \dots, v_n\} is a DRn×nD \in \mathbb{R}^{n \times n} where the diagonal entry DiiD_{ii} equals the degree d(vi)d(v_i) of vertex viv_i, and all off-diagonal entries are zero. For an undirected simple graph, the degree d(vi)d(v_i) is the number of edges incident to viv_i; in weighted graphs, it is the sum of the weights of edges adjacent to viv_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=DAL = D - A, where AA is the adjacency matrix of GG. 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=DWL = D - W, where WW is the weight matrix, and the quadratic form xTLx=12i,jwij(xixj)2x^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=BBTL = B B^T for the unoriented BB, linking combinatorial and algebraic graph properties.

Fundamentals

Definition

In graph theory, an undirected graph G=(V,E)G = (V, E) consists of a finite set VV of vertices and a set EE of unordered pairs {i,j}\{i, j\} with i,jVi, j \in V (possibly i=ji = j) representing edges between vertices. The degree of a vertex iVi \in V, denoted did_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 ii. In general undirected graphs allowing loops and multiple edges, the degree is given by di=jimij+2miid_i = \sum_{j \neq i} m_{ij} + 2 m_{ii}, where mijm_{ij} is the multiplicity (number) of edges between distinct vertices ii and jj, and miim_{ii} is the number of loops at ii; each loop contributes 2 to the degree, while each multiple edge contributes once to each endpoint. In weighted graphs, the degree did_i is the sum of the weights of edges incident to viv_i, with a loop's weight contributing twice. The degree matrix DD of GG with V=n|V| = n is the n×nn \times n where the diagonal entry Dii=diD_{ii} = d_i for each i=1,,ni = 1, \dots, n, and all off-diagonal entries are zero. Formally, D=diag(d1,d2,,dn),D = \operatorname{diag}(d_1, d_2, \dots, d_n), where the did_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={v1,v2,,vn}V = \{v_1, v_2, \dots, v_n\} and a set of edges E(V2)E \subseteq \binom{V}{2}, where each edge connects exactly two distinct vertices without direction. 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 GG as D(G)D(G) or simply DD, represented in boldface as D to indicate its matrix form, with diagonal entries given by lowercase did_i, the degree of vertex viv_i. Formally, D is the n×nn \times n diagonal matrix \diag(d1,d2,,dn)\diag(d_1, d_2, \dots, d_n), where each did_i counts the number of edges incident to viv_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 DD of an undirected graph G=(V,E)G = (V, E) with vertex set V={1,2,,n}V = \{1, 2, \dots, n\} is constructed by first determining the degree did_i of each vertex iVi \in V, defined as the number of edges in EE incident to ii. The matrix DD is then the n×nn \times n D=diag(d1,d2,,dn)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 vertex ii, compute did_i by counting the edges connected to ii; (2) assign did_i to the (i,i)(i,i)-th entry of DD; (3) set all off-diagonal entries to 0. This direct method ensures DD captures the local connectivity of each vertex without relying on other matrix representations. A implementation for building DD from the edge set EE (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]

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 Di,i=ji1{i,j}ED_{i,i} = \sum_{j \neq i} \mathbf{1}_{\{i,j\} \in E} for i=1i = 1 to nn, where 1\mathbf{1} is the . Isolated vertices, which have no incident edges, yield di=0d_i = 0 and thus a zero entry on the corresponding diagonal position in DD, preserving the matrix's diagonal structure and indicating no contribution to the graph's connectivity from that vertex. 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)O(|E|) time overall since idi=2E\sum_i d_i = 2|E|; constructing the diagonal matrix then adds O(n)O(n) time.

Relation to adjacency matrix

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

Examples

Path graph

A path graph PnP_n consists of nn vertices labeled 11 through nn, connected by edges between consecutive vertices, specifically the edge set E={{i,i+1}1i<n}E = \{\{i, i+1\} \mid 1 \leq i < n\}. In PnP_n, the two endpoint vertices (1 and nn) each have degree 1, while the n2n-2 internal vertices (2 through n1n-1) each have degree 2. The degree matrix DD of PnP_n is the n×nn \times n whose diagonal entries diid_{ii} equal the degree of vertex ii, with all off-diagonal entries zero. For the small P3P_3, with vertices 1--2--3, the degrees are 1, 2, and 1, yielding D=(100020001).D = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix}.
Add your contribution
Related Hubs
User Avatar
No comments yet.