Closed fdabrandao closed 2 years ago
Quick fix:
option pl_linearize 0;
This sends the actual PL function, without linearizing it. The model Gurobi receives can be exported by
option gurobi_options 'writeprob=sos_ref_pl.lp';
Just allowed equal SOS weights in x-gurobi, Gurobi 9.5 seems to accept them. A warning is printed when outlev=1.
It's weird AMPL linearizes PL and produces equal weights. In this example this is ok because the 2 slopes are both horizontal. However both gurobi and x-gurobi support PL natively (option pl_linearize 0;
) and this seems more reliable. More so, because the old gurobi driver interprets the PL linearization as SOS1, while according to docu they are SOS2.
The following model results in the error below with
x-gurobi
, but works withgurobi
:$ ampl test-x-gurobi.run Gurobi 9.5.0: Error: In SOS group 22, repeated weight 0 Error at _cmdno 3 executing "solve" command (file test.run, line 13, offset 234): can't open /var/folders/lc/kmnj4hgd7_qgjft0vlhjj0b40000gn/T/at5580.sol $ ampl test-gurobi.run gurobi (Darwin x86_64), licchk(20131021), ASL(20211109) Gurobi 9.5.0: optimal solution; objective 16.35361951 plus 1 simplex iteration for intbasis