2

I am having trouble on producing a game tree (and especially the pay offs) with tkiz and three (or more) players. For two player games, I use:

child{node[solidnode,label=below:{$\displaystyle\binom{1st payoff}{2nd payoff}$}]}

to receive pay offs among each other in binomial style.

But, what about "trinomial" style for three players? Is there any LaTeX/Tikz command with which it could be possible to have three pay offs among each other?

Here is my full code, but with pay offs abreast and not among each other.

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usetikzlibrary{calc}
\usepackage{multirow}
\pagestyle{scrheadings}

\begin{document}
\begin{center}
\begin{tikzpicture}[scale=1.5]
\tikzset{solidnode/.style={circle,draw,inner sep=1.5,fill=black},hollownode/.style={circle,draw,inner sep=1.5}}
\tikzstyle{level 1}=[level distance=10mm,sibling distance=50mm]
\tikzstyle{level 2}=[level distance=10mm,sibling distance=20mm]
\tikzstyle{level 3}=[level distance=10mm,sibling distance=10mm]
\tikzstyle arrowstyle=[scale=1]
\tikzstyle directed=[postaction={decorate,decoration={markings,mark=at position .5 with {\arrow[arrowstyle]{stealth}}}}]
\node(0)[hollownode,label=above:{Player 1}]{}
 child{node(1)[solidnode,label=left:{Player 3}]{}
  child{node[solidnode,label=below:{$(2,0,1)$}]{}edge from parent node[left]{$a$}}
  child{node[solidnode,label=below:{$(-1,5,6)$}]{} edge from parent node[right]{$b$}}
 edge from parent node[left,xshift=-10]{$L$}}
 child{node(2)[solidnode,label=right:{Player 2}]{}
 child{node(3)[solidnode,label=right:{Player 3}]{}
  child{node[solidnode,label=below:{$(3,1,2)$}]{}edge from parent node[left]{$l$}}
  child{node[solidnode,label=below:{$(5,4,4)$}]{} edge from parent node[right]{$r$}}
 edge from parent node[left,level distance=30mm]{$a$}}
 child{node(4)[solidnode,label=right:{Player 3}]{}
  child{node[solidnode,label=below:{$(0,-1,7)$}]{}edge from parent node[left]{$l$} }
  child{node[solidnode,label=below:{$(-2,2,0)$}]{} edge from parent node[right]{$r$}}
 edge from parent node[right]{$b$}}
 edge from parent node[right,xshift=10,level distance=30mm]{$R$}};
\end{tikzpicture}
\end{center}
\end{document}

Thank you very much for your help!

  • 1
    There is the istgame package that specializes on game trees, and, in particular, forest, which makes tree drawing much simpler. I recommend looking at these packages. – Schrödinger's cat Sep 2 at 17:24
  • This might help, but then I would have to renew all my existing code since I used Tikz so far for all of them. However, I found a very simple solution.. – rapha Sep 4 at 7:16
0

Okay, I found a solution (if anybody else is stuck with a similar problem): Simply use a one column vector (with pmatrix) to denote pay offs in large games with multiple players to save space with pay offs among each other.

This example code might help:

child{node[solidnode,label=below:{$\begin{pmatrix} 2\\0\\1\\3\\4 \end{pmatrix}$}]{}edge from parent node[left]{$a$}}

0

The istgame package provides a collection of abbreviations of tikz tree codes and some more convenient macros.

It looks better to me without the tikz-qtree package.

enter image description here

\documentclass[a4paper,11pt]{standalone}
\usepackage{amsmath}
\usepackage{tikz}
%\usepackage{tikz-qtree}
%\usetikzlibrary{calc}
\usepackage{multirow}
%\pagestyle{scrheadings}

\newcommand\vpay[1]{\begin{pmatrix}#1\end{pmatrix}}

\usepackage{istgame}

\begin{document}

\begin{istgame}[scale=1.5]
\setistSolidNodeStyle{4pt}   % size of solid nodes
\setistInitialNodeStyle{4pt} % size of initial nodes
\xtShowEndPoints             % to show all end points
%\xtShowMidArrows             % to show all middle arrows for branches

\xtdistance{10mm}{50mm}             %% level 1
\istroot(0)[initial node]{Player 1} % \node(0)[hollownode,label=above:{Player 1}]{}
  \istb{L}[left,xshift=-10]         % edge from parent node[left,xshift=-10]{$L$}}
  \istb{R}[right,xshift=10]         % edge from parent node[right,xshift=10,level distance=30mm]{$R$}}
  \endist

\xtdistance{10mm}{20mm}             %% level 2
\istroot(1)(0-1)<left>{Player 3}    % child{node(1)[solidnode,label=left:{Player 3}]{}
  \istb{a}[left]{\vpay{2\\0\\1}}    % child{node[solidnode,label=below:{$(2,0,1)$}]{}  edge from parent node[left]{$a$}}
  \istb{b}[right]{\vpay{-1\\5\\6}}  % child{node[solidnode,label=below:{$(-1,5,6)$}]{} edge from parent node[right]{$b$}}
  \endist

\istroot(2)(0-2)<right>{Player 2}   % child{node(2)[solidnode,label=right:{Player 2}]{}
  \istb{a}[left]                    % edge from parent node[left,level distance=30mm]{$a$}}
  \istb{b}[right]                   % edge from parent node[right]{$b$}}
  \endist

\xtdistance{10mm}{10mm}             %% level 3
\istroot(3)(2-1)<left>{Player 3}    % child{node(3)[solidnode,label=right:{Player 3}]{}
  \istb{l}[left]{\vpay{3\\1\\2}}    % child{node[solidnode,label=below:{$(3,1,2)$}]{}edge from parent node[left]{$l$}}
  \istb{r}[right]{\vpay{5\\4\\4}}   % child{node[solidnode,label=below:{$(5,4,4)$}]{} edge from parent node[right]{$r$}}
  \endist

\istroot(4)(2-2)<right>{Player 3}   % child{node(4)[solidnode,label=right:{Player 3}]{}
  \istb{l}[left]{\vpay{0\\-1\\7}}   % child{node[solidnode,label=below:{$(0,-1,7)$}]{}edge from parent node[left]{$l$} }
  \istb{r}[right]{\vpay{-2\\2\\0}}  % child{node[solidnode,label=below:{$(-2,2,0)$}]{} edge from parent node[right]{$r$}}
  \endist
\end{istgame}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.