Spacing between branches of trees

by Laura K   Last Updated January 13, 2018 22:23 PM

I am having problems with spacing between branches in the following tree:

\documentclass[11pt]{article}
\usepackage{tikz} %vector art
\usetikzlibrary{snakes, matrix,shapes,arrows,positioning,chains}
\begin{document}

\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,fill=white}
}

\begin{center}
\begin{tikzpicture}[
 scale=1.5,font=\footnotesize,
 level 1/.style={level distance=10mm,sibling distance=30mm},
 level 2/.style={level distance=15mm,sibling distance=10mm},
 level 3/.style={level distance=15mm,sibling distance=10mm}
]
% The Tree
\node(0)[solid node,label=above:{\textbf{Start}}]{} 
child{node(1)[hollow node]{$L$}
child{[black] node(11)[hollow node]{}}
child{[black] node(12)[hollow node]{}}
edge from parent node[left]{$p$}
}
child{node(2)[hollow node]{$H$}
child{[black] node(41)[hollow node, ]{}}
child{[black] node(42)[hollow node,]{}}
edge from parent node[right]{$1-p$}
};
% information set
\draw[dashed,bend right](11)to(12);
\draw[dashed,bend right](41)to(42);


\path (11) -- node (H) {$x_{1}$} (12);
\path (41) -- node {$y_{1}$} (42);


% scope env to locally redefine level 1 style
%\begin{scope}[
%  level 1/.style={sibling distance=10mm}
%]
\node(00)[below=4mm,hollow node] at (H) {$H$}
child{ node[hollow node] {}
          edge from parent node[left] {$A$}
}
child{ node[solid node, label=right:{\textbf{Start 2}}] {} 
child{node(3)[hollow node]{$L$}
child{[black] node(66)[hollow node, ]{}}
child{[black] node(77)[hollow node, ]{}}
edge from parent node[left]{$p$}
}
child{node(5)[hollow node]{$H$}
child{[black] node(6)[hollow node, ]{}}
child{[black] node(7)[hollow node, ]{}}
edge from parent node[right]{$1-p$}
}
edge from parent node[right] {$R$}
}
;
%New info set
\draw[dashed,bend right](6)to(7);
\draw[dashed,bend right](66)to(77);
\path (6) -- node (HH){$r_{2}$} (7);
\path (66) -- node (HL){$z_{2}$} (77);
\node(000)[below=4mm,hollow node] at (HH) {$L$}
child{ node[hollow node, label=below:{$\{U_{i}(c_{i1},c_{i2},0,g_{2})\}_{i=H,L}$}] {} 
          edge from parent node[left] {$A$}
}
child{ node[hollow node, label=below:{$\{U_{i}(c_{i1},c_{i1},0,0)\}_{i=H,L}$}] {} 
edge from parent node[right] {$R$}
}
;
\node(0000)[below=4mm,hollow node] at (HL) {$H$}
child{ node[hollow node, label=below:{$\{U_{i}(c_{i1},c_{i2},0,g_{2})\}_{i=H,L}$}] {} 
          edge from parent node[left] {$A$}
}
child{ node[hollow node, label=below:{$\{U_{i}(c_{i1},c_{i1},0,0)\}_{i=H,L}$}] {} 
edge from parent node[right] {$R$}
}
;
%\end{scope}
\end{tikzpicture}
\end{center}
\end{document}

I have tried to use scope so I could have local environments well-defined, and that solves the spacing problem, but at the cost of not being able to build child nodes in the way I want it: enter image description here

Anyone has a good idea on how to "fix" this spacing issue I am facing with this tree? Thank you.



Related Questions



draw an ellipse into a Tree picture -tikz package

Updated February 23, 2017 16:23 PM

Decision Tree with Labels on Both Sides of Line

Updated June 22, 2015 00:10 AM