[Tex/LaTex] A scenario tree in latex

foresttikz-trees

I know it's a bit tedious, but could someone please write me the latex code for below tree?

Here's how I started

\documentclass{article}
\usepackage{amsmath}
\usepackage{forest}
\tikzset{
  dot/.style={circle,draw,inner sep=1.2,fill=black},
  }
 \begin{document}
 \begin{forest}
 [ ,name=a,for tree={s sep=60pt,l sep=2cm,dot,grow=0},
   [ ,name=b,edge 
      [ ,name=c, ]
      [,name=d,]    
   ]
  [ ,name=e, edge
     [ ,name=f,]
     [,name=g, ]
     [ ,name=h,]
  ]
]
\end{forest}
\end{document}

I've tried several times to build up on this to get the tree I wanted but I can't get the branches right.
Thank you!enter image description here

Best Answer

Indeed the forest branches are a bit tricky to get right, I suggest the next time you try building the lower part first, then copy that and paste it to make the upper (applying the changes to fit your desired output).

Since you use a node for the dots, you cannot enter the text as you would normally. If you do this is the result:

figure 1

So to work around this, you can use the label command, which works like this (\cdots is the command for the dots):

[ ,name=g, label={right:$\cdots$}] 

So the label is placed at the right, since this forest grows east.

Output

enter image description here

Code

\documentclass[margin=10pt]{standalone}
\usepackage{amsmath}
\usepackage{forest}
\tikzset{
  dot/.style={circle,draw,inner sep=1.2,fill=black},
  }
 \begin{document}
 \begin{forest}
    for tree={s sep=60pt,l sep=2cm,dot,grow=0}
%
[ ,name=root
    [ ,name=below
    [ ,name=a
        [ ,name=c, label={right:$\cdots$}] 
        [ ,name=d, label={right:$\cdots$}] 
        [ ,name=e, label={right:$\cdots$}] 
    ]
    [ ,name=f
        [ ,name=g, label={right:$\cdots$}] 
        [ ,name=h, label={right:$\cdots$}] 
    ] ]
    [ ,name=above
    [ ,name=i
        [ ,name=k, label={right:$\cdots$}] 
        [ ,name=l, label={right:$\cdots$}] 
    ] 
    [ ,name=m
        [ ,name=n, label={right:$\cdots$}] 
        [ ,name=o, label={right:$\cdots$}] 
        [ ,name=p, label={right:$\cdots$}] 
    ] ]
]
\end{forest}
\end{document}
Related Question