度矩阵(degree matrix)
度矩阵是对角阵,对角上的元素为各个顶点的度,顶点vi的度表示和该顶点相关联的变得数量。
- 在无向图中,顶点vi的度d(vi)=N(i)(即与顶点相连的边的数目)
- 有向图中,顶点vi的度分为顶点vi的出度和入度,即从顶点vi出去的有向边的数量和进入顶点vi的有向边的数量。

上图对应的度矩阵为:

邻接矩阵(adjaceny matrix)
邻接矩阵表示顶点间关系,是n阶方阵(n为顶点数量)。
邻接矩阵分为有向邻接矩阵和无向邻接矩阵。无向邻接矩阵是对称矩阵,而有向图的邻接矩阵不一定对称。
邻接矩阵的公式如下:

若给定下图:

对应的邻接矩阵为:
