简体   繁体   中英

Genetic Algortihm - Strategies for variable length optimizations

I have a problem I want to solve using genetic algorithms (GA). You can simplify it to the following problem:

I want to optimize the car pool of a company, which means, the number of cars and car models . I already have a fitness function calcFitness(carList) which evaluates given setups like 'business car, transporter' or 'business car, business car, transporter'. Now, the question is, how do I solve this variable length problem using GA.

I have four ideas how you could tackle these problems generally:

  1. Perhaps somehow implement a GA allowing variable length chromosomes and solve the problem in a single run (Not sure if possible?)
  2. Estimate a maximum feasible number of cars (eg 20) and run a fixed-length GA for each car slot number from 1 to 20 and compare the 20 results
  3. Similar to #2, but without a fixed upper limit: You start off with 1 car and increase the number of slots until the best solution for the incremented number is worse than the preceding solution (gradient-based approach)
  4. Two stacked fixed-length GAs: A parent GA is solely responsible for optimizing the number of car slots and in its fitness function another GA optimizing the assignement of these slots is called

What do you think about these general approaches? Any other ideas or perhaps alternatives to GA for these variable length cases?

Variable length is certainly possible, and the most natural representation of this problem, it seems. Why would it be an issue? The only substantial difference will be in the crossover operation. While a single-point is trivial (you just pick a point within a , a point within b , and automatically get a variable-length offspring), it is often better to have continuous crossover which requires some more intuition with variable lengths. But that can be implemented later following a thorough separate testing.

Be prepared that your algorithm may find out that the better the chromosome the better results (under some combination of circumstances) it can produce. You don't get exponential bloat like in genetic programming (where the genotypes are trees rather than linear sequences) but still the chromosome length may start growing uncomfortably. You may need to account for that in the fitness function, or you may model a solution like #2 by rejecting candidates surpassing some limit right away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM