ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model

ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model.

I got this error when solving an MILP model using HiGHS. Do anyone know what it means? Thank you!

It means you did not check is_solved_and_feasible(model) to see if HiGHS found a feasible solution to your model.

See Solutions · JuMP

You must always check the status of a solver before querying a solution.

1 Like

Thank you @odow . The fact is the model is infeasible. I’ll look for the reason.

1 Like