Genetic Algorithm Data Structure Dillema
Hey guys, first off I'm fairly new here, and this isn't exactly a coding question, more so a opinion from you guys that might have some experience with this. Also even tho the issue is pretty basic, I put it in the advanced forums because I figured people here might have exp with GA's.
Here is my problem. I'm implementing a fairly abstract genetic algorithm framework, which will be expendable to quite a big range of problems, including np-hard problems...and finding solutions to some of them with evolutionary systems will be very efficiency sensitive.
I would really like to hear your suggestions about the data structure (or combination) that you think would prove most efficient.
At first I assumed keeping my population member (or genes) in an array is a no-go because for every change i make - for example a mutation..or crossover etc..i want to i insert the new gene into the population at a correct location (based on its fitness value)...which made me decide to go with a linked-list (since its just a relinking of 2 nodes to add a new one..which seemed very efficient).
However as I implemented more of the system, I realized that, for example, in order to perform a crossover between 2 population members...i can't just choose two members and get them in O(1) like i could with an array...but have to traverse through my linked list, every time..which if done twice in every crossover becomes very not efficient.
I guess I'm asking for what you think might be the more efficient way of implement this, since I don't have much experience with GA's...and probably won't find a big difference until I'm committed to one alternative.
EDIT: by the way, I do use the GA terminology fairly loosely..and if some of my reasoning makes no sense to you, or is confusing I will gladly explain what i mean. Just looking for some brainstorm:) or someone pointing out i'm wrong :D