Skip to content
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

SCIP.jl with exact-rational branch #288

Open
melkael opened this issue Apr 19, 2024 · 5 comments
Open

SCIP.jl with exact-rational branch #288

melkael opened this issue Apr 19, 2024 · 5 comments

Comments

@melkael
Copy link

melkael commented Apr 19, 2024

Hello

I am trying to use the exact-rational branch of SCIP with this package. I managed to compile if fine to pass the install dir to SCIP.jl in my ENV[“SCIPOPTDIR”].

As indicated on the Readme of the branch (see https://github.com/scipopt/scip/tree/exact-rational), it is required to set the parameter exact/exact_enabled.

However, when I try to set the parameter with set_attribute(model, "exact/exact_enabled", "TRUE")

I obtain:

ERROR: LoadError: Unrecognized parameter: exact/exact_enabled
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] set_parameter(scipd::SCIP.SCIPData, name::String, value::String)
    @ SCIP ~/.julia/packages/SCIP/S9mBb/src/scip_data.jl:123
  [3] set
    @ ~/.julia/packages/SCIP/S9mBb/src/MOI_wrapper.jl:179 [inlined]
  [4] set
    @ ~/.julia/packages/MathOptInterface/gBojA/src/Bridges/bridge_optimizer.jl:955 [inlined]
  [5] set(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, attr::MathOptInterface.RawOptimizerAttribute, value::String)
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/gBojA/src/Utilities/cachingoptimizer.jl:1059
  [6] set(m::Model, attr::MathOptInterface.RawOptimizerAttribute, value::String)
    @ JuMP ~/.julia/packages/JuMP/as6Ji/src/optimizer_interface.jl:794
  [7] set_attribute
    @ ~/.julia/packages/JuMP/as6Ji/src/optimizer_interface.jl:1023 [inlined]
  [8] set_attribute
    @ ~/.julia/packages/JuMP/as6Ji/src/optimizer_interface.jl:1032 [inlined]
  [9] iabtree_throughput(G::MetaDiGraph{Int64, Float64}, json_comm::Vector{Any}, gap::Float64, continuous_ue_links::Bool, maxtime::Float64, scaling_caps::Int64)
    @ Main /home/IABEnergySavingJournal/solver/model.jl:70
 [10] macro expansion
    @ ./timing.jl:279 [inlined]
 [11] main(method::String, data::Dict{String, Any}, result_name::String)
    @ Main /home/IABEnergySavingJournal/solver/test_json.jl:75
 [12] top-level scope
    @ /home/IABEnergySavingJournal/solver/test_json.jl:107
in expression starting at /home/IABEnergySavingJournal/solver/test_json.jl:107

I also tried set_attribute(model, "exact/exact_enabled", true) and set_attribute(model, "exact/exact_enabled", 1) with the same outcome. I suspect I need to implement something regarding this parameter within SCIP.jl but am unsure what to change.

@matbesancon
Copy link
Member

Hi, are you sure SCIP.jl is correctly linked to your SCIP installation? You can test that with:

@eval SCIP.libscip

which points to the path where the SCIP shared library is

@leoneifler
Copy link

leoneifler commented Apr 20, 2024

Hi, sorry that is a typo in the documentation. The parameter ist 'exact/enabled'. Will fix this.

@melkael
Copy link
Author

melkael commented Apr 23, 2024

Thank you for your help, it now works with "exact/enabled". However, it seems like Julia initializes the problem creation when SCIP.Optimizer() is called, which prevents me from setting the exact mode. I get the following error:

[set.c:767] ERROR: Exact solving mode can only be enabled/disabled before reading/creating a problem.

@leoneifler
Copy link

Hmm, that is a bit of an issue. I don´t know what can be done on the Julia side of things. The reason this error is necessary is that reading a problem in inexact mode already might not give you exactly the problem you want to solve (inaccuracies when converting to binary, setting small values to 0, etc.)

As a hacky fix, you could just set the parameters default value to true in set.c (SCIP_DEFAULT_EXACT_ENABLED)

@melkael
Copy link
Author

melkael commented Apr 24, 2024

Sounds like a good solution, I will try that, thank you!

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

3 participants