/automata

Finite Automata Optimizer

Primary LanguageJavaOtherNOASSERTION

Finite Automata Optimizer

This project Finite Automata Optimizer (Otimizador de Autômatos Finitos) was developed to reduce any NFA (Nondeterministic Finite Automata) to a minimal DFA (Deterministic Finite Automata).

This is a flowchart showing the operation of the application:

Flowchart

For the sample input below:

Input Output
a b c a c
q0 q1 q2 q3 q0 q2q3q3
q0 q0
q3 q2q3q3
q0 _ q1 q0 a q2q3q3
q0 a q3 q0 c q2q3q3
q0 b q2
q1 c q2
q1 c q3

Here are some screenshots of the automata been optimized:

Initial automata Initial automata

Elimination of epsilon transitions Elimination of epsilon transitions

Elimination of nondeterminism Elimination of nondeterminism

Elimination of unreachable states Elimination of unreachable states

Elimination of useless states Elimination of useless states

Minimal DFA Minimal DFA

Source code:

This source was written in Java language using NetBeans 7.x as IDE and the JUNG library to draw the graphs. All classes, methods, atributtes, etc. are written in English, but most comments are written in Brazilian Portuguese (as required by the teacher).

I’m not the only author of this code, it was written along with my classmate Guilherme Maganha Moreira. We can not guarantee that the algorithms are 100% correct, because at the time we wrote this code we are still learning about automata.

We decided to release our source code under the MIT License. The JUNG library is licensed under the BSD License and is included in binary form.