graph_delete implementation