def genetic_search(problem, fitness_fn, ngen=<NUM_LIT:1000>, pmut=<NUM_LIT:0.1>, n=<NUM_LIT:20>):
s = problem.initial_state<EOL>states = [problem.result(s, a) for a in problem.actions(s)]<EOL>random.shuffle(states)<EOL>return genetic_algorithm(states[:n], problem.value, ngen, pmut)<EOL>
Call genetic_algorithm on the appropriate parts of a problem.
    This requires the problem to have states that can mate and mutate,
    plus a value method that scores states.