Skip to content

Peer review lab2 #4

@giogenna16

Description

@giogenna16

Hi,
Overall, I think that your code is clear and your algorithm works quite well; I like the explaination of the functions in the README file.
I think that working with 0 and 1 or True and False, associating these values with the meaning whether or not a tuple/list is considered, is more computationally light and memory-light than considering genomes as tuples of tuples.
It is interesting the fact that your mutation and your cross-over are not completely "random": you decided to mantain the parents and do not consider the offsprings if these are "worse" than the parents (instead of the classical operations in which you do not now if the offsprings are "better" or "worse" than the parents for the resolution of the problem). I think that is a good idea and this is confirmed by the results that are competitive compared to those seen in class. You could try, to further improve the solutions, to mantain the logic of these operations and give as input a population with genomes with the vast majority of lists/tuples not considered (set to 0, using the bitmap), because, as also discussed during lectures, in this problem, the relationship between the considered and not considered tuples is foundamental (problem already partially addressed by your mutation and cross-over).
I think that your fitness is good for the sorting of the gemomes that are solutions, because you choose the shoortest solutions first, but maybe the sorting of the genomes that are not solution could be improved (problem already partially addressed by your mutation and cross-over): you give the same weight to a genome that lacks only one number to be a solution and to a genome that lacks a lot of numbers to be a solution; I think that categorizing a genome that is near to be a solution and a genome that is very far from being a solution in the same way is not optimum. You could sort the genomes by how many numbers they are missing to be solutions and, for genomes with the same missing numbers, by length.
The choice of the parameters POPULATION and OFFSPRING could lead to very different results, but there is not an optimal way to choose them, except on the basis of the obtained results (trial and error); so I appreciate your logic to vary these parameters with respect to N.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions