# Find the max element of a numeric vector iteratively with mask and early break

**URL:** <https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233>\
**Category:** Performance\
**Tags:** question, algorithm\
**Created:** [June 26, 2025, 12:47pm UTC](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233 "2025-06-26T12:47:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [June 27, 2025, 3:04pm UTC](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233/10 "2025-06-27T15:04:04Z")

</div>

I’ve already written a (somewhat) satisfying version of algorithm [here](https://discourse.julialang.org/t/a-primal-dual-global-optimization-approach-on-the-cutting-stock-problem/129686/11).

It’s a normal single-threaded program (I don’t have a multicore server or GPU).  
Typically other people may claim they do “parallel computing”. (But there is actually a lot of small issues to be noticed in this context.)

Actually if parallel computing is equipped, this is a lesser issue. Since all subproblem blocks can be executed in parallel, and I can pick one according to the violation level fast and return to the master problem. So it would be fine.

I think my single-threaded code is also fine. 🙂  
~~I’m going to try some other decomposition algorithms and make comparisons later.~~  
Although that problem might also admit of a Benders decomposition solution method, a _block-decomposition_ spirit will _not_ be embodied. Therefore my investigation is finished.

---

_[View the full topic](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233)._
