I noticed the following strange behavior of graph6_string()/sparse6_string() functions of graphs:
sage: K2=graphs.CompleteGraph(2)
sage: P=K2.cartesian_product(K2)
sage: print(P.sparse6_string())
sage: print(Graph(P.graph6_string()).sparse6_string())
:CoKN
:Cci
To explain: I understand, that Graph(P.graph6_string()) != P (as graph6_string does not preserve the original set of vertices).
On the other hand, I was expecting that the ordering of vertices would be the same, leading to the same sparse6_string().
I understand that the problem stems from having vertices not of form range(n).
However, even after looking at the documentation, I haven't been able to decide, if this is a bug or feature ...
If the latter is the case, I suggest adding a visible warning (or perhaps only give the string if the list of vertices is range(n)?).
Another observation, in the other direction I see the same behaviour:
sage: print(P.graph6_string())
sage: print(Graph(P.sparse6_string(),loops=False, multiedges=False).graph6_string())
I am using sage 8.9 (python 3 and python 2 versions behave the same).
On the other hand, an older version of sage behaves in the expected way, that is returns the same string twice.
Also adding P.relabel() before the tests leads to the expected result.