I am trying to build a block diagram with some control flow using TikZ. The blocks in the diagram should be aligned like the vertices of a hexagon. Also the \centering macro is not working for me. Please give me suggestions to center the entire picture and improve the alignment among the blocks.
\documentclass{article}
\usepackage{amsmath}
\usepackage{biblatex}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{tikz}
\usepackage{varwidth}
\usetikzlibrary{shapes.multipart, arrows}
\tikzstyle{nodest} = [draw, rounded corners, very thick]
\begin{document}
\centering
\begin{tikzpicture} [node distance=5cm, auto, >=latex']
\node (inputnode)[nodest, align=center, rectangle split, rectangle split draw splits=false] {
\textbf{Input}
\nodepart{two}
$(A, 506, 90)$\\
$(B, 590, 86)$\\
$(A, 590, 70)$
\nodepart{three}
$(C, 506, 23)$\\
$(C, 590, 45)$\\
$(B, 506, 67)$
};
\node [below of=inputnode] {\begin{varwidth}{15em}\Large{partitions of input tuples are sent to mappers}\end{varwidth}};
\draw[thick] (inputnode.text split west) -- (inputnode.text split east);
\draw[dashed] (inputnode.second split west) -- (inputnode.second split east);
\node (map1node)[nodest, rectangle split, rectangle split draw splits=false, right of=inputnode, yshift=2.5cm] {
\textbf{Mapper 1}
\nodepart{two} $key = 506, value = (A, 90)$
\nodepart{three} $key = 590, value = (B, 86)$
\nodepart{four} $key = 590, value = (A, 70)$
};
\draw[->, thick] (inputnode.two east) -- (map1node);
\node (map2node)[nodest, rectangle split, rectangle split draw splits=false, below of=map1node] {
\textbf{Mapper 2}
\nodepart{two} $key = 506, value = (C, 23)$
\nodepart{three} $key = 590, value = (C, 45)$
\nodepart{four} $key = 506, value = (B, 67)$
};
\draw[->, thick] (inputnode.three east) -- (map2node);
\node [below of=map2node] {\begin{varwidth}{15em}\Large{Mappers}\end{varwidth}};
\node (reduce1node) [nodest, rectangle split, rectangle split parts=5, rectangle split draw splits=false, right of=map1node, xshift=2cm] {
\textbf{Reducer 1}
\nodepart{two} $key = 506$
\nodepart{three} $(A, 90)$
\nodepart{four} $(C, 23)$
\nodepart{five} $(B, 67)$
};
\draw[->, dashed] (map1node.two east) -- (reduce1node.three west);
\draw[->, dashed] (map2node.two east) -- (reduce1node.four west);
\draw[->, dashed] (map2node.four east) -- (reduce1node.five west);
\node (reduce2node) [nodest, rectangle split, rectangle split parts=5, rectangle split draw splits=false, right of=map2node, xshift=2cm] {
\textbf{Reducer 2}
\nodepart{two} $key = 590$
\nodepart{three} $(B, 86)$
\nodepart{four} $(A, 70)$
\nodepart{five} $(C, 45)$
};
\draw[->, dashed] (map1node.three east) -- (reduce2node.three west);
\draw[->, dashed] (map1node.four east) -- (reduce2node.four west);
\draw[->, dashed] (map2node.three east) -- (reduce2node.five west);
\node [below of=reduce2node] {\begin{varwidth}{15em}\Large{Reducers}\end{varwidth}};
\end{tikzpicture}
\end{document}

centeringenvironment outside thetikzpictureto centre the picture on the page. – Andrew Stacey Sep 26 '12 at 09:49