Skip to content

Write Solution to a .SOL File #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stumarcus314 opened this issue Feb 25, 2025 · 3 comments
Open

Write Solution to a .SOL File #302

stumarcus314 opened this issue Feb 25, 2025 · 3 comments

Comments

@stumarcus314
Copy link

stumarcus314 commented Feb 25, 2025

Is it possible to have SCIP.jl write the solution to a .SOL file by setting an optimizer attribute?

m = JuMP.Model()
[...]
    JuMP.set_optimizer(m, SCIP.Optimizer)
    JuMP.set_optimizer_attribute(m, "SolutionFile", "result.sol")
    JuMP.optimize!(m)
@matbesancon
Copy link
Member

matbesancon commented Feb 25, 2025 via email

@stumarcus314
Copy link
Author

stumarcus314 commented Feb 26, 2025

Can you provide an example using JuMP how to call SCIPprintBestSol on the SCIP.Optimizer?

@matbesancon
Copy link
Member

m = Model(SCIP.Optimizer)
# build problem
optimize!(m)
open("mysol.sol", "w") do f
           SCIP.LibSCIP.SCIPprintBestSol(JuMP.backend(m).optimizer.model, Libc.FILE(f), true)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants