I am trying to find a description for canonical form (labelling) for a graph. Specifically, how do we arrive at canonical form for a given graph?
1 Answers
Graph canonization is a a procedure that takes a graph $G$ and returns an isomorphic graph $C(G)$, we the promise that $C(G) = C(H)$ iff $G$ and $H$ are isomorphic. We call $C$ a canonical form.
One possible canonical form is the lexicographically smallest adjacency matrix. Given an ordering of the vertices, we can serialize the adjacency matrix as a binary string. Given a graph $G$, we choose the ordering leading to the lexicographically smallest such string, and then order the graph accordingly to form $C(G)$. It is not hard to check that this is a canonical form.
The algorithm, as stated, has exponential complexity, so isn't practical. There might be faster ways to compute this canonical form, or they might be other canonical forms which are easier to compute. Notice, however, that canonical forms can be used to solve graph isomorphism, and so finding an efficiently computable canonical form is hard and might be impossible (depending on the meaning of efficient).
It is still possible that there is an easily computable canonical form that works for most graphs, just like graph isomorphism is easy for most graphs. For more on this topic, see this question, and particularly the survey by McKay and Piperno mentioned in my answer there.
- 280,205
- 27
- 317
- 514