# JuMP: save SOL file for MILP

**URL:** <https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [July 3, 2023, 1:36am UTC](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101 "2023-07-03T01:36:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 3, 2023, 2:52am UTC](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101/4 "2023-07-03T02:52:11Z")

</div>

Gurobi’s `.sol` file is not the same as IBM’s:

> **[SOL format - Gurobi Optimization](https://www.gurobi.com/documentation/10.0/refman/sol_format.html)**
>
> SOL format

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:

```julia
import JSON
solution = Dict(name(x) => value(x) for x in all_variables(model))
write("solution.json", JSON.json(solution))

```

---

_[View the full topic](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101)._
