Search code examples
optimizationjuliajulia-jump

How to set an upper bound on a JuMP minimizing model?


I would like to set an upper bound for my JuMP model. That is, given I am minimizing, all nodes and solutions that have a value higher than my upper bound should not be considered by JuMP. How should I do that? What could I have searched on JuMP's documentation or Google to find out? I tried bound but couldn't find anything.


Solution

  • JuMP does not solve problems. Instead, it formulates them, and passes the solution off to a solver. You might want to read: https://jump.dev/JuMP.jl/stable/background/algebraic_modeling_languages/

    You can tell some solvers that there is a solution limit. For example, Gurobi has: https://www.gurobi.com/documentation/9.5/refman/cutoff.html#parameter:Cutoff

    model = Model(Gurobi.Optimizer)
    set_optimizer_attribute(model, "Cutoff", 1000)
    

    Note that this is specific to Gurobi. If you use a different solver, you will need to look at their documentation for the corresponding attribute (which may not exist).

    Why do you want this? Cutoffs are rarely helpful.