ampl / mp

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

HiGHS: Error on second solve #208

Closed gomfy closed 1 year ago

gomfy commented 1 year ago

Description

When switching to HiGHS and resolving, or attempting to solve a second time with HiGHS, an already solved problem we get an error.

Details

When attempting to solve the problem below:

# Define the decision variables
var mulled_wine >= 0;
var hot_tea >= 0;

# Define the parameter(s)
param fee = 2;

# Define the objective function
maximize profit: 2*mulled_wine + 1.5*hot_tea - fee;

# Define the constraints
subject to spice_constraint: 2*mulled_wine <= 12;
subject to tea_bag_constraint: hot_tea <= 8;
subject to sugar_constraint: 4*mulled_wine + 2*hot_tea <= 30;
subject to wine_constraint: 2*mulled_wine <= 15;

In the following way:

ampl: model mulled_wine.mod 
ampl: option solver "highs";
ampl: solve;                
HiGHS 1.5.1: optimal solution; objective 17
1 simplex iterations
0 barrier iterations
ampl: solve;                
HiGHS 1.5.1: error running highs:
    termination code 139; core file written
<BREAK>
ampl: 

We get termination code 139.

mapgccv commented 1 year ago

I think we should add repeated solves to the end2end test bench.

glebbelov commented 1 year ago

@mapgccv The tests already had examples with preset bases. However HiGHS did not run them due to missing ModelTags.sstatus. I added the tag and added the above example to the tests.

@gomfy Fixed, to appear in the next release