答案1
它的工作原理与文档中描述的完全一致......
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage[edges]{forest}
\begin{document}
\tikzset{state/.style={draw,circle}}
\forestset{d/.style={dotted,edge=dotted},
r/.style={red,edge=red}}
\begin{forest}
for tree={state,edge={-},grow=south,l sep=6mm,s sep=10mm},
[22,d
[13,d
[30,red,edge=dotted
[15,r]
[85,r]{\draw[<->,red] () to[bend right=45] node[midway,above
right,font=\small]{zam} (!u.east);}
]
[71
[17]
[20]
]
]
[11,d
[33,edge=dotted
[32]
]
[55,d]
]
]
\end{forest}
\end{document}