Created method to get degree for undirected graph