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 a1a2an connects the vertex a1a2an-1 to the vertex a2a3an.

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