I have the following code which produces the algorithm in the image.
\documentclass{article}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}[h]
\caption{Q-learning}
\begin{algorithmic}[1]
\Require Set of good nodes $V^g$, $score(u) \; \forall u \in V^g, \mbox{ number of episodes } E, \mbox{ budget size } b$, $\epsilon$
\Ensure Learned parameters $\Theta_Q$
\State Initialise replay buffer $M = \emptyset$
\For{Episode $e \leftarrow 1 \mbox{ to } E$}
\State $S_t \leftarrow \emptyset,\; C_t \leftarrow V^g$
\For{Step $t \leftarrow 1 \mbox{ to } b$}
\State
\begin{equation}
v_t \leftarrow
\begin{cases}
\mbox{A node chosen uniformly at random from } C_t & \mbox{w.p. } \epsilon \\
\argmax_{v \in C_t} Q(S_t, v) & \mbox{w.p. } 1-\epsilon
\end{cases}
\end{equation}
\EndFor
\EndFor
\end{algorithmic}
\end{algorithm}
\end{document}
I would like line 5 to be less centred in the middle of the page and more in-line with where it would be under the for loop if it was a normal piece of text. Can I do this using the equation/cases environment or do I need to create it some other way?
Sorry if I have any imports missing for the equation etc. as it may be in my preamble

\\ $\begin{cases} … \end{cases}$? – Bernard Jun 21 '21 at 13:53$environment! please, write this as an answer and I can upvote and accept it :) – David Jun 21 '21 at 14:04equation. Do you need it? – Bernard Jun 21 '21 at 14:10