# HiGHS multi-objective optimization stuck in infinite loop

**URL:** <https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, moa\
**Created:** [August 12, 2025, 11:57am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559 "2025-08-12T11:57:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 12, 2025, 11:57am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/1 "2025-08-12T11:57:48Z")

</div>

I’m refactoring my code to go from custom multi objective optimization to using MultiObjectiveAlgorithms.jl with `Lexicographic`. When I run my optimization it never stops, with this repeated log message:

 ![highs_log_period](https://global.discourse-cdn.com/julialang/original/3X/5/e/5ea5eb28a4a148ef4c405b790416b265d47c2ce9.png)

So it looks like it repeats the exact same optimization over and over. I found that this does not always happen. Here is a vector of objectives for which it **does** happen:

```plaintext
10-element Vector{AffExpr}:
 level_demand_error[Basin #7,1,lower,first] + level_demand_error[Basin #7,1,upper,first]
 level_demand_error[Basin #7,1,lower,second] + level_demand_error[Basin #7,1,upper,second]
 user_demand_error[UserDemand #10,2,first]
 user_demand_error[UserDemand #10,2,second]
 user_demand_error[UserDemand #9,3,first]
 user_demand_error[UserDemand #9,3,second]
 user_demand_error[UserDemand #6,4,first]
 user_demand_error[UserDemand #6,4,second]
 -low_storage_factor[Basin #3] - low_storage_factor[Basin #7]
 0.0005 flow[(FlowBoundary #1, Basin #7)] + 0.0005 flow[(FlowBoundary #2, Basin #3)] + 0.00025 flow[(Basin #3, TabulatedRatingCurve #4)] + 0.001 flow[(UserDemand #6, Basin #3)] + 0.00025 flow[(Basin #7, TabulatedRatingCurve #8)] + 0.00025 flow[(Basin #7, UserDemand #6)] + 0.00025 flow[(Basin #7, UserDemand #9)] + 0.00025 flow[(Basin #7, UserDemand #10)] + 0.001 flow[(UserDemand #9, Basin #3)] + 0.001 flow[(UserDemand #10, Basin #3)]

```

And here is a vector of objectives for which it **does not** happen (also with different variables and constraints):

```plaintext
2-element Vector{AffExpr}:
 -low_storage_factor[Basin #1]
 0.00025 flow[(Basin #1, LinearResistance #2)]

```

I also don’t understand why it says without presolve, I explicitly set it to ‘on’.

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 12, 2025, 12:55pm UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/2 "2025-08-12T12:55:44Z")

</div>

Should `Lexicographic` be able to handle empty (feasibility) objectives? Or should I filter those out?

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 12, 2025, 2:49pm UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/3 "2025-08-12T14:49:16Z")

</div>

I also found that writing a model with a vector valued objective function to file is not supported, that problem is easily reproducable: [Add support for writing models with a vector-valued objective to file · Issue #4052 · jump-dev/JuMP.jl](https://github.com/jump-dev/JuMP.jl/issues/4052)

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 12, 2025, 5:28pm UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/4 "2025-08-12T17:28:31Z")

</div>

Hmm, maybe my problem is related to what is discussed [here](https://discourse.julialang.org/t/is-it-possible-to-use-highs-multi-objective-optimization-from-jump/126913) and what I’m experiencing is terrible scaling in the number of objectives. I’ll try what’s suggested there.

---

<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:** [August 12, 2025, 8:49pm UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/5 "2025-08-12T20:49:38Z")

</div>

Hi @BdeKoning, can you please make a reproducible example with `write_to_file(model, "model.mof.json")` and then open an issue at: [GitHub - jump-dev/MultiObjectiveAlgorithms.jl: A Julia package for solving multi-objective optimization problems](https://github.com/jump-dev/MultiObjectiveAlgorithms.jl)

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 13, 2025, 6:55am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/6 "2025-08-13T06:55:48Z")

</div>

Sadly I cannot create a reproducible example from my code, writing the problem to file and reading it resolves the problem.

I now use `JuMP.set_attribute(model, MOA.LexicographicAllPermutations(), false)` and that solves very quickly. It makes sense that it took very long before if it was going through all 10! objective permutations for the problematic model, I’m only interested in the specific order of the objectives that I provide.

---

<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:** [August 13, 2025, 8:19am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/7 "2025-08-13T08:19:47Z")

</div>

Maybe should turn off the complete search if N \>3? Defaults are hard…

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [August 13, 2025, 11:37am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/8 "2025-08-13T11:37:46Z")

</div>

I would make the complete search opt-in (or even a different algorithm), I suspect users would find this difference in behavior based on such a threshold confusing. That being said, I’m not too familiar with the LP solve community so I don’t know what people would expect.

---

<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:** [August 14, 2025, 12:13am UTC](https://discourse.julialang.org/t/highs-multi-objective-optimization-stuck-in-infinite-loop/131559/9 "2025-08-14T00:13:07Z")

</div>

To avoid breaking existing workflow, the proposal in [Add a warning when lexicographic used with default args and 5+ objectives by odow · Pull Request #138 · jump-dev/MultiObjectiveAlgorithms.jl · GitHub](https://github.com/jump-dev/MultiObjectiveAlgorithms.jl/pull/138) is to throw a prominent warning. I probably made the wrong decision with the default, but it’s there now.
