Warning
This package is still a work in progress in early stage of development.
Hexaly.jl is a wrapper for the Hexaly Optimizer.
It provides two layers of access:
- A thin wrapper over the Hexaly Python API (via
PythonCall.jl), exposed asHexaly.raw_optimizer(). - A MathOptInterface (MOI) wrapper
exposed as
Hexaly.Optimizer, which makes Hexaly usable from JuMP.
import Pkg
Pkg.add(url = "https://github.com/NexOR-Optimization/Hexaly.jl")Hexaly requires a license. See Hexaly's documentation for instructions.
This wrapper is maintained by NexOR Optimization and is not officially supported by Hexaly.
To use Hexaly with JuMP, use Hexaly.Optimizer:
using JuMP, Hexaly
model = Model(Hexaly.Optimizer)
set_attribute(model, "time_limit", 10) # in seconds
set_silent(model)
@variable(model, 0 <= x <= 3, Int)
@variable(model, 0 <= y <= 3, Int)
@constraint(model, x + y <= 4)
@objective(model, Max, 3x + 2y)
optimize!(model)
@show value(x), value(y), objective_value(model)using Hexaly
using Hexaly.PythonCall
optimizer = Hexaly.raw_optimizer()
m = optimizer.model
x = m.int(0, 10)
m.constraint(x >= 3)
m.minimize(x)
m.close()
optimizer.param.time_limit = 5
optimizer.solve()
@show pyconvert(Int, x.value)- Variables:
- Unconstrained (float)
MOI.Integer,MOI.ZeroOneMOI.EqualTo,MOI.LessThan,MOI.GreaterThan,MOI.Interval(integer or float)
- Constraints:
MOI.VariableIndexin bound sets (integer or float)MOI.ScalarAffineFunctioninMOI.{EqualTo, LessThan, GreaterThan}MOI.VectorOfVariablesinMOI.AllDifferentMOI.VectorOfVariablesinMOI.CircuitMOI.VectorOfVariablesinMOI.BinPacking
- Objectives:
MOI.VariableIndexMOI.ScalarAffineFunction
- Options:
MOI.SilentMOI.TimeLimitSecMOI.RawOptimizerAttribute("<hexaly-param>")