Read Gurobi's .sol file format with JuMP

Is there a way to read with JuMP , a .sol file with as ones produced by Gurobi?

I would think yes with JuMP, since Gurobi (and CPLEX) are supported with JuMP:

Since those are both proprietary, then what I think you meant is can you use JuMP and only open source software for:

and I don’t really know. How complex/readable is this format? Is Gurobi’s .sol completely different, or somewhat or fully compatible with IBM’s CPLEX? Some other software might also be able to read it.

EDIT: It seems with free software, there’s something to read SOL (right format?), see:

I was shocked to see how expensive those solvers are and if you’re long for alternatives for that then I would first find software that can read the files or replace them in any language:

Hi @Jean_F, welcome to the forum :smile:

Is there a way to read with JuMP , a .sol file with as ones produced by Gurobi?

Nope.

A better question is: why do you want to do this?

1 Like

Thank you @odow,
That’s what i thought. Recently I submitted a request on Gurobi support. I would like share the link but it seems that I’m not allowed to do . So the topic on Gurobi support is :" Gurobi stucks even after the time limit ". I hope you can find it.

Finally, as I couldn’t get the result with JuMP, I used the Gurobi command line from the Windows terminal to perform the optimisation. This worked, so I produced the .sol file to save the solution. Now I want to ‘read’ the solution obtained and use it as a starting solution with JuMP. My aim is to be able to access the values of the solutions via a JuMP model because I need to post-process them and my post-processing code is made for a JuMP solved model from which I can access the variables values.

For the issue I raised about Gurobi, perhaps that could be a topic in its own right. But if you have any idea why this is happening, I’d love to hear your opinion.

The .sol file seems simple enough. You should be able to parse it manually?

For the issue I raised about Gurobi, perhaps that could be a topic in its own right. But if you have any idea why this is happening, I’d love to hear your opinion.

I don’t understand what the problem is. You set a time limit and Gurobi didn’t terminate? Didn’t terminate with a feasible solution?

Do you have a reproducible example?

Yes I finally did it like that :

# sol file loading
a= readlines("model1_solution.sol")
b=zeros(Float64,length(a)-1) 
i=1
for txt in a[2:end] # the first line of .sol is about the objective value, we don't need it
    b[i]=parse(Float64,split(txt, " ")[2])
    i+=1
end

# set start values for the model 1
x = all_variables(model1)
set_start_value.(x, b)

Maybe this can be usefull to someone else.

I don’t have a reproducible example yet . I can share you the .mps file, but i’m not sure that’s enough to reproduce the issue. So, in order not to waste your time, i will try to clarify the example ( and the issue) and post it on this forum.