160 likes | 275 Views
Minimizing DFAs. The Partition Algorithm. 1. q 3. q 4. 1. 1. 0. 0. 0. 0. q 0. q 1. q 5. 1. 0. 0. 1. 0. 1. 1. q 2. q 6. 1. q 3. q 4. 1. 1. 0. 0. 0. 0. q 0. q 1. q 5. 1. 0. 0. 1. 0. 1. 1. q 2. q 6. 1. q 3. q 4. 1. 1. 0. 0. 0. 0. q 0. q 1. q 5.
E N D
Minimizing DFAs The Partition Algorithm
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 In the first step we distinguish the accepting and the non-accepting states.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 The accepting states are colored purple while the non-accepting states remain orange.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 We now have two groups of states. The purple group and the orange group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 In the next step we distinguish those states that, despite the fact that they are in the same group so far, either 0 or 1 takes them to different groups.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 For example, look at the rows of q0, q1and q2, q3 .
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 q0, q1under 1 take us to the orange group while q2, q3 under 1 take us to the purple group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 Thus, we distinguish q2, q3 by putting them in a different group than q0, q1, the green group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 Now q0 and q1 should no more be in the same group. q0 under 0 takes us to the orange group while q1 under 0 takes us to the green group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 So we should put q1in a different group than q0, say the blue group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 Last, notice that q5 is also different than q4 or q6.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 We should create a new group for q5, the grey group.
1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6 At this point there are no other states which can be distinguished!
q46 0 0 1 q23 1 1 q0 0,1 0 q1 q5 0 1 Now we merge the states in same groups. This is the minimum DFA!