moDal7 / Computational-Intelligence

Repo for the course of Computational intelligence held at Politecnico di Torino by professors Squillero and Calabrese.
0 stars 0 forks source link

Review on lab2 (set covering - evolutionary algorithms) #2

Open shadow036 opened 1 year ago

shadow036 commented 1 year ago

Hello I'm gonna review the second lab and explain what I have appreciated and what I think you could have done differently.

  1. 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.
  2. 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.
  3. 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).
  4. 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.
  5. 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).
  6. 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.

moDal7 commented 1 year ago

Hello! Thanks a lot for the suggestions, I'll work on them as they are all extremely relevant.

shadow036 commented 1 year ago

You're welcome :)