The document discusses methods for minimizing deterministic finite automata (DFAs). It explains that states can be eliminated if they are unreachable, dead, or non-distinguishable from other states. The partitioning algorithm is described as a method for finding equivalent states that go to the same partitions under all inputs. The algorithm is demonstrated on a sample DFA, merging equivalent states into single states until no further merges are possible, resulting in a minimized DFA. The Myhill-Nerode theorem provides another approach using a state pair marking technique to identify indistinguishable states that can be combined.
2. Introduction
Minimization/optimization of a deterministic finite automaton refers to the
detection of those states of a DFA, whose presence or absence in a DFA does
not affect the language accepted by the automata.
The states that can be eliminated from automata, without affecting the
language accepted
by automata, are:
▪Unreachable or inaccessible states.
▪Dead states.
▪Non-distinguishable or indistinguishable state or equivalent states.
3. Minimizing DFA’s
Lots of methods
All involve finding equivalent states:
States that go to equivalent states under all inputs
4. Minimizing DFA’s by Partitioning
Consider the following DFA:
Accepting states are yellow
Non-accepting states are blue
5. S2 and S7 are really the same:
Both Final states
Both go to S6 under input b
Both go to S3 under an a
S0 and S5 really the same.
We can merge equivalent states into 1 state.
6. Partitioning Algorithm
First
Divide the set of states into
Final and
Non-final states
Partition I
Partition II
a b
S0 S1 S4
S1 S5 S2
S3 S3 S3
S4 S1 S4
S5 S1 S4
S6 S3 S7
*S2 S3 S6
*S7 S3 S6
7. Partitioning Algorithm
Now
See if states in each partition each go to the
same partition
S1 & S6 are different from the rest of the states
in Partition I(but like each other)
We will move them to their own partition
a b
S0 S1 I S4 I
S1 S5 I S2 II
S3 S3 I S3 I
S4 S1 I S4 I
S5 S1 I S4 I
S6 S3 I S7 II
*S2 S3 I S6 I
*S7 S3 I S6 I
9. Partitioning Algorithm
Now again
See if states in each partition each
go to the same partition
In Partition I, S3 goes
to a different partition
from S0, S5 and S4
We’ll move S3 to its own partition
a b
S0 S1 III S4 I
S5 S1 III S4 I
S3 S3 I S3 I
S4 S1 III S4 I
S1 S5 I S2 II
S6 S3 I S7 II
*S2 S3 I S6 III
*S7 S3 I S6 III
10. Partitioning Algorithm
Note changes in S6, S2 and S7
a b
S0 S1 III S4 I
S5 S1 III S4 I
S4 S1 III S4 I
S3 S3 IV S3 IV
S1 S5 I S2 II
S6 S3 IV S7 II
*S2 S3 IV S6 III
*S7 S3 IV S6 III
11. Partitioning Algorithm
Now S6 goes to a different partition on an
a from S1
S6 gets its own partition.
We now have 5 partitions
Note changes in S2 and S7
a b
S0 S1 III S4 I
S5 S1 III S4 I
S4 S1 III S4 I
S3 S3 IV S3 IV
S1 S5 I S2 II
S6 S3 IV S7 II
*S2 S3 IV S6 V
*S7 S3 IV S6 V
12. Partitioning Algorithm
All states within each of the 5 partitions are
identical.
We might as well call the states I, II III, IV
and V.
a b
S0 S1 III S4 I
S5 S1 III S4 I
S4 S1 III S4 I
S3 S3 IV S3 IV
S1 S5 I S2 II
S6 S3 IV S7 II
*S2 S3 IV S6 V
*S7 S3 IV S6 V
15. Myphill-Nerode Theorem
Step 1 Draw a table for all pairs of states (Qi, Qj) not
necessarily connected directly [All are
unmarked initially]
Step 2 Consider every state pair (Qi, Qj) in the DFA
where Qi ∈ F and Qj ∉ F or vice versa and
mark them. [Here F is the set of final states].
Step 3 Repeat this step until we cannot mark
anymore states −
If there is an unmarked pair (Qi, Qj), mark it
if the pair {δ(Qi, A), δ (Qi, A)} is marked for
some input alphabet.
Step 4 Combine all the unmarked pair (Qi, Qj) and
make them a single state in the reduced DFA.
19. Step 3 − We will try to mark the state pairs, with green colored check mark,
transitively. If we input 1 to state ‘a’ and ‘f’, it will go to state ‘c’ and ‘f’
respectively. (c, f) is already marked, hence we will mark pair (a, f). Now, we
input 1 to state ‘b’ and ‘f’; it will go to state ‘d’ and ‘f’ respectively. (d, f) is
already marked, hence we will mark pair (b, f).
20. After step 3, we have got state combinations {a, b} {c, d} {c, e} {d, e} that are
unmarked.
We can recombine {c, d} {c, e} {d, e} into {c, d, e}
Hence we got two combined states as − {a, b} and {c, d, e}
So the final minimized DFA will contain three states {f}, {a, b} and {c, d, e}