de Bruijn digraph


The vertices of the de Bruijn digraph B⁢(n,m) are all possible words of length m-1 chosen from an alphabet of size n.

B⁢(n,m) has nm edges consisting of each possible word of length m from an alphabet of size n. The edge a1⁢a2⁢…⁢an connects the vertex a1⁢a2⁢…⁢an-1 to the vertex a2⁢a3⁢…⁢an.

For example, B⁢(2,4) could be drawn as: