On Computing Optimal Controllers for Finite State Systems