I use the code below.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning,fit}
\begin{document}
\begin{frame}
\begin{figure}
\begin{tikzpicture}[scale=0.5]
\tikzstyle{vv}=[semithick, draw, circle, inner sep=0.5pt]
\tikzstyle{bl}=[xshift=0.6cm]
\tikzstyle{br}=[xshift=-0.6cm]
\uncover<1-2>{
\node [vv] (1) at (0,0) {1};
\node [vv] (2) [right=of 1] {2};
\node [vv] (3) [right=of 2] {3};
\node [vv] (5) [below left=of 3, bl] {5};
\node [vv] (4) [below right=of 1, br] {4};
\node [vv] (6) [below left=of 4, bl] {6};
\node [vv] (7) [right=of 6] {7};
\node [vv] (8) [right=of 7] {8};
\draw [semithick] (1)--(4)--(2)--(5)--(3);
\draw [semithick] (1)--(5)--(6);
\draw [semithick] (6)--(4)--(7)--(5)--(8);
\begin{scope}[on background layer]
\node (b0) [fill=black!20,rounded corners,fit=(1)(2)(3)(4)(5)(6)(7)(8), inner sep=-1.3cm] {};
\end{scope}
\node (original) [below=of 7, yshift=5mm] {(a) Original Graph};
}
\uncover<2>{
\begin{scope}[xshift=10cm]
\node [vv] (21) at (0,0) {2};
\node [vv] (31) [right=of 21] {3};
\node [vv] (51) [below left=of 31, bl] {5};
\node [vv] (41) [below left=of 21, bl] {4};
\node [vv] (71) [below left=of 51, bl] {7};
\node [vv] (81) [below right=of 51, br] {8};
\draw [semithick] (41)--(21)--(51)--(31);
\draw [semithick] (71)--(51)--(81);
\end{scope}
\begin{scope}[on background layer]
\node (b1) [fill=blue!20,rounded corners,fit=(21)(31)(41)(51)(71)(81), inner sep=-1.1cm] {};
\end{scope}
\node (sub1) [below=of 71, yshift=5mm] {~~~~~(b) Subgraph 1};
}
\uncover<2>{
\begin{scope}[xshift=15.5cm]
\node [vv] (12) at (0,0) {1};
\node [vv] (42) [below right=of 12, br] {4};
\node [vv] (52) [right=of 42] {5};
\node [vv] (62) [below left=of 42, bl] {6};
\node [vv] (72) [right=of 62] {7};
\draw [semithick] (62)--(42)--(12)--(52)--(62);
\draw [semithick] (42)--(72);
\end{scope}
\begin{scope}[on background layer]
\node (b2) [fill=blue!20,rounded corners,fit=(12)(42)(52)(62)(72), inner sep=-1.1cm] {};
\end{scope}
\node (sub2) [below=of 72, yshift=5mm] {(c) Subgraph 2~~~~~};
}
\uncover<2>{
\path (b0) to node {=} (b1);
\path (b1) to node {+} (b2);
}
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
The effect of the code is the following.


And we can see that the light-blue backgrounds appear in the first slide. However, they should be in the second slide. But how to set?
