Added a function to compute the degree of any vertex of the graph