1 | initial version |
H = G does not make a copy of the graph. G and H are the very same object in memory, and if you modify one the other also contains the modification. It is the very same memory address. If you want to copy your graph, use H = copy(G).
This is a behaviour that you should expect in any object-oriented language.