graph: implement create and destroy