We need to copy all the nodes and all the edges.
- iterate all nodes in graph
- when we iterate each node, we need to copy the node and copy all the outgoing edges from the current node.
We can use a map to map the origin vertex to the copied vertex.
time: O(E + V)
space: O(V)
We just need to reverse the edge when we add the copy to it.