I'm writing the following formulas in latex and I see the elements of the first equation is spreading in the page. Here is what is what I have tried:
\usepackage{amsmath}
\begin{equation}
\min\limits_{w, \xi_n, \rho} \frac{1}{2} $$ || w || $$^2 + \frac{1}{\gamma n}\biggl(\sum_{i=1}^N \mathbf{\xi}_{i}\biggr) - \rho
\end{equation}
\State subject to:
\begin{equation}
(w \cdot \phi(x_i)) \geq \rho - \mathbf{\xi}_{i}
\end{equation}
I appreciate if anyone can help me to fix it.
What I have tried is the following equations