Go Bindings for SCIP
2
stars
59
commits
Go
primary language
Sep 14, 2026
updated
Go bindings for SCIP, one of the fastest non-commercial solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP). scipgo is a port of the Rust crate russcip and follows its API closely, so the two are easy to move between.
model := scip.DefaultModel().HideOutput().Maximize()
x := scip.NewVar().Name("x").Int().Obj(3).AddTo(model)
y := scip.NewVar().Name("y").Int().Obj(4).AddTo(model)
model.Add(
scip.NewCons().Coef(x, 2).Coef(y, 1).Le(100),
scip.NewCons().Coef(x, 1).Coef(y, 2).Le(80),
)
solved := model.Solve()
sol, _ := solved.BestSol()
fmt.Println(solved.Status(), sol.ObjVal(), sol.Val(x), sol.Val(y))
// Optimal 200 40 20
Solve instead of crashing the process.context.Context. SCIP's log
routes into an io.Writer, a *slog.Logger or a callback. Memory is
released explicitly with Free or by a finalizer.SolveConcurrent, and end-to-end rational arithmetic through
EnableExactSolving with *big.Rat results.scipgo links against an installed SCIP 10 through cgo. Nothing is bundled.
# macOS
brew install scip
# Ubuntu 22.04 (packages for other distributions on the SCIP releases page)
wget https://github.com/scipopt/scip/releases/download/v10.0.2/scipoptsuite_10.0.2-1+jammy_amd64.deb
sudo apt-get install -y ./scipoptsuite_10.0.2-1+jammy_amd64.deb
go get github.com/egoisutolabs/scipgo/scip
Go 1.25 or newer and a C compiler are required. SCIP in a custom location, Docker images and build errors are covered in the installation guide.
The documentation walks through the binding from the first model to branch-and-price; the API reference documents every method.
| Guide | Covers |
|---|---|
| Getting started | A first model, builders, reading a file, controlling the solve |
| Modeling | Variables, every constraint kind, nonlinear expressions, file I/O |
| Solving | Statuses, limits, stopping a solve, statistics, re-solving, concurrent and exact modes |
| Solutions | Reading solutions, MIP starts, partial solutions |
| Parameters | The parameter API and the parameters worth knowing |
| Logging | Routing SCIP's log and error output |
| Errors | Try and panicking forms, error types, liveness |
| Model lifecycle | Stages, handles, memory, goroutines |
| Plugins | Writing branch rules, heuristics, separators, pricers, constraint handlers, event handlers and node selectors |
| Coming from russcip | The mapping between the Rust API and this one |
Eleven complete programs live under examples/,
each solving a real problem and checking its answer: a first MIP, a
knapsack, custom branching, node selection, event handling, a rounding
heuristic, a clique separator, TSP with subtour elimination, cutting stock
and bin packing by branch-and-price, and a concurrent solve. Run one from
its directory with go run ..
| Path | Contents |
|---|---|
scip/ | The library, a single Go package. cgo glue, the Model API, builders and plugin callbacks live together because cgo's exported trampolines must sit in the package that owns the C helpers |
examples/ | Example programs |
docs/ | The guides |
data/test/ | Small LP and MPS instances used by the tests and examples |
scipgo is pre-1.0. The API is stable in shape, and renames ship with deprecated aliases that stay until the next major version; see the changelog. It is tested on macOS and Linux against SCIP 10 on every push.
Bug reports, questions and pull requests are welcome. The contributing guide covers the development setup, the test suite and the conventions the code follows.
scipgo is licensed under the MIT License, Copyright (c) 2026 Egoisuto Labs.
It is a port of russcip by Mohammed
Ghannam and contributors, licensed under the Apache License 2.0. The
derived parts (API design, tests, examples, data/test) keep that
license; see LICENSE-russcip and NOTICE,
and keep both files with any redistribution. SCIP
itself is Apache-2.0 and is linked, not bundled.
59 commits
Go
81.7%
Mathematical Programming System
15.8%
C
2.5%
Go Bindings for SCIP
2
stars
59
commits
Go
primary language
Sep 14, 2026
updated
Go bindings for SCIP, one of the fastest non-commercial solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP). scipgo is a port of the Rust crate russcip and follows its API closely, so the two are easy to move between.
model := scip.DefaultModel().HideOutput().Maximize()
x := scip.NewVar().Name("x").Int().Obj(3).AddTo(model)
y := scip.NewVar().Name("y").Int().Obj(4).AddTo(model)
model.Add(
scip.NewCons().Coef(x, 2).Coef(y, 1).Le(100),
scip.NewCons().Coef(x, 1).Coef(y, 2).Le(80),
)
solved := model.Solve()
sol, _ := solved.BestSol()
fmt.Println(solved.Status(), sol.ObjVal(), sol.Val(x), sol.Val(y))
// Optimal 200 40 20
Solve instead of crashing the process.context.Context. SCIP's log
routes into an io.Writer, a *slog.Logger or a callback. Memory is
released explicitly with Free or by a finalizer.SolveConcurrent, and end-to-end rational arithmetic through
EnableExactSolving with *big.Rat results.scipgo links against an installed SCIP 10 through cgo. Nothing is bundled.
# macOS
brew install scip
# Ubuntu 22.04 (packages for other distributions on the SCIP releases page)
wget https://github.com/scipopt/scip/releases/download/v10.0.2/scipoptsuite_10.0.2-1+jammy_amd64.deb
sudo apt-get install -y ./scipoptsuite_10.0.2-1+jammy_amd64.deb
go get github.com/egoisutolabs/scipgo/scip
Go 1.25 or newer and a C compiler are required. SCIP in a custom location, Docker images and build errors are covered in the installation guide.
The documentation walks through the binding from the first model to branch-and-price; the API reference documents every method.
| Guide | Covers |
|---|---|
| Getting started | A first model, builders, reading a file, controlling the solve |
| Modeling | Variables, every constraint kind, nonlinear expressions, file I/O |
| Solving | Statuses, limits, stopping a solve, statistics, re-solving, concurrent and exact modes |
| Solutions | Reading solutions, MIP starts, partial solutions |
| Parameters | The parameter API and the parameters worth knowing |
| Logging | Routing SCIP's log and error output |
| Errors | Try and panicking forms, error types, liveness |
| Model lifecycle | Stages, handles, memory, goroutines |
| Plugins | Writing branch rules, heuristics, separators, pricers, constraint handlers, event handlers and node selectors |
| Coming from russcip | The mapping between the Rust API and this one |
Eleven complete programs live under examples/,
each solving a real problem and checking its answer: a first MIP, a
knapsack, custom branching, node selection, event handling, a rounding
heuristic, a clique separator, TSP with subtour elimination, cutting stock
and bin packing by branch-and-price, and a concurrent solve. Run one from
its directory with go run ..
| Path | Contents |
|---|---|
scip/ | The library, a single Go package. cgo glue, the Model API, builders and plugin callbacks live together because cgo's exported trampolines must sit in the package that owns the C helpers |
examples/ | Example programs |
docs/ | The guides |
data/test/ | Small LP and MPS instances used by the tests and examples |
scipgo is pre-1.0. The API is stable in shape, and renames ship with deprecated aliases that stay until the next major version; see the changelog. It is tested on macOS and Linux against SCIP 10 on every push.
Bug reports, questions and pull requests are welcome. The contributing guide covers the development setup, the test suite and the conventions the code follows.
scipgo is licensed under the MIT License, Copyright (c) 2026 Egoisuto Labs.
It is a port of russcip by Mohammed
Ghannam and contributors, licensed under the Apache License 2.0. The
derived parts (API design, tests, examples, data/test) keep that
license; see LICENSE-russcip and NOTICE,
and keep both files with any redistribution. SCIP
itself is Apache-2.0 and is linked, not bundled.
59 commits
Go
81.7%
Mathematical Programming System
15.8%
C
2.5%