pg.evolution.recombinators.Cycle

Accessible via pg.evolution.recombinators.Cycle.

class Cycle(where=Any(k=1, seed=None), seed=None)[source]

Bases: pg.evolution.recombinators.Permutation

Cycle crossover (CX).

The cycle crossover (CX) operator was first proposed by I. M. Oliver, D. J. d. Smith, and R. C. J. Holland, “Study of permutation crossover operators on the traveling salesman problem,” in Genetic algorithms and their applications: proceedings of the second International Conference on Genetic Algorithms: July 28-31, 1987 at the Massachusetts Institute of Technology, Cambridge, MA, USA, 1987.

Reference: https://dl.acm.org/doi/10.5555/42512.42542.

Methods:

cycle_crossover(parents)

Cycle crossover.

permutate(multi_choice_spec, parents)

"Permutate decisions for a multi_choice_spec.

cycle_crossover(parents)[source]

Cycle crossover.

Return type:

List[List[int]]

permutate(multi_choice_spec, parents)[source]

“Permutate decisions for a multi_choice_spec.

Return type:

List[List[int]]