Graph Theory37 sections · 1633 units
Open in Course

Cracking the Safe - Core idea

Generalized De Bruijn graph.

Core idea: Same as De Bruijn sequence, but with alphabet {0,1,.,k1}\{0, 1,., k-1\}.

Graph construction:

  • kn1k^{n-1} vertices (each is an (n1)(n-1)-digit string)
  • knk^n edges (each is an nn-digit string)
  • Vertex has kk outgoing edges (append 0,1,.,k10, 1,., k-1)
  • Each vertex has in-degree == out-degree =k= k

Euler circuit exists: All vertices have equal in/out degrees.

The result string has length kn+n1k^n + n - 1.