Viterbi semiring

How do we find the best path in a maze of choices?

Image: Unidentified U.S. Army photographer, Public domain, via Wikimedia Commons

Viterbi semiring

How do we find the best path in a maze of choices?

Imagine you're playing a game where you have to guess a sequence of colors to win a prize. Each guess costs money, and you want to minimize your losses while maximizing your chances of winning.

Think of each color as a step in a path. Viterbi looks at the most likely sequence of colors, while dynamic programming checks every possible sequence. Viterbi is like choosing the most obvious path, while dynamic programming explores every option.

Example

You have three colors to choose from: red, blue, and green. Viterbi might choose red, then blue, then green, because it seems most likely. Dynamic programming would check every combination: red-red-red, red-red-blue, red-blue-red, and so on.

Remember this

Viterbi quickly finds a good path by looking at the most likely choices, while dynamic programming checks every possibility to find the best one.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath