In graph theory, a distinguishing coloring or distinguishing labeling of a graph is an assignment of colors or labels to the vertices of the graph that destroys all of the nontrivial symmetries of the graph. The coloring does not need to be a proper coloring: adjacent vertices are allowed to be given the same color. For the colored graph, there should not exist any one-to-one mapping of the vertices to themselves that preserves both adjacency and coloring. The minimum number of colors in a distinguishing coloring is called the distinguishing number of the graph.
Distinguishing colorings and distinguishing numbers were introduced by Albertson & Collins (1996), who provided the following motivating example, based on a puzzle previously formulated by Frank Rubin: "Suppose you have a ring of keys to different doors; each key only opens one door, but they all look indistinguishable to you. How few colors do you need, in order to color the handles of the keys in such a way that you can uniquely identify each key?" This example is solved by using a distinguishing coloring for a cycle graph. With such a coloring, each key will be uniquely identified by its color and the sequence of colors surrounding it.
In a complete graph, the only distinguishing colorings assign a different color to each vertex. For, if two vertices were assigned the same color, there would exist a symmetry that swapped those two vertices, leaving the rest in place. Therefore, the distinguishing number of the complete graph Kn is n. However, the graph obtained from Kn by attaching a degree-one vertex to each vertex of Kn has a significantly smaller distinguishing number, despite having the same symmetry group: it has a distinguishing coloring with colors, obtained by using a different ordered pair of colors for each pair of a vertex Kn and its attached neighbor.
For a cycle graph of three, four, or five vertices, three colors are needed to construct a distinguishing coloring. For instance, every two-coloring of a five-cycle has a reflection symmetry. In each of these cycles, assigning a unique color to each of two adjacent vertices and using the third color for all remaining vertices results in a three-color distinguishing coloring. However, cycles of six or more vertices have distinguishing colorings with only two colors. That is, Frank Rubin's keyring puzzle requires three colors for rings of three, four or five keys, but only two colors for six or more keys or for two keys. For instance, in the ring of six keys shown, each key can be distinguished by its color and by the length or lengths of the adjacent blocks of oppositely-colored keys: there is only one key for each combination of key color and adjacent block lengths.
Hypercube graphs exhibit a similar phenomenon to cycle graphs. The two- and three-dimensional hypercube graphs (the 4-cycle and the graph of a cube, respectively) have distinguishing number three. However, every hypercube graph of higher dimension has distinguishing number only two.
The Petersen graph has distinguishing number 3. However other than this graph and the complete graphs, all Kneser graphs have distinguishing number 2. Similarly, among the generalized Petersen graphs, only the Petersen graph itself and the graph of the cube have distinguishing number 3; the rest have distinguishing number 2.
The exact complexity of computing distinguishing numbers is unclear, because it is closely related to the still-unknown complexity of graph isomorphism. However, it has been shown to belong to the complexity class AM. Additionally, testing whether the distinguishing number is at most three is NP-hard, and testing whether it is at most two is "at least as hard as graph automorphism, but no harder than graph isomorphism".
A coloring of a given graph is distinguishing for that graph if and only if it is distinguishing for the complement graph. Therefore, every graph has the same distinguishing number as its complement.
For every graph G, the distinguishing number of G is proportional to the logarithm of the number of automorphisms of G. If the automorphisms form a nontrivial abelian group, the distinguishing number is two, and if it forms a dihedral group then the distinguishing number is at most three.
For every finite group, there exists a graph with that group as its group of automorphisms, with distinguishing number two. This result extends Frucht's theorem that every finite group can be realized as the group of symmetries of a graph.
A proper distinguishing coloring is a distinguishing coloring that is also a proper coloring: each two adjacent vertices have different colors. The minimum number of colors in a proper distinguish coloring of a graph is called the distinguishing chromatic number of the graph.
- Rubin, Frank (1979), "Problem 729: the blind man's keys", Journal of Recreational Mathematics, 11: 128. Solution in vol. 12, 1980. As cited by Albertson & Collins (1996). Instead of using colors, Rubin phrased the problem in terms of key handles that could be distinguished from each other by touch. More precisely, this problem assumes that each key is symmetric, so that the keys cannot be distinguished from each other by their orientations on the keyring.
- Albertson, Michael O.; Collins, Karen L. (1996), "Symmetry breaking in graphs", Electronic Journal of Combinatorics, 3 (1): R18, MR 1394549.
- See, e.g., Imrich, Wilfried; Klavžar, Sandi (2006), "Distinguishing Cartesian powers of graphs", Journal of Graph Theory, 53 (3): 250–260, CiteSeerX 10.1.1.59.9242, doi:10.1002/jgt.20190, MR 2262268,
If a graph has no nontrivial automorphisms its distinguishing number is 1. In other words, D(G) = 1 for asymmetric graphs.
- Bogstad, Bill; Cowen, Lenore J. (2004), "The distinguishing number of the hypercube", Discrete Mathematics, 283 (1–3): 29–35, doi:10.1016/j.disc.2003.11.018, MR 2061481.
- Albertson, Michael O.; Boutin, Debra L. (2007), "Using determining sets to distinguish Kneser graphs", Electronic Journal of Combinatorics, 14 (1): R20, MR 2285824.
- Lal, A. K.; Bhattacharjya, B. (2009), "Breaking the symmetries of the book graph and the generalized Petersen graph", SIAM Journal on Discrete Mathematics, 23 (3): 1200–1216, doi:10.1137/080728640, MR 2538646. Lal and Bhattacharjya (Theorem 4.3) credit this result to an unpublished masters thesis of K. S. Potanka (Virginia Polytechnic University, 1998).
- Cheng, Christine T. (2006), "On computing the distinguishing numbers of trees and forests", Electronic Journal of Combinatorics, 13 (1): R11, MR 2200539.
- Arvind, V.; Cheng, Christine T.; Devanur, Nikhil R. (2008), "On computing the distinguishing numbers of planar graphs and beyond: a counting approach", SIAM Journal on Discrete Mathematics, 22 (4): 1297–1324, arXiv:math/0703927, doi:10.1137/07068686X, MR 2443115.
- Cheng, Christine T. (2009), "On computing the distinguishing and distinguishing chromatic numbers of interval graphs and other results", Discrete Mathematics, 309 (16): 5169–5182, doi:10.1016/j.disc.2009.04.004, MR 2548918.
- Russell, Alexander; Sundaram, Ravi (1998), "A note on the asymptotics and computational complexity of graph distinguishability", Electronic Journal of Combinatorics, 5: R23, MR 1617449.
- Eschen, Elaine M.; Hoàng, Chính T.; Sritharan, R.; Stewart, Lorna (2011), "On the complexity of deciding whether the distinguishing chromatic number of a graph is at most two", Discrete Mathematics, 311 (6): 431–434, doi:10.1016/j.disc.2010.12.013, MR 2799894.
- Collins, Karen L.; Trenk, Ann N. (2006), "The distinguishing chromatic number", Electronic Journal of Combinatorics, 13 (1): R16, MR 2200544.