ojAlgo-gurobi

ojAlgo and GUROBI integration

License

License

MIT
GroupId

GroupId

org.ojalgo
ArtifactId

ArtifactId

ojalgo-gurobi
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ojAlgo-gurobi
ojAlgo and GUROBI integration
Project URL

Project URL

http://ojalgo.org
Project Organization

Project Organization

Optimatika
Source Code Management

Source Code Management

https://github.com/optimatika/ojAlgo-gurobi

Download ojalgo-gurobi

How to add to project

<!-- https://jarcasting.com/artifacts/org.ojalgo/ojalgo-gurobi/ -->
<dependency>
    <groupId>org.ojalgo</groupId>
    <artifactId>ojalgo-gurobi</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.ojalgo/ojalgo-gurobi/
implementation 'org.ojalgo:ojalgo-gurobi:3.0.0'
// https://jarcasting.com/artifacts/org.ojalgo/ojalgo-gurobi/
implementation ("org.ojalgo:ojalgo-gurobi:3.0.0")
'org.ojalgo:ojalgo-gurobi:jar:3.0.0'
<dependency org="org.ojalgo" name="ojalgo-gurobi" rev="3.0.0">
  <artifact name="ojalgo-gurobi" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.ojalgo', module='ojalgo-gurobi', version='3.0.0')
)
libraryDependencies += "org.ojalgo" % "ojalgo-gurobi" % "3.0.0"
[org.ojalgo/ojalgo-gurobi "3.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.ojalgo : ojalgo jar 48.4.1

test (4)

Group / Artifact Type Version
org.ojalgo : ojalgo test-jar 48.4.1
org.junit.jupiter : junit-jupiter-api jar 5.7.1
org.junit.jupiter : junit-jupiter-engine jar 5.7.1
org.junit.jupiter : junit-jupiter-params jar 5.7.1

system (1)

Group / Artifact Type Version
gurobi » gurobi jar 9.1.1

Project Modules

There are no modules declared in this project.

ojAlgo Gurobi integration

Use Gurobi from within ojAlgo – use Gurobi as a solver from ExpressionsBasedModel.

When/if ojAlgo's built-in optimisation solvers are not capable of solving your model (fast enough) it is possible to plug in other solvers. Gurobi is one such solver where an integration already exists.

Prerequisites

  • Basic knowledge of how to use ojAlgo to model and solve optimisation problems
  • Gurobi is installed and functional

This is what you need to do

  • Add this dependency to your project. Here's how to do that using maven:
<!-- https://mvnrepository.com/artifact/org.ojalgo/ojalgo-gurobi -->
<dependency>
    <groupId>org.ojalgo</groupId>
    <artifactId>ojalgo-gurobi</artifactId>
    <version>X.Y.Z</version>
</dependency>
  • That POM declares properties that are paths to where the jar and native binaries are installed. You need to set these properties to match your installation:
<properties>
    <!-- You have to change this! -->
    <path.installation.gurobi>/Library/gurobi751</path.installation.gurobi>
    <path.jar.gurobi>${path.installation.gurobi}/mac64/lib/gurobi.jar</path.jar.gurobi>
    <path.native.gurobi>${path.installation.gurobi}/mac64/bin</path.native.gurobi>
</properties>
  • When you run your program the JVM property 'java.library.path' must contain the path to the Gurobi binary. In my case the path is: '/Library/gurobi751/mac64/bin'

  • To configure ExpressionsBasedModel to use Gurobi rather than ojAlgo's built-in solvers execute this line of code:

ExpressionsBasedModel.addPreferredSolver(SolverGurobi.INTEGRATION);
  • If you only want to use Gurobi when the built-in solvers cannot handle a particular model you should instead do this:
ExpressionsBasedModel.addFallbackSolver(SolverGurobi.INTEGRATION);
org.ojalgo

Optimatika

Versions

Version
3.0.0
2.47.2