[Tex/LaTex] Decision Tree in LaTeX with TikZ


Grid line doesn't have to be included

enter image description here

\usepackage{caption} \
\setbeamertemplate{footline}[text line]{% \parbox{\linewidth}{\vspace*{-10pt} \textit{Where Wall Street Goes to School} \hfill \insertpagenumber} } \setbeamertemplate{navigation symbols}{} –

\matrix (tree) [matrix of nodes, minimum size=0.25cm, column sep=2cm, row sep=1cm, ] 
{ & $C_{i+1,j+1}$ \\ $C_{i,j}$ &$C_{i+1,j}$ \\ 
& $C_{i+1,j-1}$ \\  
\draw[->] (tree-3-1) -- (tree-1-3) node [midway,above] {}; 
\draw[->] (tree-3-1) -- (tree-3-3) node [midway,above] {}; 
\draw[->] (tree-3-1) -- (tree-5-3) node [midway,below] {}; 
\end{adjustbox} –

Best Answer


\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, matrix}

every edge/.append style = {-Straight Barb, thick,
                            shorten >=1mm, shorten <=1mm},
\matrix (tree) [matrix of nodes,
                nodes={circle, draw, minimum size=3mm, inner sep=0mm},
                column sep=2cm, row sep=1cm
|[label=left:{$C_{i,j+1}$}]|  &   |[label=right:{$C_{i+1,j+1}$}]|   \\
|[label=left:{$C_{i,j}$}]|    &   |[label=right:{$C_{i+1,j}$}]|     \\
|[label=left:{$C_{i,j-1}$}]|  &   |[label=right:{$C_{i+1,j-1}$}]|   \\  
\path   (tree-1-1) edge (tree-2-2)
        (tree-2-1) edge (tree-2-2)
        (tree-3-1) edge (tree-2-2)
        (tree-1-2) edge (tree-2-2)
        (tree-3-2) edge (tree-2-2);


enter image description here

Related Question