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
0
votes
1 answer

How does Genetic Algorithm Crossover work when my output contains only 2 states?

I'm currently working on a project where I am using a basic Cellular Automata and a Genetic Algorithm to create dungeon-like maps. Currently, I'm having an incredibly hard time understanding how exactly crossover works when my output can only be two…
Ryan
  • 1
  • 1
0
votes
0 answers

Small changes in maximum fitting score of offspring in Genetic Algorithm(repetition)

I am implementing the Genetic Algorithm in python to decode a message. in every generation, I print the maximum fitting score of the population. But after reaching about a specific number it stops growing. For example, I see these numbers:…
Maryam
  • 119
  • 1
  • 1
  • 6
0
votes
0 answers

Pine script: count number of times a plot crosses a value in a given bar(s)

I'm looking at the version 4 documentation (https://www.tradingview.com/pine-script-docs/en/v4/index.html and I'm not sure I'm finding what I need: I'd like to have a function which, for some price P, determines the number of times the real price p…
bmf
  • 55
  • 1
  • 7
0
votes
1 answer

Can anyone explain how different is this hybrid PSOGA from normal GA?

Does this code have mutation, selection, and crossover, just like the original genetic algorithm. Since this, a hybrid algorithm (i.e PSO with GA) does it use all steps of original GA or skips some of them.Please do tell me. I am just new to this…
0
votes
1 answer

TradingView Pine Script Multiple crossover strategy

I am desperately looking for help with writing a strategy in trading view where I'm trying to create a crossover buy and sell signals on 3 different MA's , specifically a 9 ema , 21 ema, and 33 simple moving average. What I'm trying to do is have a…
EMAguru
  • 1
  • 1
  • 1
  • 2
0
votes
1 answer

Using the NEAT Algorithm, will a child of two genomes always have the same structure as the most fit parent?

I'm trying to implement the NEAT Algorithm using c#, based off of Kenneth O. Stanley's paper. On page 109 (12 in the pdf) it states "Matching genes are inherited randomly, whereas disjoint genes (those that do not match in the middle) and…
0
votes
2 answers

These two codes should do exactly the same thing, but the first one doesn't work as I expect

Python Please explain why these two codes work differently.. Actually I am trying to make kind of AI where in initial generations the individuals will go in random directions. For keeping the code simple I have provided some random directions in…
Sparsh
  • 1
  • 3
0
votes
1 answer

Mixing Two Numpy Arrays Randomly

This is my first question on Stack Overflow, so bear with me. Let's say I have two arrays of the same shape, X and Y import numpy as np X = np.array(([0, 0], [0, 0]), dtype=float) X = np.array(([1, 1], [1, 1]),…
0
votes
0 answers

How to subdivide a space using nearest neighbour random points?

I am trying to create an efficient crossover method for a genetic algorithm I am building. I only have 2 or 3 variables to optimise so I can treat each generation as points on a plane or sphere. To generate the children I would like to divide the…
0
votes
1 answer

How can I improve this genetic algorithm for the TSP?

This is my genetic algorithm, step by step: Generate two initial population's randomly, and select the fittest tour from both. Perform an ordered crossover, which selects a random portion of the first fit tour and fills in the rest from the second,…
0
votes
0 answers

Genetic algorithm for 1D Stock Cutting

I'm trying to implement a genetic algorithm for the 1-dimensional stock cutting problem. The problem is that we have unlimited stock of metal with m different length and n different order length (smaller than stock length) with different quantities…
0
votes
1 answer

Single point crossover

I have two array(matrix with one row) temp1 and temp2 as follow: temp1=[1 2 3 4 5 6 7 8 9] temp2=[10 11 12 13 14 15 16 17 18] and I have an index pn=3. I need output as follows: tempNew=[1 2 3 13 14 15 16 17 18] i.e. how do I create tempNew such…
mahdi luis
  • 37
  • 5
0
votes
1 answer

Java - crossover algorithm

I working on android app for TSP problem. I have a crossover algorithm and i want minimize number of loops for faster algorithm. How I can do it? This is the code: public static Path crossover(Path dad, Path mom) { //Create new child path …
0
votes
1 answer

Xamarin Forms asmx webservice multiple calls

in my Project i call a Webservice like this: HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("**********"); req.Method = "POST"; req.ContentType = "application/json"; byte[] postDataAsBytesS = Encoding.UTF8.GetBytes(mobileJSON); Stream…
Pascal
  • 91
  • 1
  • 10
0
votes
1 answer

Uniform crossover in MATLAB

I have been able to code a 1-point crossover as follows: n_parents = length(parents); randparents = randperm(n_parents); parent1 = population.ind{parents(randparents(1))}; parent2 = population.ind{parents(randparents(2))}; cross_point =…
Uttara
  • 125
  • 1
  • 1
  • 16