I am doing my master thesis and need to include an algorithm into my LaTeX code. I have been trying for hours now, but I still have several errors that always show up. It is my first time using the algorithm package, so help would be appreciated. Here is the code:
\documentclass{article}
\usepackage{algorithm,algorithmic,algpseudocode}
\begin{document}
\begin{algorithm}
\caption{Resource Allocation Algorithm }
\label{alg:algorithm_sum}
\begin{algorithmic}[1]
\State{Initialization of maximum number of iteration $I_{\text{max}}$, given $\mu^m$ and $\beta^m$ and obtain the intermediate solution for (opt. variables)}
\If{ref. is satisfied}
\State{Convergence = true}
\Return{opt. variables}
\Else
\State{update $\mu$ and $\beta$ according to ref. and $m=m+1$}
\State{Convergence = false}
\EndIf
\Until{Convergence = true or $m=I_{\text{max}}$}
\end{algorithmic}
\end{algorithm}
\end{document}

