refactory clear,delete edge and delete vertex