added vertixes degree optimization