From Word Overlap to Directed Edges
Suppose a collection of words is organized by how much consecutive information they share. A useful way to record that structure is to make each shorter word a vertex, then represent each longer word by a directed edge from its initial part to its final part. The edge records not only which two shorter words are related, but also the exact longer word that produces the relation.
Fix a finite nonempty alphabet \(\Sigma\), and write \(q=|\Sigma|\) for its number of symbols. A word of length \(r\) is an ordered sequence of \(r\) symbols from \(\Sigma\); the unique word of length zero is denoted by \(\varepsilon\). Let \(k\) be a positive integer. For a word \(w=w_1w_2\cdots w_k\) of length \(k\), its prefix of length \(k-1\) is \(w_1\cdots w_{k-1}\), and its suffix of length \(k-1\) is \(w_2\cdots w_k\). When \(k=1\), both are \(\varepsilon\).
Thus “order \(k\)” refers to the length of the edge words, not the length of the vertex words. Each edge moves from a word to the word obtained by dropping its first symbol and appending one new symbol. For \(k\ge2\), the two endpoint words overlap in \(k-2\) symbols. For \(k=1\), there is just one vertex, the empty word, and every symbol gives a loop at that vertex.
How to Construct the Digraph
The construction can be carried out systematically. First list every word of length \(k-1\). Then list every word of length \(k\), and for each one record its prefix and suffix of length \(k-1\) as its tail and head. The edge label should be kept: it identifies which length-\(k\) word the edge represents.
Specify a finite nonempty alphabet \(\Sigma\) and a positive integer \(k\).
Include every word of length \(k-1\), including \(\varepsilon\) when \(k=1\).
For each length-\(k\) word, direct its labelled edge from its prefix to its suffix of length \(k-1\).
Confirm that there are \(q^{k-1}\) vertices and \(q^k\) labelled edges, and that each vertex has \(q\) incoming and \(q\) outgoing edges.
Worked Example: Binary Words of Length Three
Take \(\Sigma=\{0,1\}\) and \(k=3\). The vertices are all words of length \(2\), so \(V=\{00,01,10,11\}\). There is one edge for each binary word of length \(3\). Listing each word with its prefix and suffix gives:
| Edge label | Tail | Head |
|---|---|---|
| 000 | 00 | 00 |
| 001 | 00 | 01 |
| 010 | 01 | 10 |
| 011 | 01 | 11 |
| 100 | 10 | 00 |
| 101 | 10 | 01 |
| 110 | 11 | 10 |
| 111 | 11 | 11 |
For example, the word \(101\) has prefix \(10\) and suffix \(01\), so its edge is \(10\to01\). The edge labelled \(000\) is a loop because its prefix and suffix are both \(00\). Here \(q=2\), so the formula gives \(q^{k-1}=2^2=4\) vertices and \(q^k=2^3=8\) edges, matching the lists. The two edges leaving \(00\) are \(000\) and \(001\); the two entering \(00\) are \(000\) and \(100\). The same check at the other vertices gives two incoming and two outgoing edges at each.
Check: counting the outgoing edges by their tails gives \(2+2+2+2=8\), agreeing with the eight distinct length-three labels. In particular, loops have not been discarded.
Overlap Determines Incidence
Proof. Write \(u=u_1\cdots u_{k-1}\) and \(v=v_1\cdots v_{k-1}\). If a length-\(k\) word gives an edge from \(u\) to \(v\), then that word has prefix \(u\) and suffix \(v\). The symbols common to these two parts must therefore agree: \(u_2\cdots u_{k-1}=v_1\cdots v_{k-2}\). This proves the required overlap condition. Conversely, suppose this equality holds. Form the word \(w=u_1\cdots u_{k-1}v_{k-1}\). Its prefix of length \(k-1\) is \(u\), and its suffix of length \(k-1\) is \(v\), using the assumed overlap. Thus it gives an edge from \(u\) to \(v\). Any word with prefix \(u\) and suffix \(v\) must have its first \(k-1\) symbols fixed by \(u\) and its last symbol fixed by \(v_{k-1}\), so it must equal \(w\). Hence the edge word is unique. For \(k=2\), the overlap consists of zero symbols, so the condition is vacuous and the unique edge from the one-symbol word \(u\) to the one-symbol word \(v\) is \(uv\). \(\square\)
The lemma gives a quick way to check an edge list: compare the overlapping symbols of its endpoints, then recover the label by appending the final symbol of the head to the tail. For order one, the lemma’s endpoint formulation is not needed: both endpoints are \(\varepsilon\), and the edge label is the chosen one-symbol word.
Counts and Degrees
Proof. A word of length \(r\) is formed by making \(r\) independent choices from the \(q\) symbols, so there are \(q^r\) such words. Applying this count with \(r=k-1\) gives \(q^{k-1}\) vertices; applying it with \(r=k\) gives \(q^k\) labelled edges. Now fix a vertex \(u=u_1\cdots u_{k-1}\). Each outgoing edge is formed by appending one symbol \(\sigma\in\Sigma\), giving the word \(u_1\cdots u_{k-1}\sigma\). Its tail is \(u\), and different choices of \(\sigma\) give different edge labels, so there are exactly \(q\) outgoing edges. Each incoming edge is formed by choosing a symbol \(\sigma\in\Sigma\) and taking the word \(\sigma u_1\cdots u_{k-1}\); these are \(q\) distinct labels, each with head \(u\). If \(k=1\), the vertex is \(\varepsilon\); the \(q\) one-symbol words all give loops there, and each is counted once in each directed degree. This proves the counts and degree statements in every case. \(\square\)
The degree calculation is local: each vertex has one outgoing edge for each possible next symbol and one incoming edge for each possible preceding symbol. It does not require the graph to be simple or to have no loops. In fact, the labelled-edge convention is important when different words have the same endpoints.
Worked Example: A Three-Symbol Alphabet at Order Two
Take \(\Sigma=\{a,b,c\}\) and \(k=2\). The vertices are the one-symbol words \(V=\{a,b,c\}\). Each two-symbol word \(xy\) gives the edge \(x\to y\), so the complete edge list is \(E=\{aa,ab,ac,ba,bb,bc,ca,cb,cc\}\), with each label indicating its directed endpoints.
From \(a\), the outgoing edges are \(aa:a\to a\), \(ab:a\to b\), and \(ac:a\to c\). The incoming edges are \(aa:a\to a\), \(ba:b\to a\), and \(ca:c\to a\). Thus \(a\) has three outgoing and three incoming edges. The same rule gives three of each at \(b\) and \(c\). Substituting \(q=3\) and \(k=2\), the vertex count is \(3^{2-1}=3\) and the edge count is \(3^2=9\), matching the lists.
Check: counting edges by their first symbol gives three with tail \(a\), three with tail \(b\), and three with tail \(c\), for \(3+3+3=9\) edges. Counting by their last symbol gives three entering each vertex, again for \(3+3+3=9\). The three loops \(aa\), \(bb\), and \(cc\) are part of these counts.
Worked Example: Order One
Take \(\Sigma=\{x,y,z\}\) and \(k=1\). A vertex is a word of length zero, so \(V=\{\varepsilon\}\). The three length-one words give three distinct labelled loops: \(x:\varepsilon\to\varepsilon\), \(y:\varepsilon\to\varepsilon\), and \(z:\varepsilon\to\varepsilon\). Thus this construction is a directed multigraph: its three edge objects have the same endpoints but different labels.
Substituting \(q=3\) and \(k=1\) into the formulas gives \(3^{1-1}=3^0=1\) vertex and \(3^1=3\) edges. The sole vertex has three outgoing edges and three incoming edges, since each of the three loops contributes once to each directed degree.
Check: there is exactly one empty word, and exactly three one-symbol words in the specified alphabet. Treating the graph as having only one unlabelled loop would lose two edge words and would not represent the construction.
Why the Construction Is Useful
The vertices summarize the part of a word that must be retained to determine the next overlap. A directed edge then records a possible one-symbol extension. This converts a question about how words fit together into a question about directed incidence. The labels preserve the original words, while the endpoints expose their shared structure.
The equal in-degree and out-degree at every vertex are useful structural checks. If a proposed edge list gives a vertex more incoming than outgoing edges, or omits one of the possible appended symbols, then it does not describe the stated de Bruijn digraph. The theorem establishes the expected degree for every vertex, including vertices with loops.
Common Pitfalls
Using length-\(k\) words as vertices. For the binary example with \(k=3\), a mistaken vertex list would have eight length-three words. The construction instead uses length-\((3-1)=2\) words, giving \(2^{3-1}=4\) vertices; the eight length-three words are the edges. The corrected count is four vertices and \(2^3=8\) edges.
Ignoring loops or labels. In the same binary example, \(000\) gives the loop \(00\to00\), and \(111\) gives \(11\to11\). Omitting loops would lose these two words. At order one, all edge words have the same endpoints, so forgetting labels would merge distinct edges and lose the word-to-edge correspondence.
Reversing prefix and suffix. The edge for \(101\) goes from \(10\) to \(01\), not from \(01\) to \(10\): the tail is the prefix and the head is the suffix. Checking both endpoints against the original word prevents this direction error.
Check Your Understanding
Use the construction and its definitions to answer the following questions.
- For \(\Sigma=\{a,b\}\) and \(k=3\), list the vertices and determine the tail and head of the edge labelled \(bab\).
- For \(k=2\), what overlap condition determines whether a directed edge goes from a one-symbol word \(u\) to a one-symbol word \(v\)?
- For an alphabet of size \(4\) and \(k=3\), how many vertices and labelled edges are there, and what are the in-degree and out-degree of each vertex?
- Why must the order-one construction retain distinct edge labels even though all its edges have the same tail and head?
- For \(\Sigma=\{0,1\}\) and \(k=2\), list all directed edges, including their labels and endpoints. Identify the loops.