我在创建如下游戏树时遇到了困难:
有两个信息集:一个定义在游戏的第三阶段,另一个定义在终端节点。我自己花了太多时间才弄清楚,所以我在这里寻求帮助。
到目前为止,我已经能够弄清楚第一点。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\begin{document}
\begin{center}
\tikzset{
% Two node styles for game trees: solid and hollow
solid node/.style={circle,draw,inner sep=1.5,fill=black},
hollow node/.style={circle,draw,inner sep=1.5}
}
\begin{tikzpicture}[scale=1.5,font=\footnotesize]
% Specify spacing for each level of the tree
\tikzstyle{level 1}=[level distance=15mm,sibling distance=35mm]
\tikzstyle{level 2}=[level distance=15mm,sibling distance=25mm]
% The Tree
\node(0)[solid node,label=above:{$i$}]{}
child{node(1)[solid node, label=left:{$j$}]{}
child{node[hollow node,label=below:{$(s_{1}^*,s_{2}^*+\tau(\overline{q}-\frac{1}{2}))$}]{} edge from parent node[left]{l}}
child{node[hollow node,label=below:{$(o_1,o_2-c_{\Gamma_6})$}]{} edge from parent node[right]{r}}
edge from parent node[left,xshift=-3]{l}
}
child{node(2)[hollow node, label=below:{$(o_1-c_{\Gamma_6},o_2)$}]{} edge from parent node[right]{r}};
\node[below]at(current bounding box.south){$\Gamma_6$};
\end{tikzpicture}
\end{center}
\end{document}
答案1
虽然作为一名语言学家,指定树的输入方法istgame
有点麻烦(因为我们习惯使用括号来显示结构),istgame
但该包是专门为博弈论树设计的,因此,我建议学习它,因为它具有该领域大多数符号约定的内置选项。下面是使用该istgame
包的树的版本。我还在您的代码示例中添加了树的版本,以显示如何添加玩家和动作。
\documentclass{article}
\usepackage{istgame}
\begin{document}
\begin{istgame}
\xtdistance{10mm}{50mm}
\istroot(0)
\istb
\istb
\endist
\xtdistance{10mm}{35mm}
\istroot(1a)(0-1)
\istb
\istb
\endist
\istroot(1b)(0-2)[null node]
\istb
\endist
\xtdistance{10mm}{20mm}
\istroot(2a)(1a-1)
\istb
\istb
\endist
\istroot(2b)(1a-2)
\istb
\istb
\endist
\istroot(2c)(1b-1)
\istb
\istb
\endist
\istroot(3a)(2a-1)
\istb
\istb
\endist
\xtShowEndPoints[oval node]
\istroot(3b)(2a-2)[null node]
\istb
\endist
\xtHideEndPoints
\istroot(3c)(2b-1)
\istb
\istb
\endist
\xtShowEndPoints[oval node]
\istroot(3d)(2b-2)[null node]
\istb
\endist
\xtHideEndPoints
\istroot(3e)(2c-1)
\istb
\istb
\endist
\xtShowEndPoints[oval node]
\istroot(3f)(2c-2)[null node]
\istb
\endist
\xtInfoset[bend left=30](3a)(3c)
\xtInfoset[bend left=30](3c)(3e)
\xtInfoset[bend right=30](3b-1)(3d-1)
\xtInfoset[bend right=30](3d-1)(3f-1)
\end{istgame}
\begin{istgame}
\xtdistance{10mm}{30mm}
\xtShowTerminalNodes[oval node]
\istroot(0){i}
\istb{l}[al]
\istbt{r}[ar]{(o_1-c_{\Gamma_6},o_2)}
\endist
\istroot(1a)(0-1){j}[plain node]
\istbt{l}[al]{(s_{1}^*,s_{2}^*+\tau(\overline{q}-\frac{1}{2}))}
\istbt{r}[ar]{(o_1,o_2-c_{\Gamma_6})}
\endist
\end{istgame}
\end{document}
答案2
这是一个纯粹的森林替代品。
\documentclass{article}
\usepackage{forest}
\tikzset{circ/.style={circle,inner sep=2pt,draw}}
\usetikzlibrary{shapes.misc}
\forestset{special edge/.style={ edge path={
\noexpand\path[\forestoption{edge}]
(!uu.parent anchor) -- (!u.center)
-- (.child anchor)\forestoption{edge label};
},
}}
\begin{document}
\begin{forest}
for tree={l sep=1cm,s sep=1cm,
if n children=2{circ,fill}{inner sep=0pt}}
[
[
[
[,alias=buff1
[]
[]
]
[
[,circ,alias=ruff1,special edge]
]
]
[
[,alias=buff2
[]
[]
]
[
[,circ,alias=ruff2,special edge]
]
]
]
[
[,special edge
[,alias=buff3
[]
[]
]
[
[,circ,alias=ruff3,special edge]
]
]
]
]
\draw[dashed] (ruff1) to[bend right] (ruff2) (ruff2) to[bend right] (ruff3)
(buff1) to[bend left] (buff2) (buff2) to[bend left] (buff3);
\end{forest}
\end{document}