1

This question already has an answer here:

I have a graph with some nodes. I have the tikz code and output for the same as:

\begin{tikzpicture}
\tikzstyle{v} = [circle,fill=black!25, text width = 9pt,text centered, minimum size = 5pt, inner sep =1pt]
\node[v] (1) at (-0.703100, 0.348100) {1};
\node[v] (2) at (-1.417600, 0.760600) {2};
\node[v] (3) at (-1.417600, 1.585600) {3};
\node[v] (4) at (-0.703100, 1.998100) {4};
\node[v] (5) at (0.011400, 1.585600) {5};
\node[v] (6) at (0.011400, 0.760600) {6};
\node[v] (7) at (-0.703100, -0.476900) {7};
\node[v] (8) at (0.011400, -0.889400) {8};
\node[v] (9) at (-1.417600, -0.889400) {9};
\node[v] (10) at (-1.417600, -1.714400) {10};
\node[v] (11) at (-0.703100, -2.126900) {11};
\node[v] (12) at (0.725800, 1.998100) {12};
\node[v] (13) at (-2.132000, -2.126900) {13};
\node[v] (14) at (-2.132000, -2.951900) {14};
\node[v] (15) at (-2.132000, 0.348100) {15};
\node[v] (16) at (-2.132000, 1.998100) {16};
\node[v] (17) at (0.725800, 0.348100) {17};
\node[v] (18) at (-2.132000, -0.476900) {18};
\node[v] (19) at (-2.846500, -1.714400) {19};
\draw (1) -- (2);
\draw (1) -- (6);
\draw (1) -- (7);
\draw (2) -- (3);
\draw (2) -- (15);
\draw (3) -- (4);
\draw (3) -- (16);
\draw (4) -- (5);
\draw (5) -- (6);
\draw (5) -- (12);
\draw (6) -- (17);
\draw (7) -- (8);
\draw (7) -- (9);
\draw (9) -- (10);
\draw (9) -- (18);
\draw (10) -- (11);
\draw (10) -- (13);
\draw (13) -- (14);
\draw (13) -- (19);
\end{tikzpicture}
`

enter image description here

Now, in my slide I want the following sequence to occur:
1: Original graph (as in figure) (I can do this)
2: highlight (color red) one specific node (say 4)
3: highlight all nodes at distance 1 from 4 , also highlight the edges from 4 to these nodes
4: highlight all nodes at distance 2 from 4, also highlight the edges from distanc-1 node to these nodes. So on for other distances.

How do I do this?

marked as duplicate by user36296 beamer Jan 24 '17 at 16:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.