added maximum_average_degree invariant to gt.py