pg.evolution.recombinators.PartiallyMapped

Accessible via pg.evolution.recombinators.PartiallyMapped.

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

Bases: pg.evolution.recombinators.Permutation

Partially mapped crossover (PMX).

The partially mapped crossover (PMX) was proposed by D. Goldberg and R. Lingle, “Alleles, Loci and the Traveling Salesman Problem,” in Proceedings of the 1st International Conference on Genetic Algorithms and Their Applications, vol. 1985, pp. 154–159, Los Angeles, USA.

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

Methods:

partially_mapped_crossover(parents, start, end)

Cross over and remap the rest elements at given cutting points.

permutate(multi_choice_spec, parents)

"Permutate decisions for a multi_choice_spec.

partially_mapped_crossover(parents, start, end)[source]

Cross over and remap the rest elements at given cutting points.

Return type:

List[List[int]]

permutate(multi_choice_spec, parents)[source]

“Permutate decisions for a multi_choice_spec.

Return type:

List[List[int]]