.Viterbi algorithm