Goal Program solutions

74 views
Skip to first unread message

vaishnavi guntupalli

unread,
Nov 27, 2022, 7:23:52 PM11/27/22
to am...@googlegroups.com
Hey team,

I am solving a goal programming problem with 4 goals, using AMPL, and I obtained a solution that satisfies all the goals.

Q1. I am aware that this problem has multiple optimal solutions. Is it possible to ask AMPL to print all the possible solutions?

Q2. In spite of reordering the goals, I obtain the same solution every time (for all 16 permutations). Is it always the case that if we have a solution that satisfies one ordering of the goals, we will always find the same solution even after reordering? Does this problem belong a special category of problems having thai property?

Thank you in advance.

AMPL Google Group

unread,
Nov 28, 2022, 6:46:05 PM11/28/22
to AMPL Modeling Language
Q1. If you can use Gurobi or CPLEX, and if all of your variables are integer, then you can use special options of those solvers to try to search for all solutions. Write back for more information. In general, however, it is not possible to get all solutions from a solver. (AMPL relies on solvers to compute solutions, so you can't just ask AMPL to print all the possible solutions.)

Q2. In general, the ordering of the goals will make a difference. So there are two possibilities:
  • Your model and data are a very special case where all of the orderings lead to the same solution.
  • There is an error in your implementation of goal programming in AMPL.
There is no easy way to know which case you are in; it requires studying your model and data, your solutions, and your implementation. If you can post your files, it may be possible to give some advice for getting started on such a study.


--
Robert Fourer
am...@googlegroups.com
{#HS:2080190704-113000#}

vaishnavi guntupalli

unread,
Nov 29, 2022, 10:23:28 AM11/29/22
to am...@googlegroups.com
Thank you so much for your response. 

Yes, I suspect I might be doing something wrong. Attached are the files for the problem statement and my code. 
It would be great if you can take a look and let me know if you get a different solution.


Have a great day!

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-2080190704-6189051318-1669679160-621046076%40helpscout.net.
Q6_GoalProgramming.docx
Q6_GoalProgramming.mod

AMPL Google Group

unread,
Nov 30, 2022, 1:38:36 PM11/30/22
to AMPL Modeling Language
You can define four different objectives in your model, like this:

minimize Z1 : S1N;
minimize Z2 : S2P;
minimize Z3 : S3P;
minimize Z4 : S4P;

Then you can give AMPL the following commands to optimize each objective, and look at the solution:

solve Z1; display _varname, _var;
solve Z2; display _varname, _var;
solve Z3; display _varname, _var;
solve Z4; display _varname, _var;

You will see that the minimum value is always 0, but in the solutions, some of the variables may take different values.


--
Robert Fourer
am...@googlegroups.com
{#HS:2080190704-113000#}
On Tue, Nov 29, 2022 at 3:23 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Thank you so much for your response.

Yes, I suspect I might be doing something wrong. Attached are the files for the problem statement and my code.
It would be great if you can take a look and let me know if you get a different solution.

Have a great day!

On Mon, Nov 28, 2022 at 11:45 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Q1. If you can use Gurobi or CPLEX, and if all of your variables are integer, then you can use special options of those solvers to try to search for all solutions. Write back for more information. In general, however, it is not possible to get all solutions from a solver. (AMPL relies on solvers to compute solutions, so you can't just ask AMPL to print all the possible solutions.)

Q2. In general, the ordering of the goals will make a difference. So there are two possibilities:
  • Your model and data are a very special case where all of the orderings lead to the same solution.
  • There is an error in your implementation of goal programming in AMPL.
There is no easy way to know which case you are in; it requires studying your model and data, your solutions, and your implementation. If you can post your files, it may be possible to give some advice for getting started on such a study.


--
Robert Fourer
am...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages