degree assortativity function