update degree when add/remove edges