Modelling Automata using Graphwiz API

An automata can be implemented in 2 ways.

1. Linked List representation

2. Matrix representation

I implemented a program in JAVA to model an automata(deterministic) in a Matrix structure and represent it graphically as shown to the left. The graphical representation was done by using the Graphviz JAVA api.

Eg. The Automata shown can be represented in matrix form as

  a    b   
S0 S3 S1
S1     S2 S1
S2    S3 S1
S3    S0 S3

I have uploaded the code at github, you can download it here


1. First compile the source files

$ javac

$ javac

2. If both compile  successfully, run

$ java FiniteStateMachine –filename <input_file>

3. By default, if you have evince reader, the gif file should pop up instantly, else edit the code and remove the System command being executed.

4. For more help run

$ java FiniteStateMachine –help

One comment on “Modelling Automata using Graphwiz API

  1. Pingback: A Transducer for Removing Comments in a file « From Patronizing to Patriotic

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s