\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}

\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage{amssymb,amsmath,amsfonts} % nice math rendering
\usepackage{braket} % needed for \Set
\usepackage{algorithm,algpseudocode}
\renewcommand{\thealgorithm}{3} %disable numbers for algorithm

\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}
