Random Sampling


Random Sampling is an algorithm which, simply, randomly creates a new candidate solution, usually by uniformly sampling the search space. (uniform sampling means that each possible genotype has the same probability of being chosen)


$$f \gets \text{the objective/fitness function}$$ $$terminationCriteria \gets \text{the termination criterion}$$ $$x \gets \text{the new solution}$$ $$\textit{Best} \gets \text{the best individual ever discovered}$$


Thomas Weise - Metaheuristic Optimization

Pseudo Code
\caption{RS Algorithm}
                \STATE $\textit{Best} \gets Null$
                    \STATE $x \gets random()$
                    \IF{$f(\textit{Best}) \geq f(x)$ or $\textit{Best} == Null$}
                        \STATE $\textit{Best} \gets x$
                \RETURN $\textit{Best}$