Question: (a) Describe how to extend the Aho-Corasick algorithm presented in class to work when one pattern can occur as a prefix of another pattern,

(a) Describe how to extend the Aho-Corasick algorithm presented in class to work when one pattern can occur as a prefix of another pattern, but not as an arbitrary substring of it. For example, the pattern set "he, here, ham, hambone" satisfies this property. What additions do you have to make to the Aho-Corasick automaton to find all occurrences of each pattern? (b) Describe how to extend the Aho-Corasick algorithm to work when one pattern can occur as an arbitrary substring of another. For example, the pattern set "he, she, they, them" satisfies this property. Again, what additions do you have to make to the Aho-Corasick automaton to find all occurrences of each pattern? For each subproblem above, any extensions you make should preserve the automaton's asymptotic size (proportional to at most the sum of the pattern lengths). The search must still complete in time proportional to the length of the text plus the number of matches found.
Step by Step Solution
3.32 Rating (149 Votes )
There are 3 Steps involved in it
a To extend the AhoCorasick algorithm to handle patterns where one pattern can occur as a prefix of another pattern but not as an arbitrary substring of it we need to modify the construction of the Ah... View full answer
Get step-by-step solutions from verified subject matter experts
