add a copy constructor for the graph