TU Wien:Diskrete Mathematik für Informatik UE (Gittenberger)/Übungen WS13/Beispiel 29
Solution[Bearbeiten | Quelltext bearbeiten]
Proof: By induction on n. In the base case n = 2, the 2-dimensional hypercube, the length four cycle starts from 00, goes through 01, 11, and 10, and returns to 00.
Suppose now that every (n-1)-dimensional hypercube has an Hamiltonian cycle. Let be a vertex adjacent to (the notation means a sequence of n - 1 zeroes) in the Hamiltonian cycle in a (n−1)-dimensional hypercube. The following is a Hamiltonian cycle in an n-dimensional hypercube: have a path that goes from to by passing through all vertices of the form (this is simply a copy of the Hamiltonian path in dimension (n − 1), minus the edge from to ), then an edge from to , then a path from to that passes through all vertices of the form , and finally an edge from to .
This completes the proof of the Theorem.
When we start from and we follow the Hamiltonian tour described in the above proof, we find an ordering of all the n-bit binary strings such that each string in the sequence differs from the previous string in only one bit. Such an ordering is called a Gray code (from the name of the inventor) and it has various application.
Source: https://web.archive.org/web/*/http://inst.eecs.berkeley.edu/~cs70/sp07/lec/lecture14.pdf or https://inst.eecs.berkeley.edu/~cs70/sp07/lec/lecture14.pdf