Read and generate initial configuration.
Implement forward and backward algorithms.