\setcounter{AlgoLine}{0}
\DontPrintSemicolon
	{
		\KwIn{Function $f : [\overrightarrow{x}_{min}, \overrightarrow{x}_{max}] \in \mathbb{R}^n \rightarrow \mathbb{R}$ to minimize, parameters $\mu, \omega, \phi _1, \phi _2, I_{max}$}
		\KwResult{$\overrightarrow{g}$}
		$f^* = \infty$\\
		\For{$p = 1 \dots \mu$}
		{$\overrightarrow{v_p} \leftarrow  \overrightarrow{unif}(\overrightarrow{x}_{min} -\overrightarrow{x}_{max} , \overrightarrow{x}_{max} - \overrightarrow{x}_{min})$\nllabel{alg:init_speed}\tcp*[r]{Initial particle velocity}
			$\overrightarrow{s_p} \leftarrow \overrightarrow{unif}(\overrightarrow{x}_{min}, \overrightarrow{x}_{max})$\nllabel{alg:init_position}\tcp*[r]{Initial particle position (solution)}
			$\overrightarrow{m_p} \leftarrow \overrightarrow{s_p}$\tcp*[r]{Best own position}
						\uIf(Update gloal best){$f^* > f(\overrightarrow{s_p})$}
			{$f^* \leftarrow f(\overrightarrow{s_p})$\\
				$\overrightarrow{g} \leftarrow \overrightarrow{s_p}$\\
			}
		}
		\For{$I_{max}$ iterations}
		{
		 \For{$p = 1 \dots \mu$}
		  {$\overrightarrow{u_1} \leftarrow \overrightarrow{unif}(\overrightarrow{0}, \overrightarrow{1})$ \\
			$\overrightarrow{u_2} \leftarrow \overrightarrow{unif}(\overrightarrow{0}, \overrightarrow{1})$\\
			$\overrightarrow{v_p} \leftarrow \omega \overrightarrow{v_p} + \phi _1 \overrightarrow{u_1}  \bigotimes (\overrightarrow{m_p}-\overrightarrow{s_p})    + \phi _2  \overrightarrow{u_2}  \bigotimes (\overrightarrow{g}-\overrightarrow{s_p})$\nllabel{alg:speed_update}\tcp*[r]{Update velocity}
			$\overrightarrow{s_p} \leftarrow \overrightarrow{max}(\overrightarrow{min}(\overrightarrow{s_p} + \overrightarrow{v_p},\overrightarrow{x}_{max}), \overrightarrow{x}_{min})$\nllabel{alg:position_update}\tcp*[r]{Update position}
			\If(Update own best){$f(\overrightarrow{m_p}) > f(\overrightarrow{s_p})$}
			{$\overrightarrow{m_p} \leftarrow \overrightarrow{s_p}$\\
				\If(Update gloal best){$f^* > f(\overrightarrow{s_p})$}
				{ $f^* \leftarrow f(\overrightarrow{s_p})$\\
					$\overrightarrow{g} \leftarrow \overrightarrow{s_p}$\\
				}
			}
		  }
		}
	}

