1 / 16

Minimizing DFAs

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.

ziva
Download Presentation

Minimizing DFAs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Minimizing DFAs The Partition Algorithm

  2. 1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6

  3. 1 q3 q4 1 1 0 0 0 0 q0 q1 q5 1 0 0 1 0 1 1 q2 q6

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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 .

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.

  15. 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!

  16. 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!

More Related