Hello I'm gonna review the second lab and explain what I have appreciated and what I think you could have done differently.
First of all I think you did a great job by exploring different strategies and by including plot related to the results of your code.
Unfortunately the missing/wrong strategy is also in my opinion the one which is the most interesting since it offers more possibility of genome exchange.
I start with the fact that there is a recurring line of code which is actually useless and you probably forgot to delete it when you finished the lab: I'm talking about the line shown here: \
random_list = random.choice(list(all_lists)) \
This is of course not a big deal.
In my opinion the "drop" mechanics is too extreme in this cases, you may be interested in removing a sublist at a time before mutating again (either another deletion, a switch or an addition).
Another recurring line of code is this one or some derivations: \
while not goal_test(N, new_solution): \
This is used both to initialize an initial solution and in order to mutate the offspring.
In the first situation, I think it's better to start from a simple case (i.e. a solution containing only 1 sublist) instead of generating a feasible solution from the start and then optimize it. \
Regarding the second situation, personally in my solutions I tend to use the concept of "generations of individuals" and I also tend to allow one single mutation per individual in a single generation.
You are instead trying to generate a solution in each generation by applying a mutation multiple times per step and I feel like this isn't the correct way.
This is of course a personal preference.
Another thing that I noticed is the use of tuples in order to generate the all_lists container and I'm not sure why it is useful to use tuples (but maybe they are more efficient and so it is OK).
Even if you explained that the last algorithm is not very good, I'd like to point out a problem that I think it could be useful for the resolution of the last evolutionary strategy. \
In this case you are not actually generating offspring from some parents (which in this strategy you could use since we have a population size > 1) but you are simply mixing them: I would call this another type of mutation instead of a crossover since after it we don't have additional individual(s) but simply a variation of the chosen parents.
You can say that in this last point you tried to use two different mutation techniques: the standard 'tweak' one that you used also in other strategies and this 'mixing' one that in fact doesn't produce new individuals since the original parents are then discarded. \
Even though I've pointed out a lot of stuff, most of them are actually dictated by personal preferences in the representation and visualization of the problem, so the somewhat "serious" mistakes (in my opinion) are not many and other than that the fact that you explored different solutions and the use of plots were a nice addition.
Hello I'm gonna review the second lab and explain what I have appreciated and what I think you could have done differently.
random_list = random.choice(list(all_lists))
\ This is of course not a big deal.while not goal_test(N, new_solution):
\ This is used both to initialize an initial solution and in order to mutate the offspring. In the first situation, I think it's better to start from a simple case (i.e. a solution containing only 1 sublist) instead of generating a feasible solution from the start and then optimize it. \ Regarding the second situation, personally in my solutions I tend to use the concept of "generations of individuals" and I also tend to allow one single mutation per individual in a single generation. You are instead trying to generate a solution in each generation by applying a mutation multiple times per step and I feel like this isn't the correct way. This is of course a personal preference.all_lists
container and I'm not sure why it is useful to use tuples (but maybe they are more efficient and so it is OK).Even though I've pointed out a lot of stuff, most of them are actually dictated by personal preferences in the representation and visualization of the problem, so the somewhat "serious" mistakes (in my opinion) are not many and other than that the fact that you explored different solutions and the use of plots were a nice addition.