Hi all, Im trying to write a program that minimizes a Transition Graph (its basically combining states with similar numbers). Basically, the algorithm is to first find states with the same 'a' and 'b' inputs, combine them, remove them from the 'leftovers' list, then find states that have either 'a' or 'b' and combine them.
Here is an example:
Initial TG:
final state is state 1
State Input a Input b
[0] [3] [1]
[1] [1] [4]
[2] [3] [1]
[3] [6] [3]
[4] [2] [7]
[5] [1] [3]
[6] [2] [5]
[7] [1] [3]
final state leftover
[ 1 ] [ 0 2 3 4 5 6 7 ]
final state same a,b leftover
[ 1 ] [ 0 2 ] [ 3 4 5 6 7 ]
final state same a,b same a,b leftover
[ 1 ] [ 0 2 ] [5 7 ] [ 3 4 6 ]
final state same a,b same a,b same a leftover
[ 1 ] [ 0 2 ] [ 5 7 ] [ 4 6 ] [ 3 ]
The Final Minimized TG now looks like this:
State Input a Input b
[0,2] [3] [1]
[1] [1] [4,6]
[3] [4,6] [3]
[4,6] [0,2] [5,7]
[5,7] [1] [3]
The problem Im facing is knowing how/what to do with the arrays since there could be any number of combinations depending on the amount of states in a given Transition Graph. Any ideas on how to code this?
Thanks