简体   繁体   中英

Can we apply Viterbi algorithm if there are cycles in a graph?

I am trying to solve a question which can be solved both by BFS and viterbi algorithm. But BFS might fail if there are cycles in the graph. So my question is viterbi algorithm cycle safe?

As long as you make sure your graph follows rules of Hidden Markov Model (for example, sum of all outgoing edges from every node sums to 1), then yes - Viterbi Algorithm can handle cyclic graphs.

It is hard to say if it's indeed the right choice or if you can use modified BFS without more context on the question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM