The Algorithm to Compute the Optimal IO Sequences
1. Construct a graph where the node represents
a pair of states and the edge represents the relation
between these pair of states.
2. Blacken the nodes that have IO Sequences of length 1.
3. Find the shortest path from the other nodes to the
black nodes to obtain their IO Sequences.