Hello,

I want to use AMPL API to access functions in python and to solve a multi objective linear program. I specifically want to use NSGAII algorithm to solve the problem. I know NSGAII is available under pymoo in python.

My first question is if I can read the model and data from AMPL using API then solve it by NSGAII in python.

Thanks,

Azadeh

Hi Azadeh,

AMPL does not support NSGA-II implementations to solve multi-objective problems.

As an alternative, you could experiment combining objectives with weights, so when you solve combined (single-objective) problems, you get optimal solutions. If you want to generate Pareto’s frontiers you could do that, and see if it gives acceptable solutions.

You can use AMPL’s “objective” command to specify which of your objective functions is to be optimized (available solvers can only return a solution that optimizes one chosen objective). This could be helpful in case you want to solve sequential problems but changing between objectives.

If it is hard to find a frontier only by doing that, AMPL might help you generating an initial population for NSGA-II.

Here there is an example of an Efficient Frontier in Colab. “targetReturn” parameter increases on each iteration, giving different bounds for “portfolio_return” objective, while minimizing “portfolio_variance”, so each “solve” gives a different solution.

https://colab.ampl.com/#efficient-frontier-with-google-sheets