Note
Go to the end to download the full example code
Multi-objective Fonseca-Fleming example with the mNBI algorithm¶
In this example, the modified Normal Boundary Intersection algorithm (mNBI) is used to
solve the FonsecaFleming
optimization problem [FF95]:
We also show how the Pareto front can be refined.
from __future__ import annotations
from gemseo import configure_logger
from gemseo import execute_algo
from gemseo import execute_post
from gemseo.problems.optimization.fonseca_fleming import FonsecaFleming
configure_logger()
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/checkouts/develop/doc_src/_examples/multi_objective/plot_mnbi_fonseca.py", line 46, in <module>
from gemseo.problems.optimization.fonseca_fleming import FonsecaFleming
ModuleNotFoundError: No module named 'gemseo.problems.optimization.fonseca_fleming'
Solve the Fonseca-Fleming optimization problem¶
The 3 sub-optimization problems of mNBI are solved with SLSQP, a gradient-based optimization algorithm from the NLOPT library, with a maximum of 100 iterations. The analytic gradients are provided.
opt_problem = FonsecaFleming()
result = execute_algo(
opt_problem,
"MNBI",
max_iter=1000,
sub_optim_max_iter=100,
n_sub_optim=3,
sub_optim_algo="NLOPT_SLSQP",
)
Display the Pareto front¶
GEMSEO detects the Pareto optimal points and the dominated ones. The Fonseca-Fleming problem is interesting because its Pareto front is not convex. The mNBI algorithm successfully computes it.
execute_post(opt_problem, "ParetoFront", save=False, show=True)
Solve the Fonseca-Fleming optimization problem more finely¶
The Pareto front is then refined with 10 sub-optimizations instead of 3.
opt_problem = FonsecaFleming()
result = execute_algo(
opt_problem,
"MNBI",
max_iter=1000,
sub_optim_max_iter=100,
n_sub_optim=10,
sub_optim_algo="NLOPT_SLSQP",
)
Display the Pareto front¶
We can clearly see the effect of the refinement.
execute_post(opt_problem, "ParetoFront", save=False, show=True)
Total running time of the script: (0 minutes 0.002 seconds)