• Home
  • Queen's University
  • Software Specifications
  • Minimization of Deterministic Finite Automata

Minimization of Deterministic Finite Automata

CISC/CMPE-223, Winter 2023, Minimization of deterministic state diagrams 1 As the last topic on regular languages we consider an algorithm to minimize deterministic state diagrams. More on this topic can be found in the textbook by P. Linz [3]. A link to the textbook is given in CISC/CMPE-223 onQ pages. Unreachable/useless states: A state diagram, whether deterministic or nondeterministic, may have states that cannot be reached in computations on any input word, such states are called useless. This includes states that cannot be reached from the start state and states that have no outgoing path reaching an accepting state. By viewing a state diagram as a directed graph, useless states can be found using a straigthforward graph reachability algorithm. How? Once the useless states are identified, they can be simply deleted from the state diagram. Removing useless states is a first step in minimization, however, a DFA with no useless states need not be minimal. Consider the example given in Figure 1. Here states B and C are indistinguishable (as defined more precisely below) in the sense that any string w takes the state B to an accepting state if and only if w takes C to an accepting state. Indistinguishable states can be merged into one state. In the DFA of Figure 1 also states A and D are indistinguishable. A Figure 1: The states B and C can be merged into one state. Also states A and D can be merged. Based on the above idea of merging indistinguishable states we present an algorithm to CISC/CMPE-223, Winter 2023, Minimization of deterministic state diagrams 2 minimize an arbitrary DFA.1 More on on minimization of DFAs can be found in the textbook by P. Linz [3]. A link to the text is given on the course web site. For the algorithm we need to define a notion of distinguishability for states of a DFA and for this purpose we use some formal notation. Recall that a DFA was defined as a tuple M = (Q,?,?, s, F) where Q is the set of states, E is the input alphabet, ? : Q x E -> Q is the transition function, s E Q is the start state and F C Q is the set of accepting states. We extend § as a function ô : Q × 2* - > Q by defining inductively 1. ô(q, E) = q for all q E Q, and, 2. ?(q, w?) = ?(?(q, w), a) for all q E Q, a € E and w € ? *. In the following also the extended transition function & is denoted simply by 8. For a state q E Q and string w E 24, 8(q, w) is the unique state that the DFA M is in after reading the string w assuming the computation starts in state q. Note that here M is a complete DFA, that is, 8 : Q × 2 -> Q is a total function. Earlier in the course we