how to empty a graph?