答案1
hobby
软件包中有一些算法可以帮助你绘制这样的曲线。这是一个快速的建议,如果你花更多的时间调整一些东西,你可以让你的曲线更漂亮。
\documentclass[tikz]{standalone}
\usepackage{forest}
\usetikzlibrary{hobby}
\begin{document}
\begin{forest}
[$root : s_0$, name= s0
[$a: s_*$
[$d: s_*$]
[$d: s_*$
[$c: s_*$]
]
]
[$a: s_a$, name= sa
[$b: s_b$, name= sb
[$c: s_c$, name= sc]
]
[$b: s_*$
[$d: s_*$]
[$c: s_*$
[$d: s_*$
[$d: s_*$]
]
]
]
]
]
\draw[dashed,red] (s0.west) to[closed,curve through={
(s0.south)..(sb.north west)..(sc.south west)..
(sc.south east)..([xshift=.2cm]sb.east)..
(sa.east)..(s0.east)..([tension in=-2]s0.north)
}] (s0.west);
\end{forest}
\end{document}
答案2
像这样?
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
[$root : s_0$, name= s0
[$a: s_*$
[$d: s_*$]
[$d: s_*$
[$c: s_*$]
]
]
[$a: s_a$, name= sa
[$b: s_b$, name= sb
[$c: s_c$, name= sc]
]
[$b: s_*$
[$d: s_*$]
[$c: s_*$
[$d: s_*$
[$d: s_*$]
]
]
]
]
]
\draw[dashed,red]
(s0.20) .. controls ++([shift={(0:1.25)}]sa) and (sb.0) .. (sc.0)
.. controls ([shift={(-90:1)}]sc) and ([shift={(-180:0.75)}]sc) .. (sb.180)
.. controls ([shift={(160:2)}]s0) and (s0.90) .. cycle;
\end{forest}
\end{document}