added median_degree invariant to gt.py