\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{amssymb,amsmath,amsfonts}
\usepackage{braket}
\usepackage{algorithm,algpseudocode}
\renewcommand{\thealgorithm}{3}
\begin{document}
\begin{preview}
\begin{algorithm}[H]
\begin{algorithmic}
\Require $G = (V, E)$ an undirected graph
\State $n \gets |V|$
\State Give all vertices an index $1 \leq i \leq n$ that defines an order
\For{$i \in 1, \dots, n$}
\State $v_i$.color $\gets 0$
\EndFor
\\
\If{$n==1$}
\State \Return
\Else
\For{$maxColors \in 2, \dots, n$}
\While{$G$ is not properly colored and not all vertices have color $(maxColors-1)$}
\State $(v_1 v_2 \dots v_n) \gets (v_1 v_2 \dots v_n) + 1$ \Comment{count up in base $maxColor$}
\EndWhile
\EndFor
\EndIf
\end{algorithmic}
\caption{Find a vertex coloring for $G$ with brute force}
\label{alg:vertexColoring}
\end{algorithm}
\end{preview}
\end{document}