# Read Gurobi's .sol file format with JuMP

**URL:** <https://discourse.julialang.org/t/read-gurobis-sol-file-format-with-jump/122387>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, gurobi\
**Created:** [November 7, 2024, 5:57pm UTC](https://discourse.julialang.org/t/read-gurobis-sol-file-format-with-jump/122387 "2024-11-07T17:57:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 7, 2024, 6:33pm UTC](https://discourse.julialang.org/t/read-gurobis-sol-file-format-with-jump/122387/2 "2024-11-07T18:33:17Z")

</div>

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

> **[Installation Guide · JuMP](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers)**
>
> Documentation for JuMP.

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

> **[SOL file format: solution files](https://www.ibm.com/docs/en/icos/20.1.0?topic=cplex-sol-file-format-solution-files)**
>
> The SOL file format supports solution files.

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.

> [@JuMP: save SOL file for MILP](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101/4):
>
> Gurobi’s .sol file is not the same as IBM’s: But sure, there are probably solver-specific ways of writing a solution file, but none that are solver-independent. You’re better off writing something like this: import JSON solution = Dict(name(x) =\> value(x) for x in all\_variables(model)) write("solution.json", JSON.json(solution))

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

> <https://github.com/jump-dev/MathOptInterface.jl/blob/f6f8a09cedb3d8b2e10e18a4ff6e2440ec6954cb/src/FileFormats/NL/sol.jl#L284-L284>

> <https://github.com/jump-dev/AmplNLWriter.jl/commit/1bcb89cbf966ed6c3585cb962ea0776b689e6e4c>

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:

> <https://or.stackexchange.com/questions/11146/non-proprietary-python-friendly-alternatives-to-cplex-and-gurobi>

---

_[View the full topic](https://discourse.julialang.org/t/read-gurobis-sol-file-format-with-jump/122387)._
