Questions tagged [crossover]

In genetic algorithms, crossover is a genetic operator used to vary the programming of a chromosome or chromosomes from one generation to the next.

Crossover is analogous to reproduction and biological crossover, upon which genetic algorithms are based.

Crossover is a process of taking more than one parent solutions and producing a child solution from them.

Many crossover techniques exist for organisms which use different data structures to store themselves: one-point crossover, two-point crossover, uniform crossover...

See Crossover (genetic algorithm) on Wikipedia.

113 questions
2
votes
1 answer

Genetic algorithm crossover error

so I'm making a child from 2 of the best parents in the current generation. the idea is to take some random amount of the first half of the route from parent 1, and random amount of the second half from parent 2. I think the problem arises when I…
desy
  • 43
  • 1
  • 7
2
votes
3 answers

Two point crossover in Matlab

What is the best way to implement two point crossover in Matlab? The two point crossover is described here. Note that in my application I cannot split the lists wherever. They are grouped by four, so places where it is allowed to split a list…
C. E.
  • 10,297
  • 10
  • 53
  • 77
1
vote
1 answer

Uniform Crossover in Java

I am having trouble implementing a uniform crossover in java. This is the algorithm; // Uniform Crossover public void UniformCrossover(Individual indi) { if (RVGA.rand.nextDouble() < pc) { // Put your implementation of uniform crossover here …
Student
  • 443
  • 1
  • 7
  • 11
1
vote
1 answer

Cross-over is failing binary encoded string

I am implementing Genetic Algorithm (GA). There are 43 numbers [Ambulance Locations] to choose from (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39) ,…
user13373167
1
vote
1 answer

How to make this operator to happen if it is below a threshold

I am kind of new in this python. I am trying to learn how to modify functions. In this case, I found the code below online. I want to learn how to make it work only with probability = 0.9. That is to say, if I have two binary strings like…
1
vote
1 answer

pinescript - draw a horizontal line immediately (not at closing) when the price cross over a line

Long will open when price cross over ema10 and short when it price cross under. Long target is l line and short target is s line. For example, while in long, I want to draw a horizontal line immediately (not at closing) when the price cross over l…
Penguen
  • 13
  • 3
1
vote
1 answer

Linear mixed model in replicated crossover design

I am struggling on how to fit the model for replicated crossover design using REML method. The suggested model by FDA is as above and can someone help on how to code it into R coding ? This is my coding and I wonder if it is right or wrong…
fat
  • 21
  • 2
1
vote
0 answers

Remove messages in r ouput

I am currently struggling with my R coding since I am a newbie. Can someone help me if there is any way to hide all the messages that R display in the output. Because I have to run for 2000 in my simulation and the messages keep on appearing in my…
fat
  • 21
  • 2
1
vote
1 answer

Implementing a crossover function for multiple "Salesmen" TSP in a genetic algorithm

I’m trying to solve a variant of the TSP problem with “multiple salesmen". I have a series of n waypoints and m drones and I want to generate a result which sorts of balances the number of waypoints between drones and returns an acceptable shortest…
1
vote
2 answers

How to perform Partial-mapped crossover in python3?

I am new to genetic algorithms and made one the other day that recreated a target string. So I tried to make one that could make a Magic Square. It was ok until I got to the crossover part, realising I couldn't just do a single point crossover. So I…
Sam
  • 65
  • 4
  • 7
1
vote
1 answer

how to perform tree crossover between two graphs using networkx?

I want to perform tree crossover between two graphs using the following steps: Select one node in each graph, the selected node must have the same type i.e. the node are objects of the same class. Exchange the two subgraphs that are rooted by the…
adnanmuttaleb
  • 3,388
  • 1
  • 29
  • 46
1
vote
0 answers

EA: Custom crossover for a list of lists in Python

Could anyone explain me a little bit on how I could perform a custom crossover on a list of lists? Let's say I have a candidate like this: candidate = [[0,1,2,3][4,5,6,7,8][9,10,11]] I know how I could do a crossover for a single list. But how to…
1
vote
0 answers

how to optimize my Genetic Algorithm results

I've already programmed Genetic Algorithm for the Multi-depot Vehicle Routing Problem with time window problem and it works perfectly but the results are not good enough. I am comparing my results with Solomon bench Marks and all his instances the…
Safa May
  • 11
  • 1
1
vote
1 answer

Why use Crossover in Neural Network training?

Why specifically is it used? I know it increases variation which may help explore the problem space, but how much does it increase the probability of finding the optimal solution/configuration in time? And does it do anything else advantageous?…
edo
  • 99
  • 1
  • 2
  • 15
1
vote
0 answers

Ordered Crossover in GA

I'm using Python to write a simple GA code for the quadratic assignment problem with 12 departments. My solution (chromosome) is a list where the value represent the number of the department and the index represents the location. During crossover, I…
Rawan
  • 11
  • 1