Degree of Vertices, Matrix Operations