Giter Club home page Giter Club logo

russcip's Introduction

russcip

tests coverage

A safe Rust interface for SCIP. This crate also exposes access to the SCIP's C-API through the ffi module. The project is currently actively developed, issues/pull-requests are very welcome.

Installation

By running

cargo add russcip --features bundled

or to get the most recent version, add the following to your Cargo.toml

[dependencies]
russcip = { git = "https://github.com/scipopt/russcip", features = ["bundled"] }

The bundled feature will download a precompiled SCIP as part of the build process. This is the easiest to get started with russcip, if you want to use a custom SCIP installation check the section below.

Custom SCIP installation

If the bundled feature is not enabled, russcip will look for a scip installation in the current conda environment, to install SCIP using conda run the following command

conda install --channel conda-forge scip

Alternatively, you can specify the installation directory through the SCIPOPTDIR environment variable.

russcip is tested against SCIP 9.0.0 but it might work for other versions depending on which functionality you use.

Examples

An example on how to model and solve an integer program can be found in the examples directory. To run the example, you can use the following command

cargo run --example create_and_solve

The raw feature

You can enable this feature by specifying the feature in your Cargo.toml

[dependencies]
russcip = { features = ["raw"] }

This enables access to the scip_ptr unsafe function in the Model struct, which gives you access to the underlying SCIP raw pointer. This is can be used in combination with the ffi module to call SCIP functions that are not wrapped yet in the safe interface.

Implementing Custom Plugins

Some of SCIP's plugins are imported to the rust interface as traits. Currently the implemented plugins are:

Name File Docs
Branching rule branchrule.rs docs
Variable Pricer pricer.rs docs
Event Handler eventhdlr.rs docs
Primal Heuristic heuristic.rs docs

To add a custom plugin to a SCIP Model instance, you should implement its trait and call the corresponding include_{PLUGIN_NAME} method. For examples on implementing the specific plugin trait you can check the tests in the corresponding files.

Contibuting

Thinking about contributing to russcip? First of all thank you! You can check our issues page, there's a bunch of good_first_issues, or you can check our contribution guide. If you'd like to contribute and unsure what to do, or thinking about a big feature and want to discuss if it makes sense and what is the best way to do it? you could open a new issue/discussion or send me a quick email @mmghannam.

About SCIP

SCIP is currently one of the fastest non-commercial solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP). It is also a framework for constraint integer programming and branch-cut-and-price. It allows for total control of the solution process and the access of detailed information down to the guts of the solver.

russcip's People

Contributors

mmghannam avatar karelpeeters avatar veladus avatar mohammadfawaz avatar codingtil avatar yonch avatar lovasoa avatar rinde avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.