Genetic algorithms are stochastic, meaning they use randomness (like mutation, crossover, and selection). Therefore:
- Running the same problem twice will usually give slightly different solutions
- This is expected behavior
- If you want reproducible results, you need to set the random seed before running the GA:
rng(1);
"gamultiobj" is for multi-objective optimization. It doesn’t give a single solution like LP does, because:
- There is no single "best" solution when you have multiple objectives (like minimize cost and maximize quality)
- Instead, it gives a set of Pareto optimal solutions so no solution in the set is better than another in all objectives and each solution represents a different trade-off.
Since you have multiple Pareto-optimal solutions, you can choose one based on your preference or apply decision-making techniques.
- Manual Selection: Choose a point based on which objective you prioritize more or pick the "knee point" (best trade-off) manually.
- Automatic Selection: If aim is to reduce it to a single objective, define a weighted sum:
For better understanding of genetic algorithms and "gamultiobj" refer to the following documentation:
- https://www.mathworks.com/discovery/genetic-algorithm.html
- https://www.mathworks.com/help/gads/gamultiobj-algorithm.html
Hope this helps!