Add the method to release the graph