anyoptimization / pymoo

NSGA2, NSGA3, R-NSGA3, MOEAD, Genetic Algorithms (GA), Differential Evolution (DE), CMAES, PSO
https://pymoo.org
Apache License 2.0
2.28k stars 390 forks source link

Concerns Regarding Initialization of Binary Variables and Support for Custom Initial Population in PyMoo's NSGA2 #580

Closed haowei2020 closed 7 months ago

haowei2020 commented 7 months ago

I am currently working on a binary optimization problem where the decision variables are restricted to the values of 0 or 1. I have observed that when initializing the population with the NSGA2 algorithm provided by the PyMoo framework, the variables are initialized as floating-point numbers. I am curious whether this default initialization could potentially impact the optimization process and the quality of the solutions found.

Additionally, I would like to inquire if the PyMoo framework supports the input of a custom initial population where the decision variables are already set as binary values (0 or 1)? If so, could you please provide guidance on how this can be implemented?

blankjul commented 7 months ago

You can write your own sampling method as well and pass it to your algorithm: https://pymoo.org/customization/custom.html

Support for a custom initial population already exists: https://pymoo.org/customization/initialization.html

I hope this helps (please reopen if necessary).