Adding function to calculate k-core number of each node and overall graph degeneracy.