State Minimisation
State Minimisation
State Minimisation
Lexical Analyzers
• Faisal A (61072111110)
• Gokul E (61072111112)
• Varun Kumar M (61072211917)
State Minimization
The task of State minimization is to
automatically transform a given DFA into a
state-minimized DFA
Several algorithms and variants are known
Note that this also in effect can minimize an NFA
(since we know algorithm to convert NFA to DFA)
Hopcroft Minimization
Algorithm
Remove all the states that are not reachable
from the initial state
Determine 0 equivalent state,1 equivalent
state,2 equivalent state,… ,n equivalent state
Repeat Step 2 until nth equivalent and (n-1)th
equivalent states result with same set of
strings
Construct minimal DFA using the result
obtained in Step 3
Hopcroft Minimization
Algorithm
The initial state of the minimized DFA is the
representative of the group containing the start state
of the original DFA
Merge s1 and s2
DFA Minimization
This is a state-minimized (or just minimized)
DFA
Every remaining state is necessary
DFA Minimization
So these two DFAs are equivalent:
Conclusion
DFA Minimization is a fairly understandable
process, and is useful in several areas
Regular expression matching implementation
Very similar algorithm is used for compiler
optimization to eliminate duplicate computations