• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

scipopt/SCIP.jl: Julia interface to SCIP solver

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

scipopt/SCIP.jl

开源软件地址:

https://github.com/scipopt/SCIP.jl

开源编程语言:

Julia 100.0%

开源软件介绍:

SCIP.jl

Julia interface to the SCIP solver.

Build Status codecov

See NEWS.md for changes in each (recent) release.

Update (April 2022)

Due to breaking changes, only SCIP 8 is supported by the wrapper on version 0.11 onwards.

Update (August 2020)

On MacOS and Linux, it is no longer required to install the SCIP binaries using this package. There now exists a BinaryBuilder.jl generated package SCIP_jll.jl and SCIP_PaPILO_jll.jl which is installed automatically as a dependency.

On Windows, the separate installation of SCIP is still mandatory, otherwise, you can use this default installation:

pkg> add SCIP

If you use an older Julia version, Windows or want a custom SCIP installation, see below for the build steps.

Custom SCIP installations.

If you prefer to link to your own installation of SCIP, please set the environment variable SCIPOPTDIR to point to the installation path. That is, either $SCIPOPTDIR/lib/libscip.so, $SCIPOPTDIR/lib/libscip.dylib or $SCIPOPTDIR/bin/scip.dll should exist, depending on your operating system.

When this is set before you install this package, it should be recognized automatically. Afterwards, you can trigger the build with

pkg> build SCIP

Setting Parameters

There are two ways of setting the parameters (all are supported). First, using MOI.set:

using MOI
using SCIP

optimizer = SCIP.Optimizer()
MOI.set(optimizer, MOI.RawOptimizerAttribute("display/verblevel"), 0)
MOI.set(optimizer, MOI.RawOptimizerAttribute("limits/gap"), 0.05)

Second, as keyword arguments to the constructor. But here, the slashes (/) need to be replaced by underscores (_) in order to end up with a valid Julia identifier. This should not lead to ambiguities as none of the official SCIP parameters contain any underscores (yet).

using MOI
using SCIP

optimizer = SCIP.Optimizer(display_verblevel=0, limits_gap=0.05)

Note that in both cases, the correct value type must be used (here, Int64 and Float64).

Design Considerations

Wrapper of Public API: All of SCIP's public API methods are wrapped and available within the SCIP package. This includes the scip_*.h and pub_*.h headers that are collected in scip.h, as well as all default constraint handlers (cons_*.h.) But the wrapped functions do not transform any data structures and work on the raw pointers (e.g. SCIP* in C, Ptr{SCIP_} in Julia). Convenience wrapper functions based on Julia types are added as needed.

Memory Management: Programming with SCIP requires dealing with variable and constraints objects that use reference counting for memory management. The SCIP.Optimizer wrapper type collects lists of SCIP_VAR* and SCIP_CONS* under the hood, and releases all reference when it is garbage collected itself (via finalize). When adding a variable (add_variable) or a constraint (add_linear_constraint), an integer index is returned. This index can be used to retrieve the SCIP_VAR* or SCIP_CONS* pointer via get_var and get_cons respectively.

Supported Features for MathOptInterface: We aim at exposing many of SCIP's features through MathOptInterface. However, the focus is on keeping the wrapper simple and avoiding duplicate storage of model data.

As a consequence, we do not currently support some features such as retrieving constraints by name (VariableIndex-set constraints are not stored as SCIP constraints explicitly).

Support for more constraint types (quadratic, SOS1/2, nonlinear expression) is implemented, but SCIP itself only supports affine objective functions, so we will stick with that. More general objective functions could be implented via a bridge.

Supported operators in nonlinear expressions are as follows:

  • unary: -, sqrt, exp, log, abs, cos, sin
  • binary: -, /, ^
  • n-ary: +, *



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap