Definition
The degree matrix of an undirected Graph is a Diagonal Matrix representing the sum of the weight of edges connected to each node. It is used together with the Adjacency Matrix to construct the Laplacian Matrix of a graph.
Given a graph and the corresponding Adjacency Matrix . The degree matrix is defined as where ,
Examples
Given graph

Degree matrix