added degree_sum invariant