Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
902 views
in Technique[技术] by (71.8m points)

graphics - How to visualize Viterbi path in Latex or Graphviz

I'm looking for a way to visualize a Viterbi path in LaTeX or maybe Graphviz, much like in this example:

It doesn't have to be dots, but it could also be actual values between the lines. Much like a table with lines between cells.

I tried searching for ways to do this, but most likely I'm not using the right keywords.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here's one way to achieve this using graphviz with invisible edges:

graph {
  splines=false;
  nodesep=0.5;
  ranksep=0.5;
  node[shape=point, height=0.08];
  { rank=same; a1 -- b1 -- c1 -- d1 -- e1;}
  { rank=same; a2 -- b2; b2 -- c2[style=invis]; c2 -- d2; d2 -- e2[style=invis];}
  { rank=same; a3 -- b3[style=invis]; b3 -- c3; c3 -- d3[style=invis]; d3 -- e3;}
  edge[style=invis];
  a1 -- a2 -- a3;
  b1 -- b2 -- b3;
  c1 -- c2 -- c3;
  d1 -- d2 -- d3;
  e1 -- e2 -- e3;
  edge[style=solid, constraint=false];
  a2 -- b3 -- c2 -- d3 -- e2;
}

graphviz output


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...