# Mixed-Integer Multi-objective Constrained Optimization Problem Solving

**URL:** <https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package\
**Created:** [June 19, 2022, 7:50pm UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030 "2022-06-19T19:50:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magy/32/35709_2.png) [@Magy](https://discourse.julialang.org/u/Magy)\
**Post date:** [June 19, 2022, 7:50pm UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030/1 "2022-06-19T19:50:22Z")

</div>

Dear All,  
I wonder if there is a direct package that can be used to solve a mixed-integer multi-objective constrained problem. I tried to use “Metaheuristics.jl” but failed to represent my model’s mixed-integer variables.

Best Regards  
Magy

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [June 20, 2022, 2:12am UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030/2 "2022-06-20T02:12:35Z")

</div>

Hi there,

There’s BlackBoxOptim: [GitHub - robertfeldt/BlackBoxOptim.jl: Black-box optimization for Julia](https://github.com/robertfeldt/BlackBoxOptim.jl#multi-objective-optimization)

But if you’re looking for something like a multi-objective mixed-integer linear programming solver, I don’t know of one in Julia. It’s on our roadmap though: [Multiobjective support in JuMP · Issue #2099 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2099)

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [June 20, 2022, 2:54pm UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030/3 "2022-06-20T14:54:55Z")

</div>

If you want an out-of-the-box package that will take as input a JuMP problem with multiple objectives, and returns a Pareto front, I’m afraid there is not on at the moment.

If you want to optimize for a weighted combination of objectives (without manually making it into a single objective), or want have a priority in your objectives, e.g., “minimize objective 1, then minimize objective 2 while remaining optimal for objective 1”, it is possible (but not officially supported) with JuMP+Gurobi.

Gurobi supports a range of mixed-integer problems (linear and quadratic) and has [some support for multiple objectives](https://www.gurobi.com/documentation/9.5/refman/multiple_objectives.html). That latter feature is not officially available through JuMP, however, you can follow [this example](https://discourse.julialang.org/t/gurobi-not-using-barrier-method/68078/7) to make it work. Credits to @odow for that original solution.

---

<div class="post-metadata">

**Author:** ![XavierG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavierg/32/1768_2.png) [@XavierG](https://discourse.julialang.org/u/XavierG)\
**Post date:** [July 28, 2022, 9:44am UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030/4 "2022-07-28T09:44:40Z")

</div>

vOptGeneric.jl (`https://github.com/vOptSolver/vOptGeneric.jl`) takes a bi-objective JuMP model, and with the epsilon-constraint method available in vOptGeneric, you can sample the non-dominated set of your problem. Example

```julia
using vOptGeneric, JuMP, GLPK

# creating a random instance of 2-MILP
function createInstance2MILP(nZ, nR, nK)
    c1Z = rand(1:10,nZ)
    c1R = rand(1:10,nR)    
    c2Z = rand(1:10,nZ)
    c2R = rand(1:10,nR)  
    A = rand(5:25,nK,nZ+nR)
    d = rand(50:100,nK)
    return c1Z, c1R, c2Z, c2R, A, d
end

# creating the JuMP model of 2-MILP 
function createProblemBiMILP(nZ, nR, nK, c1Z, c1R, c2Z, c2R, A, d)
    model = vModel( GLPK.Optimizer )
    @variable(model, xZ[1:nZ] ≥0 , Int)
    @variable(model, xR[1:nR] ≥ 0)
    @addobjective(model, Max, sum(c1Z[i]*xZ[i] for i in 1:nZ) + sum(c1R[i]*xR[i] for i in 1:nR))
    @addobjective(model, Max, sum(c2Z[i]*xZ[i] for i in 1:nZ) + sum(c2R[i]*xR[i] for i in 1:nR))
    @constraint(model, [i=1:nK], sum((A[i,j]*xZ[j]) for j in 1:nZ) + sum((A[i,nZ+j]*xR[j]) for j in 1:nR) ≤ d[i])
    return model
end

# ---- Create a numerical instance
nZ=2; nR=3 ; nK=4
c1Z, c1R, c2Z, c2R, A, d = createInstance2MILP(nZ,nR,nK)

# ---- Define the 2-MILP model
mod2MILP = createProblemBiMILP(nZ,nR,nK,c1Z,c1R,c2Z,c2R,A,d)

# ---- Invoking the solver 
vSolve(mod2MILP, method=:epsilon, step = 1.0)

# ---- Querying the results
Y_N = getY_N( mod2MILP )

```

Example of an output (set of non-points):

```julia
11-element Vector{Vector{Float64}}:
 [14.283333333333335, 36.333333333333336]
 [14.633333333333333, 35.333333333333336]
 [14.98333333333333, 34.333333333333336]
 [15.333333333333334, 33.333333333333336]
 [16.166666666666668, 31.66666666666666]
 [16.516666666666666, 30.666666666666664]
 [16.866666666666667, 29.666666666666664]
 [17.18828901423583, 27.450980392156858]
 [18.701960784313727, 26.450980392156858]
 [19.215686274509803, 25.45098039215686]
 [20.8, 22.0]

```

---

<div class="post-metadata">

**Author:** ![Magy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magy/32/35709_2.png) [@Magy](https://discourse.julialang.org/u/Magy)\
**Post date:** [July 31, 2022, 11:43pm UTC](https://discourse.julialang.org/t/mixed-integer-multi-objective-constrained-optimization-problem-solving/83030/5 "2022-07-31T23:43:51Z")

</div>

> [@XavierG](#):
>
> [GitHub - vOptSolver/vOptGeneric.jl: Solver of multiobjective linear optimization problems (MOMIP, MOLP, MOIP, MOCO): generic part](https://github.com/vOptSolver/vOptGeneric.jl)

It seems a good solution, and I will try it. Thanks for the help.
