Can the bytes returned by pynauty's "certificate" function be converted into a graph format readable by Sage?
I know nauty has been integrated with Sage. Has pynauty been integrated in Sage 10?
I am using Sage 9.5, and it doesn't seem to have pynauty integrated. So, I installed this third-party package. I'm particularly interested in one of its functions, certificate
. The function "certificate" serves a similar purpose to the canonical_label
in Sage. (A canonical graph is the representative graph of an isomorphism class by some canonization function $c$. If $G$ and $H$ are graphs, then $G \cong c(G)$, and $c(G)==c(H)$ if and only if $G \cong H$.)
However, certificate(g)
provides bytes instead of a graph. I'm not sure how to interpret them. I'm thinking of converting a graph after applying certificate(g)
into the graph format used in Sage.
from pynauty import *
g = Graph(5)
g.connect_vertex(0, [1, 2, 3])
g.connect_vertex(2, [1, 3, 4])
g.connect_vertex(4, [3])
print(g)
g1=certificate(g)
b'\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x98\x00\x00\x00\x00\x00\x00\x00h\x00\x00\x00\x00\x00\x00\x00\xf0'
I cannot convert the above bytes to graphs. It preferable to preserve its "canonical" form when converting the bytes into a graph format in Sage.
I opened an issue on the developer's interface, but it seems like there hasn't been a response yet. See the following link: