Depicts a Gray code traversing all the nodes of a 4-dimensional hypercube. See http://yury.chebiryak.name/hypercubes.htm for more details.

Edit and compile if you like:
% Gray Code in 4-cube% Author: Yury Chebiryak\documentclass{article}\usepackage{tikz}\usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}\setlength\PreviewBorder{5pt}%\begin{document}\pagestyle{empty}\begin{figure}[bt]\centering\scalebox{0.6}{\begin{tikzpicture}[scale=5]\tikzstyle{vertex}=[circle,minimum size=20pt,inner sep=0pt]\tikzstyle{selected vertex} = [vertex, fill=red!24]\tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]\tikzstyle{edge} = [draw,thick,-,black]\node[vertex] (v0) at (0,0) {$0000$};\node[vertex] (v1) at (0,1) {$0001$};\node[vertex] (v2) at (1,0) {$0010$};\node[vertex] (v3) at (1,1) {$0011$};\node[vertex] (v4) at (0.23, 0.4) {$0100$};\node[vertex] (v5) at (0.23,1.4) {$0101$};\node[vertex] (v6) at (1.23,0.4) {$0110$};\node[vertex] (v7) at (1.23,1.4) {$0111$};\node[vertex] (v8) at (-1,-1) {$1000$};\node[vertex] (v9) at (-1,2) {$1001$};\node[vertex] (v13) at (-0.66,2.7) {$1101$};\node[vertex] (v12) at (-0.66,-0.3) {$1100$};\node[vertex] (v10) at (2,-1) {$1010$};\node[vertex] (v14) at (2.34,-0.3) {$1110$};\node[vertex] (v11) at (2,2) {$1011$};\node[vertex] (v15) at (2.34,2.7) {$1111$};\draw[edge] (v0) -- (v1) -- (v3) -- (v2) -- (v0);\draw[edge] (v0) -- (v4) -- (v5) -- (v1) -- (v0);\draw[edge] (v2) -- (v6) -- (v7) -- (v3) -- (v2);\draw[edge] (v4) -- (v6) -- (v7) -- (v5) -- (v4);\draw[edge] (v8) -- (v9) -- (v13) -- (v12) -- (v8);
Click to download: gray-code-in-4-cube.tex • gray-code-in-4-cube.pdf
Open in Overleaf: gray-code-in-4-cube.tex