New successor rules for constructing de Bruijn sequences Dennis Wong Northwest Missouri State University Daniel Gabric and Joe Sawada University of Guelph, CAN Aaron Williams Simon s Rock, USA Southeastern 2017 1 / 13
Outline 1. What is a de Bruijn sequence? 2. Construction methods Euler cycles in a de Bruijn graph Greedy approach Linear feedback shift registers Successor rules 3. Necklaces and co-necklaces 4. New successor rules Southeastern 2017 2 / 13
Definition What is a de Bruijn sequence? A de Bruijn sequence is a circular string of length 2 n where every binary string of length n occurs as a substring (exactly once). Example 0000101101001111 is a de Bruijn sequence for n = 4 The 16 unique substrings of length 4 are: 0000, 0001, 0010, 0101, 1011, 0110, 1101, 1010, 0100, 1001, 0011, 0111, 1111, 1110, 1100, 1000. Southeastern 2017 3 / 13
Definition What is a de Bruijn sequence? A de Bruijn sequence is a circular string of length 2 n where every binary string of length n occurs as a substring (exactly once). Example 0000101101001111 is a de Bruijn sequence for n = 4 The 16 unique substrings of length 4 are: 0000, 0001, 0010, 0101, 1011, 0110, 1101, 1010, 0100, 1001, 0011, 0111, 1111, 1110, 1100, 1000. PROBLEM: How to efficiently construct a de Bruijn sequence? Southeastern 2017 3 / 13
Construction method #1: Graph model Construct the de Bruijn graph with 2 n 1 vertices and 2 n edges: A de Bruijn sequence is in 1-1 correspondence with an Euler cycle in a de Bruijn graph. Southeastern 2017 4 / 13
Construction method #1: Graph model Construct the de Bruijn graph with 2 n 1 vertices and 2 n edges: A de Bruijn sequence is in 1-1 correspondence with an Euler cycle in a de Bruijn graph. By counting Euler cycles, the number of de Bruijn sequences is: 2 2n 1 n Southeastern 2017 4 / 13
Construction method #1: Graph model Construct the de Bruijn graph with 2 n 1 vertices and 2 n edges: A de Bruijn sequence is in 1-1 correspondence with an Euler cycle in a de Bruijn graph. By counting Euler cycles, the number of de Bruijn sequences is: 2 2n 1 n this method requires exponential space to store the graph Southeastern 2017 4 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 00001 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 000011 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 0000111 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 00001111 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 000011111 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 000011110 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 0000111101 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 00001111011 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 000011110111 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 000011110110 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 0000111101100101 Southeastern 2017 5 / 13
Construction method #2: Greedy approach Prefer-larger greedy algorithm (Martin 1934) 1. Start with 0 n (very important!) 2. Repeat: append the largest bit that does not create a duplicate length n substring Example n = 4 0000111101100101 Other greedy approaches: Prefer-same (Eldert 1958) Prefer-opposite (Alhakim 2010) these methods require exponential space to remember the sequence Southeastern 2017 5 / 13
Construction method #3: Linear feedback shift registers Construct and iterate an LFSR 1. Find a primitive polynomial polynomial of order n 2. Construct a linear feedback shift register from the polynomial 3. Iterate through register 2 n 1 times time and space efficient misses the string 0 n requires a different primitive polynomial for each n Southeastern 2017 6 / 13
Construction method #4: Successor rules Successor rule constructions A successor rule for a given de Bruijn sequence is a function { b1 if conditions NEXT (b 1 b 2 b n ) = otherwise that returns the bit following the substring b 1 b 2 b n. b 1 Southeastern 2017 7 / 13
Construction method #4: Successor rules Successor rule constructions A successor rule for a given de Bruijn sequence is a function { b1 if conditions NEXT (b 1 b 2 b n ) = otherwise that returns the bit following the substring b 1 b 2 b n. b 1 For the n = 4 de Bruijn sequence 0000101101001111, its successor rule would define NEXT (1010) = 0. Southeastern 2017 7 / 13
Necklaces and co-necklaces Strings from cycling register (rotate left) Strings from Complementing Cycling Register (complement first bit then rotate left) 10100 10100 01001 01000 10010 10001 00101 00010 01010 00101 01011 10111 01110 11101 11010 The lexicographically smallest element from each equivalence class is called a necklace and co-necklace respectively. Southeastern 2017 8 / 13
Necklace based successor rules Wong Successor (SWW 2016) { b1 if b NEXT (b 1 b 2 b n ) = 2 b 3 b n 1 is a necklace b 1 otherwise. Southeastern 2017 9 / 13
Necklace based successor rules Wong Successor (SWW 2016) { b1 if b NEXT (b 1 b 2 b n ) = 2 b 3 b n 1 is a necklace b 1 otherwise. Williams Successor *NEW* { b1 if 0b NEXT (b 1 b 2 b n ) = 2 b 3 b n is a necklace b 1 otherwise. Fredricksen (1972) gave the only other necklace based conditions Southeastern 2017 9 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Wong successor rule (necklace spanning tree n = 5) Southeastern 2017 10 / 13
Co-necklace based successor rules Huang (1990) gave the only other co-necklace based conditions (quite complex) Gabric Successor *NEW* Let β = b 1b 2 b n and let γ = b 2b 3 b n0 { b1 if b 2b 3 b n0 0 n is a co-necklace NEXT (b 1b 2 b n) = otherwise. b 1 Southeastern 2017 11 / 13
Gabric successor rule (co-necklace spanning tree n = 5) Southeastern 2017 12 / 13
Gabric successor rule (co-necklace spanning tree n = 5) Southeastern 2017 12 / 13
Summary of results So far we have found 6 new de Bruijn successors where each bit can be computed in O(n)-time O(n)-memory is required Related techniques allow us to construct an exponential number of de Bruijn sequences where each bit can be computed in O(n)-time O(n 2 )-memory is required Southeastern 2017 13 / 13
Summary of results So far we have found 6 new de Bruijn successors where each bit can be computed in O(n)-time O(n)-memory is required Related techniques allow us to construct an exponential number of de Bruijn sequences where each bit can be computed in O(n)-time O(n 2 )-memory is required -Gracias- Southeastern 2017 13 / 13