A Stochastic k-tree grammar is a type of grammar that builds strings with respect to relationships that are found in k-trees. We developed an optimal parser for stochastic k-tree grammars. This parser is very similar to Viterbi's algorithm.