I have a beamer slide:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\tikzstyle{decision} = [diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex]
\begin{document}
\begin{frame}{Simulated Annealing (SA)}
\begin{center}
\resizebox{0.4 \linewidth}{!}{%
\begin{tikzpicture}[node distance = 2cm, auto]
\node[block] (init){Init $n=0$, $T_0$, and $S_0$};
\node[block, below of=init] (nbrh){$S_{n+1}=N(S_n)$};
\node[decision, below of=nbrh](ovgt){$f(S_{n+1}) \le f(S_n)$};
\node[block, below of=ovgt] (accp){Accept $S_{n+1}$};
\node[decision, right of=ovgt](rand){Accept with $P = e^{-\frac{\Delta f}{t_n}}$};
\node[block, right of=nbrh, anchor=west] (rejj){Reject $S_{n+1}$};
\node[block, below of=accp] (incr){$T_{n+1} = K(T_n)$ and $n=n+1$};
\node[block, below of=incr] (stop){Stop};
\node[decision, left of=stop] (stcd){Stop?};
\path[line] (init) -- (nbrh);
\path[line] (nbrh) -- (ovgt);
\path[line] (ovgt) -- node{yes}(accp);
\path[line] (ovgt) -- node{no} (rand);
\path[line] (rand) -- node{no} (rejj);
\path[line] (rejj) -- (nbrh);
\path[line] (rand) |- node{yes}(accp);
\path[line] (accp) -- (incr);
\path[line] (incr) -- (stcd);
\path[line] (stcd) -- node{yes}(stop);
\path[line] (stcd) |- node{no} (nbrh);
\end{tikzpicture}%
}%
\end{center}
\end{frame}
\end{document}
which gives:

There are a few things I'm not happy with in the output:
Simple equations like
$S_{n+1}=N(S_n)%should be on 1 line. It's okay for the text to be smaller. Similarly,$T_{n+1}=K(T_n)$should be on 1 line, 'and' can be on it's own line, and$n=n+1$should be on it's own line. The inequality in the decision should also be on one line.The vertical 'no' line connecting the "Accept" decision on the right, and the "Reject" action is not quite vertical. Also, this decision is larger than the decision immediately to the left.
There is very little space between these two decisions.
The "Accept" action under the inequality decision overlaps with the decision above. In contrast, that decision is quite far from the action above that.
Lastly, I'm not happy with the bottom two elements. I would have preferred to have the "Stop?" decision directly underneath, and the "Stop" action to the right. Unfortunately, I'm not sure how to put 2 bends in the "no" from "Stop?", meaning that the line actually cuts through everything above. I tried
|-|and-|-but this doesn't work.
I asked a previous question here about scaling the whole tikzpicture to the height of the slide, however the solution that was presented did not work for me. It is still being cut off at the bottom. The problem may have to do with the fact that my actual beamer presentation uses the Hannover theme, and as such there is less usable space in the slide? I have gotten around it by using 0.4 \linewidth temporarily.


