# README
go-mip
go-mip provides a Go interface for modeling and solving Mixed-Integer Programming (MIP) problems.
License
Please note that go-mip is provided as source-available software (not open-source). For further information, please refer to the LICENSE file.
Usage
This library contains the types and interfaces to model and solve MIP problems. The implementation is provided by other (solver-specific) packages, e.g.: go-highs.
For further information on how to get started with MIP modeling and Nextmv, please refer to the official documentation.
Versioning
We try our best to version our software thoughtfully and only break APIs and behaviors when we have a good reason to.
- Minor (
v1.^.0
) tags: new features, might be breaking. - Patch (
v1.0.^
) tags: bug fixes.
# Packages
Package model contains modeling functionality.
# Functions
DefaultCustomResultStatistics creates default custom statistics for a given solution.
Format the MIP solution into the output format that the runner expects.
NewModel SDK implementation.
Version returns the version of the mip module.
# Constants
Equal is used to define an equality constraint c, _ := d.NewConstraint(mip.Equal, 123.4)
c.NewTerm(1.0, x) // results in 1.0 * x = 123.4 in solver.
GreaterThanOrEqual is used to define a greater or equal constraint c, _ := d.NewConstraint(mip.
High logs everything the underlying logs, depends on the back-end solver.
LessThanOrEqual is used to define a less than or equal constraint c, _ := d.NewConstraint(mip.LessThanOrEqual, 123.4)
c.NewTerm(1.0, x) // results in 1.0 * x <= 123.4 in solver.
Low logs essentials, depends on the back-end solver.
Medium logs essentials plus high level events, depends on the back-end solver.
Off logs nothing.
# Structs
ControlOptions allow the user to define solver-specific parameters.
CustomResultStatistics is an example of custom statistics that can be added to the output and used in experiments.
GapOptions specifies the gap stopping criteria.
MIPOptions are options specific to MIP problems.
SolveOptions are options that can be configured for any solver.
TypedControlOption defines a generic way to specify a control parameter for a solver.
TypedControlOptions is the typed equivalent to [ControlOptions] for configuring a solver's parameters.
# Interfaces
Bool a Var which can take two values, zero or one.
Constraint specifies a relation between variables a solution has to comply with.
Float a Var which can take any value in an interval.
Int a Var which can take any integer value in an interval.
Model manages the variables, constraints and objective.
Objective specifies the objective of the model.
QuadraticTerm consists of a coefficient and two vars.
Solution contains the results of a Solver.Solve invocation.
Solver for a MIP problem.
Term is the building block of a constraint and an objective.
Var represents the entities on which the solver has to make a decision without violating constraints and while optimizing the objective.
# Type aliases
Constraints slice of Constraint instances.
QuadraticTerms is a slice of QuadraticTerm instances.
Sense defines the constraint operator between the left-hand-side and the right-hand-side.
SolverProvider identifier for a back-end solver.
Terms is a slice of Term instances.
Vars is a slice of Var instances.
Verbosity specifies the level of verbosity of the back-end solver.