469,890 Members | 2,154 Online

# Genetic algorithm Problem

93
Hi,
I wanted to create a genetic algorithm for this question :
Suppose you are out shopping. You have to buy things from different n number of stores. And have to bring home the goods required from every store. There is an amount(specified in kg) of goods that you have to buy at each store and once at a store, you have to buy that total amount. Of course, carrying all this weight around is going to cost you energy. So, you want to do this the most energy-saving way. Multiple visits to home are allowed, and all the weight can be dumped when you arrive at home. Carrying your body around would cost a constant amount of energy per meter. There would be an edge list as well as a node weight list as the problem description.
Actually, I started to make a program for this (using genetic algorithms), but I got stuck with the crossover function. As the paths can have a length of 2*n + 1, the length of the solutions varied so I couldn't really do it. I chose to do this for a project in a subject, but in the end I had to change it to a modified version of TSP (By removing multiple visits to home.).
So, can anyone tell me of a good way to implement the crossover function?
Or, are genetic algorithms a bad method for the problem? If so, do tell me what methods may be useful here? Thanks.
Oct 17 '07 #1
1 1843
DumRat
93