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:
- Perhaps somehow implement a GA allowing variable length chromosomes and solve the problem in a single run (Not sure if possible?)
- Estimate a maximum feasible number of cars (e.g. 20) and run a fixed-length GA for each car slot number from 1 to 20 and compare the 20 results
- 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)
- 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?