Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Random solution

Signature

random_solution(Problem) : Solution

Description

This function samples the feasible decision space of the given problem instance uniformly at random (with replacement) and produces a feasible solution.

Use cases

Random solutions are often used as initial solutions in local search. The initial population of evolutionary algorithms typically consists of solutions generated at random.

See also

Problem, Solution.