I have 4 things drawn with tikz. It's working fine but now I want to layout them in a grid 2x2, each one with its own caption.
EDIT: I have rewritten my question since It was not clear. Below code is what I want to a reduced version of what I want to draw but I want it to appear in a 2x2 layout. Currently I get everything in a column. Taking too much space
\begin{figure}
\centering
\subfloat[Start 1]{
\label{fig:chap3_input_image}
\begin{tikzpicture}[scale=2.0]
\tikzstyle{every node}=[draw, shape=circle];
\path (0:0cm) node[fill=black!40] (v0){$v_0$};
\path (20:0.8cm) node (v1){$v_1$};
\path (340:0.9cm) node (v8){$v_8$};
\end{tikzpicture}
}
\hfill
\caption[Start]{Initial state}
\subfloat[State 2]{
\label{fig:chap3_input_image2}
\begin{tikzpicture}[scale=2.0]
\tikzstyle{every node}=[draw, shape=circle, fill=black!20];
\path (0:0cm) node[fill=black!40] (v0){$v_0$};
\path (20:0.8cm) node (v1){$v_1$};
\path (340:0.9cm) node (v8){$v_8$};
\end{tikzpicture}
}
\caption[Step2]{State 2}
\subfloat[State 3]{
\label{fig:chap3_input_image3}
\begin{tikzpicture}[scale=2]
\tikzstyle{every node}=[draw, shape=circle];
\path (0:0cm) node[fill=black!30] (v0){$v_0$};
\path (20:0.8cm) node (v1){$v_1$};
\path (340:0.9cm) node (v8){$v_8$};
\end{tikzpicture}
}
\hfill
\caption[Third step]{Third step of algorithm}
\subfloat[Step 4]{
\label{fig:chap3_input_image4}
\begin{tikzpicture}[scale=2]
\tikzstyle{every node}=[draw, shape=circle];
\path (0:0cm) node[fill=black!30] (v0){$v_0$};
\path (20:0.8cm) node (v1){$v_1$};
\path (60:1.0cm) node (v2){$v_2$};
\path (340:0.9cm) node (v8){$v_8$};
\end{tikzpicture}
}
\caption[Algorithm X]{Flow of algorithm X}
\label{fig:AlgorithFlow}
\end{figure}
Thanks in advance

\captionmacro is only used once for all images. The sub captions have to be inside the\subfloatcommand – Herbert Jan 19 '11 at 15:43