graph destructor