add degree of nodes