Juniper.jl
A JuMP-based Nonlinear Integer Program Solver
Install / Use
/learn @lanl-ansi/Juniper.jlREADME
Juniper
Juniper (Jump Nonlinear Integer Program solver) is a solver for mixed-integer nonlinear programs.
It is a heuristic which is not guaranteed to find the global optimum. If you need the global optimum, check out Alpine.
Installation
Install Juniper using the Julia package manager:
import Pkg
Pkg.add("Juniper")
Use with JuMP
Use Juniper with JuMP as follows:
using JuMP, Juniper, Ipopt
ipopt = optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0)
optimizer = optimizer_with_attributes(Juniper.Optimizer, "nl_solver"=>ipopt)
model = Model(optimizer)
v = [10, 20, 12, 23, 42]
w = [12, 45, 12, 22, 21]
@variable(model, x[1:5], Bin)
@objective(model, Max, v' * x)
@constraint(model, sum(w[i]*x[i]^2 for i in 1:5) <= 45)
optimize!(model)
println(termination_status(model))
println(objective_value(model))
println(value.(x))
The nl_solver is used by Juniper to solve continuous nonlinear sub-problems while Juniper searches for acceptable assignments to the discrete variables.
A common choice is Ipopt, but any optimizer that supports the continuous relaxation of the model may be used.
To solve problems with more complex nonlinear functions, use the @NLconstraint and @NLobjective JuMP macros.
Documentation
The online documentation is available at https://lanl-ansi.github.io/Juniper.jl/stable/.
Feasibility pump
If Juniper has difficulty finding feasible solutions on your model, try adding a solver that supports integer variables (for example, HiGHS) to run a feasibility pump:
using JuMP, Juniper, Ipopt, HiGHS
ipopt = optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0)
highs = optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => false)
model = Model(
optimizer_with_attributes(
Juniper.Optimizer,
"nl_solver" => ipopt,
"mip_solver" => highs,
),
)
The feasibility pump is used at the start of Juniper to find a feasible solution before the branch and bound part starts. For some classes of problems this can be a highly effective pre-processor.
Citing Juniper
If you find Juniper useful in your work, we kindly request that you cite the following paper or technical report:
@inproceedings{juniper,
Author = {Ole Kröger and Carleton Coffrin and Hassan Hijazi and Harsha Nagarajan},
Title = {Juniper: An Open-Source Nonlinear Branch-and-Bound Solver in Julia},
booktitle="Integration of Constraint Programming, Artificial Intelligence, and Operations Research",
pages="377--386",
year="2018",
publisher="Springer International Publishing",
isbn="978-3-319-93031-2"
}
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
