revised graph_delete()