Complete graph invariant 2026-11-05
A complete graph invariant is a graph invariant whose value determines a graph up to graph isomorphism. For graphs in a specified class, completeness means
An ordinary invariant only requires the forward preservation statement . Completeness adds the converse: equal values must exclude graph non-isomorphism.
A direct construction proves that complete invariants exist for finite undirected simple graphs. For an -vertex graph, label its vertices and list the entries above the diagonal of its adjacency matrix in the fixed order . This gives a binary string. Repeat for every labeling and choose the least string in lexicographic order. Define to be the pair consisting of and this least string. Including distinguishes graphs whose edge string is empty but whose vertex counts differ.
Relabeling a graph permutes the same collection of candidate strings, so isomorphic graphs have the same minimum. Conversely, if two minima and vertex counts agree, some labeling of each graph gives exactly the same adjacency entries. Matching vertices with those labels is an isomorphism. This proves both directions, without assuming that the construction is computationally fast.
For an original three-vertex example, a path's possible strings are , and in the order . Its invariant is . A triangle instead gives . The difference certifies non-isomorphism. For larger graphs the naive construction may examine labelings, so mathematical completeness alone supplies no practical speed guarantee.
Canonical graph labeling produces a standardized labeled representative and is closely connected to this construction. The authors of nauty and Traces identify canonical-label production as one of their programs' tasks.[ref] A particular program's chosen representative need not be the lexicographically least string used in this illustrative definition; comparisons must use the same canonization convention.
Vertex count, edge count and degree sequence are useful inexpensive invariants but are not complete. The example in graph non-isomorphism gives equal values for all three while connectedness differs. Completeness concerns the information retained, separately from the effort required to compute it.
Graph non-isomorphism 2026-11-05
Two graphs exhibit graph non-isomorphism when no bijection of their vertex sets preserves and reflects adjacency. For finite simple graphs and , this means there is no bijection satisfying
for every pair of distinct vertices. Changing vertex names or drawing positions cannot establish non-isomorphism; the adjacency structure must differ.
A graph invariant is a property preserved by graph isomorphism. Different numbers of vertices, edges or connected components of a graph immediately prove non-isomorphism. Equal values of one invariant need not prove isomorphism.
For an original example, let be the six-vertex cycle graph with edges , and let be the disjoint union of graphs consisting of triangles and . Both have six vertices, six edges and degree sequence . Nevertheless, is a connected graph, whereas has two connected components. Any adjacency-preserving bijection transports a path to a path, so it would have to preserve connectedness. No such bijection exists. The common degree sequence is therefore an incomplete isomorphism test.
Finite exhaustive checking provides a direct decision procedure: if the vertex counts agree at , examine each of the possible bijections and test adjacency. If every bijection fails, the graphs are non-isomorphic. More efficient procedures can avoid enumerating all bijections; this simple procedure explains the logical criterion, rather than a practical performance bound.
Software tests also require a decision about what belongs to the structure. NetworkX's is_isomorphic ignores node and edge attributes by default; matching functions can require them to agree.[ref] Two differently colored copies of the same uncolored graph can thus be isomorphic as simple graphs but non-isomorphic under a color-preserving requirement. The intended graph category must be specified before interpreting a negative result.