
\documentclass[beamer]{standalone}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize % activate! 
\begin{document}
\begin{standaloneframe}

% If overlays do not work, use \only<1-n>{...} where n is the max overlay
\only<1-5>{
  \begin{tikzpicture}[]
	\coordinate (a0) at (-1,-1);
	\coordinate (a1) at (0.5,0.4);
	\coordinate (a2) at (1.7,1);
	\coordinate (a3) at (1,-1);
	\coordinate (a4) at (-1,1);

        % \node (t) at (5, -1) {$\epsilon$};
        % \node (t0) at $(t)++(-1, 1)$ {$\epsilon$};

        
        \draw[line width=0.75] (a1) -- (a3) -- (a4);
        \draw[line width=0.75] (a3) -- (a2);
        \draw[line width=0.75] (a0) -- (a3);

        \draw[fill= red] (a0) circle (0.2);
        \draw[fill= green] (a1) circle (0.2);
        \draw[fill= purple] (a2) circle (0.2);
        \draw[fill= blue] (a3) circle (0.2);
        \draw[fill= orange] (a4) circle (0.2);

        % \node[circle, inner sep = 2, minimum size = 0.2, radius=0.2, fill=red] at (5, -1)  {$\epsilon$}          [grow'=up, sibling distance= 2cm, level distance = 1.5cm, color=gray]  child {
        %   node[]{$0$} [sibling distance= 1cm]
        %      child {  node {$00$} }
        %      child { node[circle, inner sep = 1.5, minimum size = 0.2, radius=0.2, fill=orange] {$01$} }
        %    }
        %    child {
        %      node[circle, inner sep = 2, minimum size = 0.2, radius=0.2, fill=blue] {$1$} [sibling distance= 1cm]
        %      child { node {$10$} }child { node {$11$} }};

        \node (eps) at (6.5,-1){$\epsilon$};
        \node (0) at (5.5,0){$0$};
        \node (00) at (5,1){$00$};
        \node (01) at (6,1){$01$};
        \node (1) at (7.5,0){$1$};
        \node (10) at (7,1){$10$};
        \node (11) at (8,1){$11$};
        % \node[color=white] (001p) at (4,2){$001$};
        % \draw[fill= white, color=white] (001p) circle (0.2);
        \node<5->[color=white] (001) at (5.5,2){$001$};

        \draw[color=white] (-2,-2) -- (9.5, -2) -- (9.5, 3) -- (-2,3);
        \draw[line width=0.05cm, ->] (2.25,0) -- (4.25,0);
        
        \draw<2->[fill= red] (eps) circle (0.2);
        \draw<2->[color= red, dashed] (eps) -- ++(-1,0);
        \draw<2->[color= red, dashed] (eps) -- ++(1,0);
        \draw<3->[fill= orange] (0) circle (0.2);
        \draw<3->[color= orange, dashed] (0) -- ++(-0.5,0);
        \draw<3->[color= orange, dashed] (0) -- ++(2.5,0);
        \draw<4->[fill= blue] (11) circle (0.2);
        \draw<4->[color= blue, dashed] (11) -- ++(0.5,0);
        \draw<4->[color= blue, dashed] (11) -- ++(-3.5,0);

        \draw<5->[fill= green] (001) circle (0.2);
        \draw<5->[color= green, dashed] (001) -- ++(-1,0);
        \draw<5->[color= green, dashed] (001) -- ++(3,0);
        \draw<5-> (00) -- (001);

        \draw (0) -- (eps) -- (1);
        \draw (00) -- (0) -- (01);
        \draw (10) -- (1) -- (11);

        
  \end{tikzpicture}
}
\end{standaloneframe}
\end{document}
