function like AIS_InteractiveContext::EraseSelected

Is there any function like AIS_InteractiveContext::EraseSelected, I want to delete the created graph and release the memory
Thanks for your help.