add new degree count method: undirected graph degree counter