ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
229 stars 42 forks source link

Limited result message when there is no objective function #194

Closed 4er4er4er closed 1 year ago

4er4er4er commented 1 year ago

When gurobi is given a model with no objective, it reports optimal solution but says nothing about the objective value:

ampl: model diet.mod;
ampl: data diet.dat;
ampl: drop Total_Cost;
ampl: option solver gurobi;
ampl: solve;
Gurobi 10.0.0: optimal solution
3 simplex iterations
ampl: 

Perhaps the user should be alerted that there was no objective, and the solver just looked for a feasible point. The amplasl output sort of does that:

ampl: model diet.mod;
ampl: data diet.dat;
ampl: drop Total_Cost;
ampl: option solver gurobiasl;
ampl: solve;
Gurobi 10.0.0: optimal solution; objective 0
3 simplex iterations
Objective = find a feasible point.
ampl: 

(Also when the solution is found without having to iterate at all, either Gurobi version neglects to report 0 simplex iterations.)

These observations might apply to other MP-based solvers, but I haven't tested them.

glebbelov commented 1 year ago

'Find a feasible point' is printed by AMPL based on the objno in .sol, which is currently wrong in MP, unless solved with objno=0.

There is a lack of acknowledgement of multiobjective solving, see AMPL's #92.