Ternary Directed Acyclic Word Graphs
Given a set S of strings, a DFA accepting S offers a very time-efficient solution to the pattern matching problem over S. The key is how to implement such a DFA in the trade-off between time and space, and especially the choice of how to implement the transitions of each state is critical. Bentley and Sedgewick proposed an effective tree structure called ternary trees. The idea of ternary trees is to ‘implant’ the process of binary search for transitions into the structure of the trees themselves. This way the process of binary search becomes visible, and the implementation of the trees becomes quite easy. The directed acyclic word graph (DAWG) of a string w is the smallest DFA that accepts all suffixes of w, and requires only linear space. We apply the scheme of ternary trees to DAWGs, introducing a new data structure named ternary DAWGs (TDAWGs). We perform some experiments that show the efficiency of TDAWGs, compared to DAWGs in which transitions are implemented by tables and linked lists.
Unable to display preview. Download preview PDF.
- G. M. Andelson-Velskii and E. M. Landis. An algorithm for the organisation of information. Soviet. Math., 3:1259–1262, 1962.Google Scholar
- J. Bentley and B. Sedgewick. Ternary search trees. Dr. Dobb’s Journal, 1998. http://www.ddj.com/.
- J. Bentley and R. Sedgewick. Fast algorithms for sorting and searching strings. In Proc. 8th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’97), pages 360–369. ACM/SIAM, 1997.Google Scholar
- M. Crochemore and W. Rytter. Jewels of Stringology. World Scientific, 2002.Google Scholar
- M. Crochemore and R. Vérin. On compact directed acyclic word graphs. In Structures in Logic and Computer Science, volume 1261 of LNCS, pages 192–211. Springer-Verlag, 1997.Google Scholar
- S. Inenaga, H. Hoshino, A. Shinohara, M. Takeda, S. Arikawa, G. Mauri, and G. Pavesi. On-line construction of compact directed acyclic word graphs. In A. Amir and G. M. Landau, editors, Proc. 12th Annual Symposium on Combinatorial Pattern Matching (CPM’01), volume 2089 of LNCS, pages 169–180. Springer-Verlag, 2001.Google Scholar
- P. Weiner. Linear pattern matching algorithms. In Proc. 14th Annual Symposium on Switching and Automata Theory, pages 1–11, 1973.Google Scholar