In that algorithm (which could be used to find the Viterbi sequence), g denotes the score-so-far of a partial solution y :t , and h denotes the optimal score-togo.
g + h would be the score of the best sequence with prefix y :t .