Implement degree distribution calculation