title: Best way to construct a Directed Acyclic Word Graph (DAWG)
body: <p>I am currently looking into DAWGs and I haven't been able to find one good way of constructing an acyclic automaton.</p>
  
  <p>So basically, what I want to do is this : </p>
  
  <p><img src="https://i.stack.imgur.com/NNBbT.png" alt="DAWG"></p>
  
  <p>It is basically a tree, where the number of states are reduced. I would use it with numbers but the concept is exactly the same. </p>
  
  <p>I wonder what would be the fastest way to do it, my actual plan was to construct the graph as shown on the left, and then look at the states of low level and when they are similar merge them. </p>
  
  <p>Although, I am not sure this is the best way of doing it, does anyone have an idea on how to construct it. </p>
  
  <p>Regards.</p>