Diagrama de árbol al revés

Diagrama de árbol al revés

Amigos, he intentado configurar el siguiente diagrama con los comandos tikzpicture\node\child pero no logro dibujarlo. ¿Puedes ayudarme?

ingrese la descripción de la imagen aquí

Gracias.

\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{trees,arrows}
\begin{document}
\tikzstyle{level 1}=[level distance=30mm, sibling distance=30mm]
\tikzstyle{level 2}=[level distance=30mm, sibling distance=15mm]
\tikzstyle{level 3}=[level distance=20mm]
\begin{tikzpicture}[grow=right,-,=angle 60]
%\begin{scope}[yshift=0]
  \node {$f_{0,0}$}
    child {node {$f_{2,2}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{3}$}}  
      }
      child {node{$f_{3,1}$}
        child[-] {node{$x_{2}$}}  
      }
    }
    child {node {$f_{2,1}$}
      child {node{$f_{3,2}$}
        child[-] {node{$x_{1}$}}  
      }
      child {node{$f_{3,1}$}
        child[-] {node{$x_{0}$}}  
      }
    };
%\end{scope}
\begin{scope}[yshift=-6cm]
  \node {$f_{1,2}$}
    child {node {$f_{2,2}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{7}$}}  
      }
      child {node {$f_{3,1}$}
        child[-] {node{$x_{6}$}}  
      }
    }
    child {node {$f_{2,1}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{5}$}}
      }
      child {node {$f_{3,1}$}
        child[-] {node{$x_{4}$}}  
      }
    };
\end{scope}

\end{tikzpicture}
\end{document}

Respuesta1

Como menciona Alan Munn, esto no es realmente un árbol,una matriz puede ser una mejor opción. Estas matrices se pueden producir de forma bastante cómoda con tikz-cd. Para encerrar algunas subexpresiones en los elementos de la matriz, se puede utilizar \subnodelo que viene con tikzmark.

\documentclass{article}
\usepackage[margin=1in]{geometry}   
\usepackage{mathtools}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric,tikzmark,fit}
\begin{document}
\newcommand{\ARR}{\arrow[ul]\arrow[dl]}
\begin{tikzcd}[column sep=1ex,row sep=0pt,
    every arrow/.append style={dash,shorten >=-2pt,shorten <=-2pt},
    /tikz/remember picture]
 x_1 & \subnode{red}{y_1} & & & & & \\
  &  & \subnode{orange}{y_{21}}=\dfrac{y_{2}-y_{1}}{x_2-x_1} \arrow[ul]\arrow[dl] & & & & \\
 x_2 & y_2 & &  \subnode{yellow}{y_{321}}=\dfrac{y_{32}-y_{21}}{x_3-x_1} \arrow[ul]\arrow[dl] & & \\
  &  & y_{32}=\dfrac{y_{3}-y_{2}}{x_3-x_2} \arrow[ul]\arrow[dl]& & 
  \subnode{green}{y_{4321}}=\dfrac{y_{432}-y_{321}}{x_4-x_1} \arrow[ul]\arrow[dl] & \\
 x_3 & y_3 & &  y_{432}=\dfrac{y_{43}-y_{32}}{x_4-x_2} \arrow[ul]\arrow[dl] & & \subnode{blue}{y_{54321}}=\dfrac{y_{5432}-y_{4321}}{x_5-x_1}\arrow[ul]\arrow[dl] \\
  &  & y_{43}=\dfrac{y_{4}-y_{3}}{x_4-x_3} \arrow[ul]\arrow[dl]& & 
  y_{5432}=\dfrac{y_{543}-y_{432}}{x_5-x_2} \arrow[ul]\arrow[dl] & \\
 x_4 & y_4 & & y_{543}=\dfrac{y_{54}-y_{43}}{x_5-x_3} \arrow[ul]\arrow[dl]  & & & \\
  &  &y_{54}=\dfrac{y_{5}-y_{4}}{x_5-x_4} \arrow[ul]\arrow[dl]& && & \\
 x_5 & y_5 & & & & & \\
\end{tikzcd}
\begin{tikzpicture}[remember picture,overlay]
\foreach \X in {red,green,blue,orange,yellow}
 {\node[draw,ellipse,inner ysep=-2pt,inner xsep=-4pt,fit=(\X),color=\X]{};}
\end{tikzpicture}
\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

El siguiente MWE (que es una versión ligeramente modificada y adaptada de unrespuesta anterior similar mía) podría servir como punto de partida:

ingrese la descripción de la imagen aquí

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}

\begin{document}


\begin{tikzpicture}[grow=left, 
                    sibling distance=50pt,
                    level distance=2cm,
                    edge from parent path={(\tikzparentnode.west) -- (\tikzchildnode.east)}]
    \node {$y_{21} = \dfrac{y_2 - y_1}{x_2 - x_1}$}
    child {node {$y_1$}}
    child {node {$y_2$}}
    ;
\end{tikzpicture}
\end{document}

Aquí hay una variante coloreada:

ingrese la descripción de la imagen aquí

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}

\usetikzlibrary{shapes}

\newcommand{\highlighted}[2]{\tikz[remember picture,baseline=-2pt]\node[rounded rectangle,draw=#1,text=black,anchor=center]{$#2$};}

\begin{document}

\begin{tikzpicture}[grow=left, 
                    sibling distance=50pt,
                    level distance=2cm,
                    edge from parent path={(\tikzparentnode.west) -- (\tikzchildnode.east)}]
    \node {$\highlighted{orange}{y_{21}}{} = \dfrac{y_2 - y_1}{x_2 - x_1}$}
    child {node{\highlighted{red}{y_1}}}
    child {node {$y_2$}}
    ;
\end{tikzpicture}

\end{document}

Respuesta3

\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{trees,arrows}
\begin{document}
\tikzstyle{level 1}=[level distance=30mm, sibling distance=30mm]
\tikzstyle{level 2}=[level distance=30mm, sibling distance=15mm]
\tikzstyle{level 3}=[level distance=20mm]
\begin{tikzpicture}[grow=right,-,=angle 60]
%\begin{scope}[yshift=0]
  \node {$f_{0,0}$}
    child {node {$f_{2,2}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{3}$}}  
      }
      child {node{$f_{3,1}$}
        child[-] {node{$x_{2}$}}  
      }
    }
    child {node {$f_{2,1}$}
      child {node{$f_{3,2}$}
        child[-] {node{$x_{1}$}}  
      }
      child {node{$f_{3,1}$}
        child[-] {node{$x_{0}$}}  
      }
    };
%\end{scope}
\begin{scope}[yshift=-6cm]
  \node {$f_{1,2}$}
    child {node {$f_{2,2}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{7}$}}  
      }
      child {node {$f_{3,1}$}
        child[-] {node{$x_{6}$}}  
      }
    }
    child {node {$f_{2,1}$}
      child {node {$f_{3,2}$}
        child[-] {node{$x_{5}$}}
      }
      child {node {$f_{3,1}$}
        child[-] {node{$x_{4}$}}  
      }
    };
\end{scope}

\end{tikzpicture}
\end{document

información relacionada