genetic-algorithm

Crossover operator for permutations

微笑、不失礼 提交于 2019-12-18 02:42:41
问题 i'm trying to solve the problem of crossover in genetic algorithm on my permutations. Let's say I have two permutations of 20 integers. I want to crossover them to get two children. Parents have the same integers inside, but the order is different. Example: Parent1: 5 12 60 50 42 21 530 999 112 234 15 152 601 750 442 221 30 969 113 134 Parent2: 12 750 42 113 530 112 5 23415 60 152 601 999 442 221 50 30 969 134 21 Let it be that way - how can I get children of these two? 回答1: What you are

Have you ever used a genetic algorithm in real-world applications?

我的梦境 提交于 2019-12-17 21:41:15
问题 I was wondering how common it is to find genetic algorithm approaches in commercial code. It always seemed to me that some kinds of schedulers could benefit from a GA engine, as a supplement to the main algorithm. 回答1: Genetic Algorithms have been widely used commercially. Optimizing train routing was an early application. More recently fighter planes have used GAs to optimize wing designs. I have used GAs extensively at work to generate solutions to problems that have an extremely large

My C code for a genetic algortihtm is not functioning, it dosent enter into the if condition

强颜欢笑 提交于 2019-12-13 22:55:58
问题 This is GA for a timetable problem. I'm trying to create an initial population, but it isn't working as it isn't entering the if condition. can someone point out the error? I tried inserting statements in each condition, but everything checks out. Still, I don't seem to find a solution. #include<stdio.h> #include<math.h> #include<stdlib.h> #include<ctype.h> #include<time.h> int random_number_creator(int upper, int lower) { int n; n = rand() % (upper-lower)+ lower; return n; } struct pop{ int

How to determine characteristics for a genome?

十年热恋 提交于 2019-12-13 18:06:15
问题 In AI, are there any simple and/or very visual examples of how one could implement a genome into a simulation? Basically, I'm after a simple walkthrough (not a tutorial, but rather something of a summarizing nature) which details how to implement a genome which changes the characteristics in an 'individual' in a sumlation. These genes would not be things like: Mass Strength Length, Etc.. But rather they should be the things defining the above things, abstracting the genome from the actual

genetic algorithm handling negative fitness values

点点圈 提交于 2019-12-13 12:25:56
问题 I am trying to implement genetic algorithm for maximizing a function of n variables. However the problem is that the fitness values can be negative and I am not sure about how to handle negative values while doing selection. I read this article Linear fitness scaling in Genetic Algorithm produces negative fitness values but it's not clear to me how the negative fitness values were taken care of and how scaling factors a and b were calculated. Also, from the article I know that roulette wheel

Genetic algorithm encoding technique to be used in this scenario

江枫思渺然 提交于 2019-12-13 02:38:05
问题 The problem is to find the optimum quantity that incurs minimum total cost in a number of warehouses using genetic algorithm. Let's say there are n warehouses. Associated with each warehouse are a few factors: LCost i : loading cost for warehouse i HCost i : holding cost for warehouse i TCost i : transportation cost for warehouse i OCost i : ordering cost for warehouse i Each warehouse has quantity Q i associated with it that must satisfy these 4 criteria: loading constraint: Q i * LCost i >=

Genetic Algorithms - Can chromosomes be trees?

白昼怎懂夜的黑 提交于 2019-12-13 01:45:53
问题 I'm working in my degree thesis and I'm trying to create a GA to create levels for a game in a procedural way. Even if GA isn't the best technique, is possible. Anyway, since I never worked with them I'm reading some books about introduction in GA. The thing is, is necessary to represent chromosomes as bits or they can be any kind of data struct? I'm asking it because in my mind, using trees to create levels in a procedural way and using GA to evaluate them looks fine, but when I read about

Choosing parents to crossover in genetic algorithms?

大兔子大兔子 提交于 2019-12-12 19:12:10
问题 First of all, this is a part of a homework. I am trying to implement a genetic algorithm. I am confused about selecting parents to crossover. In my notes (obviously something is wrong) this is what is done as example; Pc (possibility of crossover) * population size = estimated chromosome count to crossover (if not even, round to one of closest even) Choose a random number in range [0,1] for every chromosome and if this number is smaller then Pc, choose this chromosome for a crossover pair.

Optimization with positive integer parameters

假如想象 提交于 2019-12-12 16:17:31
问题 I need to solve a problem which entails comparing two matrices with the same number of columns. One of these is manipulated until the best match is obtained. The way I score the differences between the two matrices is quite convoluted and I still have to finalize it. What I'm really interested at the moment in is finding a search/optimization algorithm that works with positive integers only. I've created a simple example with a simple function to maximise. Let's say I have a dataset D. D <-

Genetic algorithms: How to do crossover in “subset” problems?

耗尽温柔 提交于 2019-12-12 08:49:34
问题 I have a problem which I am trying to solve with genetic algorithms. The problem is selecting some subset (say 4) of 100 integers (these integers are just ids that represent something else). Order does not matter, the solution to the problem is a SET of integers not an ordered list. I have a good fitness function but am having trouble with the crossover function. I want to be able to mate the following two chromosomes: [1 2 3 4] and [3 4 5 6] into something useful. Clearly I cannot use the