# Find consensus trajectory of how a genetic algorithm solves an optimization

I have implemented a genetic algorithm to find the evolutionary outcomes of a biological scenario. I simulate the evolution (i.e. optimization) of five traits in my model. I ran my code 100 times and it produced acceptable results, from biological stand-point. I want to highlight that, for biological reasons, my initial population was not very diverse. If I suppose my population size is m and my algorithm runs for n generations, an output of my algorithm is a m*n table. In a specific cell of this table, called table[i][j], I saved the values of five traits for the ith individual in the jth generation (i between 1 and m, j between 1 and n).

To discuss my data biologically, I want to know that if there is any specific pattern(s) in finding optimal solutions or not? In other words, is there an algorithm that I can use to find a hypothetical (consensus) "trajectory", that my individuals crossed to reach the optimal point(s)? For example, is there any specific pattern(s) in changes in genes (traits)? Or, is there any specific relationship between variables?

PS: To visualize my data, I calculate the average value for each gene (parameter) in each generation and plot the genes' values against generations. To give you an intuitive understanding of the results, here are five examples of these plots.     • It seems hard to know without any details, and even then, it might be practically speaking impossible - did you simply try to see if there's some clear pattern? – Juho Jan 21 at 19:26
• When I look at plots, I see some trends. For example, almost in every case the Gene 4 (purple line) is increased to the second level and stayed at this level till the end. Another example is that Gene 1 (dark blue line) and Gene 2 (pink line) is changing similarly and simultaneously in most, but not all, plots in the first 50 generations. Regarding the biological aspect, I believe there may be some patterns. Can I provide any special details about the problem to make it easier to answer my question? – Armin Dadras Jan 21 at 19:48
• Well, I suppose that whatever the problem is that you are solving doesn't have an analytical solution (since you use a genetic algorithm). Thus, it feels unlikely that you would be able to describe precisely the trajectories. So probably what you can do at most is say something like "on this data, trajectories seem to behave in such and such a way", but this is no guarantee of anything in general (i.e., if the problem parameters change, maybe the trajectories are completely different, who knows). – Juho Jan 21 at 19:56
• Yes, my problem doesn't have an analytical solution. I am aware that my results depend on the model I implemented. I was curious whether there was a systematic way to discover the behavior of trajectories or not. Because In my project, I have four scenarios and each scenario have one-hundred repetition, finding pattern by looking at the plots is not easy or possible. So, I was looking for a way to automate it. According to your comment, I think it is not possible to do that. – Armin Dadras Jan 21 at 20:18
• Right, that's likely the case. Further, "describing the trajectories" doesn't sound like it could be formalized easily either, so I likely the best you can do is explain how the trajectories roughly behave on the data you experimented with and leave it at that. Perhaps even put differently, if there is no analytical solution, why would one be able to (formally) describe the trajectories? Or, if you can describe the trajectories, can you also find an analytical solution then? Why not? – Juho Jan 21 at 20:22