Question: CopyGraph and normal assignment

I've found a fundamental difference in the use of 

G2:=CopyGraph(G):
and
G2:=G:

where G is a Graph in the GraphTheory package.

 

If I change G2 in the first case, G remains the same.

If I change G2 in the second case, G changes together with G2.

(The same happens when G is an input parameter in a procedure. Normally formal parameters cannot be changed, but if G is a graph there is no error message when changing G). 


This is totally different from happens with normal assignments of variables, like

x:=3:

y:=x:

x:=4:

y; 3 

 

Could someone explain why and how these assignments are different? 

Please Wait...