diff --git a/Project.toml b/Project.toml index d76d2d0..a2e3ed4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "MathOptLazy" uuid = "5d5fe9b5-b0a4-4485-81f6-7b1b939155e1" -version = "0.1.6" +version = "1.0.0" authors = ["Oscar Dowson "] [deps] diff --git a/README.md b/README.md index 31f74af..e319ac4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ [![Build Status](https://github.com/jump-dev/MathOptLazy.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jump-dev/MathOptLazy.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/jump-dev/MathOptLazy.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jump-dev/MathOptLazy.jl) -[MathOptLazy.jl](https://github.com/jump-dev/MathOptLazy.jl) is an experimental meta-solver for problems with lazy constraints. +[MathOptLazy.jl](https://github.com/jump-dev/MathOptLazy.jl) is a meta-solver +for problems with lazy constraints. ## License @@ -31,10 +32,21 @@ Use `MathOptLazy.jl` with JuMP as follows: using JuMP import HiGHS import MathOptLazy +# Pass () -> MathOptLazy.Optimizer(inner_optimizer) as the solver model = Model(() -> MathOptLazy.Optimizer(HiGHS.Optimizer)) +# Choose an algorithm set_attribute(model, MathOptLazy.Algorithm(), MathOptLazy.Iterative()) @variable(model, x[1:10] >= 0) +# Tag constraints as lazy @constraint(model, [i in 1:10], x[i] <= 1, MathOptLazy.Lazy()) +# You can also pass the `lazy` keyword to Lazy() +is_lazy = rand(Bool) +@constraint(model, sum(x) <= 3, MathOptLazy.Lazy(; lazy = is_lazy)) +# You can also use this constructor to opt-in to lazy constraints of the given +# type if and only if the solver supports them. This simplifies writing a model +# where the user gets to choose the solver. +tag = MathOptLazy.Lazy(model, AffExpr, MOI.GreaterThan{Float64}) +@constraint(model, sum(x) >= 2, tag) ``` ## Algorithm