# \#algorithm

**URL:** https://discourse.julialang.org/tag/algorithm/650.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

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

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 10\
**Last updated:** [September 16, 2025, 9:01am UTC](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233 "2025-09-16T09:01:36Z")

</div>

This is an elementary question about algorithm. My algorithm is probably already usable but I wonder if there is a faster algorithm that can be implemented with Julia (e.g. even not using findmax) import Random; Rando…

---

## [A Primal-Dual Global Optimization approach on the Cutting Stock Problem](https://discourse.julialang.org/t/a-primal-dual-global-optimization-approach-on-the-cutting-stock-problem/129686)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 18\
**Last updated:** [July 7, 2025, 10:38pm UTC](https://discourse.julialang.org/t/a-primal-dual-global-optimization-approach-on-the-cutting-stock-problem/129686 "2025-07-07T22:38:49Z")

</div>

This doc reads a bit lengthy, because it uses complex data structures (maybe for visualization purposes). Therein it uses economic interpretation, which is hard to understand for me. Therefore, I explicitly wrote the…

---

## [IKEA-style visual algorithm explanation](https://discourse.julialang.org/t/ikea-style-visual-algorithm-explanation/129248)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 0\
**Last updated:** [May 22, 2025, 1:14pm UTC](https://discourse.julialang.org/t/ikea-style-visual-algorithm-explanation/129248 "2025-05-22T13:14:39Z")

</div>

I actually consult the graph search instructions each time I want a nonrecursive (with an explicit stack) DFS:

---

## [Monotonic smoothing of noisy data](https://discourse.julialang.org/t/monotonic-smoothing-of-noisy-data/93184)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 21\
**Last updated:** [May 17, 2025, 3:47pm UTC](https://discourse.julialang.org/t/monotonic-smoothing-of-noisy-data/93184 "2025-05-17T15:47:46Z")

</div>

Is there a package in Julia, or a simple algorithm, to perform monotonic smoothing of noisy data? See this Python example. NB: it is assumed that we do not know of any monotonic function or model that could fit the da…

---

## [Dict with integer keys and fastest insertion?](https://discourse.julialang.org/t/dict-with-integer-keys-and-fastest-insertion/125171)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 8\
**Last updated:** [January 25, 2025, 1:28pm UTC](https://discourse.julialang.org/t/dict-with-integer-keys-and-fastest-insertion/125171 "2025-01-25T13:28:35Z")

</div>

What are the best options for a dict/map with integer keys and the fastest insert/update? For background, I wish to aggregate those position-weight pairs (p,w) where the position is the same, I’m tinkering with the idea …

---

## [How to pass the domain of a variable to a function in a general manner?](https://discourse.julialang.org/t/how-to-pass-the-domain-of-a-variable-to-a-function-in-a-general-manner/111824)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [March 20, 2024, 2:17am UTC](https://discourse.julialang.org/t/how-to-pass-the-domain-of-a-variable-to-a-function-in-a-general-manner/111824 "2024-03-20T02:17:19Z")

</div>

I plan to implement some certain algorithm that is designed for a class of some type of optimization problems with one of whose decision variables x required to be in the domain F\_x\\subseteq \\mathbb{R}\_+^n. I decide to …

---

## [DifferentialEquations.jl - Solving ODE with "alg\_hints=\[:stiff\]" is 20x slower, any alternatives?](https://discourse.julialang.org/t/differentialequations-jl-solving-ode-with-alg-hints-stiff-is-20x-slower-any-alternatives/109750)

<div class="topic-metadata">

**Author:** [@FJRubio](https://discourse.julialang.org/u/FJRubio)\
**Replies:** 8\
**Last updated:** [February 6, 2024, 9:59pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solving-ode-with-alg-hints-stiff-is-20x-slower-any-alternatives/109750 "2024-02-06T21:59:13Z")

</div>

I am solving several thousand systems of ODEs, with an explicit Jacobian, using DifferentialEquations.jl. These systems are similar to the competitive Lotka-Volterra model. In some cases (depending on the parameter value…

---

## [Help with numerically unstable algorithm](https://discourse.julialang.org/t/help-with-numerically-unstable-algorithm/104911)

<div class="topic-metadata">

**Author:** [@enweg](https://discourse.julialang.org/u/enweg)\
**Replies:** 13\
**Last updated:** [October 20, 2023, 12:12pm UTC](https://discourse.julialang.org/t/help-with-numerically-unstable-algorithm/104911 "2023-10-20T12:12:44Z")

</div>

Hi, I have this small algorithm that is supposed to create a matrix based on random eigenvalues and eigenvectors. Since the last few rows of the matrix need to satisfy some criteria, I end up with essentially the follow…

---

## [Documentation of ImplicitRKMil - StochasticDiffEq.jl](https://discourse.julialang.org/t/documentation-of-implicitrkmil-stochasticdiffeq-jl/102104)

<div class="topic-metadata">

**Author:** [@lappet](https://discourse.julialang.org/u/lappet)\
**Replies:** 3\
**Last updated:** [August 9, 2023, 9:34am UTC](https://discourse.julialang.org/t/documentation-of-implicitrkmil-stochasticdiffeq-jl/102104 "2023-08-09T09:34:52Z")

</div>

My goal is to undertsand the actual implementation of the ImplicitRKMil algorithm here. Are there any notes or book sections directly relating to the code here? The perspective of my question is this: I have a bunch of …

---

## [Multiway string substitution](https://discourse.julialang.org/t/multiway-string-substitution/102345)

<div class="topic-metadata">

**Author:** [@Denis\_Ivanov](https://discourse.julialang.org/u/Denis_Ivanov)\
**Replies:** 17\
**Last updated:** [August 6, 2023, 8:15pm UTC](https://discourse.julialang.org/t/multiway-string-substitution/102345 "2023-08-06T20:15:07Z")

</div>

I have set an ambitious goal of modeling some Wolfram Physics Project features into Julia. Because actually, Julia works faster and more efficiently, while the subject is very interesting. A bit later I will be happy to…

---

## [Median calculation performing better than expected](https://discourse.julialang.org/t/median-calculation-performing-better-than-expected/93174)

<div class="topic-metadata">

**Author:** [@Nino\_Rode](https://discourse.julialang.org/u/Nino_Rode)\
**Replies:** 3\
**Last updated:** [January 18, 2023, 6:19pm UTC](https://discourse.julialang.org/t/median-calculation-performing-better-than-expected/93174 "2023-01-18T18:19:43Z")

</div>

I have an “it works … why?” question. I hope this is the right place. I’m trying to learn to write julia code to have as good performance as possible (yes, I’m new with julia). Most of the time, I’m trying to reproduce …

---

## [Prioritising GPU Primitives from Vendor-Specialised Libraries](https://discourse.julialang.org/t/prioritising-gpu-primitives-from-vendor-specialised-libraries/91700)

<div class="topic-metadata">

**Author:** [@anicusan](https://discourse.julialang.org/u/anicusan)\
**Replies:** 1\
**Last updated:** [December 15, 2022, 3:49pm UTC](https://discourse.julialang.org/t/prioritising-gpu-primitives-from-vendor-specialised-libraries/91700 "2022-12-15T15:49:39Z")

</div>

Hi, and thank you for the amazing Julia GPGPU ecosystem you’re building! I’d like to hear your thoughts on GPU primitives on our platforms. Julia - with multiple dispatch, homoiconicity and libraries like GPUCompiler a…

---

## [Use javascript library pseudocode.js with Documenter.jl](https://discourse.julialang.org/t/use-javascript-library-pseudocode-js-with-documenter-jl/87684)

<div class="topic-metadata">

**Author:** [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 4:57am UTC](https://discourse.julialang.org/t/use-javascript-library-pseudocode-js-with-documenter-jl/87684 "2022-09-23T04:57:43Z")

</div>

Does anyone know if it is possible to use the external javascript library pseudocode.js with Documenter.jl ? I am trying to replace my algorithms stored in .png files in my documentation of Krylov.jl. I modified the kw…

---

## [Simpsons Rule](https://discourse.julialang.org/t/simpsons-rule/84114)

<div class="topic-metadata">

**Author:** [@simonluzara](https://discourse.julialang.org/u/simonluzara)\
**Replies:** 23\
**Last updated:** [September 5, 2022, 1:25pm UTC](https://discourse.julialang.org/t/simpsons-rule/84114 "2022-09-05T13:25:34Z")

</div>

Hello everyone, am a new enthusiastic member of julia community. I have spent quite a fair share of time watching tutorials from Chris and all the others. I have a matlab simpsons rule code which was very generic for nu…

---

## [Announcing CoherentNoise.jl](https://discourse.julialang.org/t/announcing-coherentnoise-jl/85860)

<div class="topic-metadata">

**Author:** [@mfiano](https://discourse.julialang.org/u/mfiano)\
**Replies:** 15\
**Last updated:** [August 18, 2022, 11:46pm UTC](https://discourse.julialang.org/t/announcing-coherentnoise-jl/85860 "2022-08-18T23:46:21Z")

</div>

I am proud to announce the first version of CoherentNoise.jl, a library consisting of several coherent noise algorithms and tools to compose them into interesting pipelines. This is actually my first real package, only …

---

## [Performance of weighed graphs](https://discourse.julialang.org/t/performance-of-weighed-graphs/83661)

<div class="topic-metadata">

**Author:** [@Jirka\_Fink](https://discourse.julialang.org/u/Jirka_Fink)\
**Replies:** 9\
**Last updated:** [July 12, 2022, 9:02am UTC](https://discourse.julialang.org/t/performance-of-weighed-graphs/83661 "2022-07-12T09:02:38Z")

</div>

I work on combinarotial optimization, so I am looking data structures storing weighed graph. At https://juliagraphs.org/, I found SimpleWeightedGraphs, MetaGraphs, MetaGraphsNext. However, neither of them seems to me t…

---

## [Can Julia do this algorithm faster?](https://discourse.julialang.org/t/can-julia-do-this-algorithm-faster/74516)

<div class="topic-metadata">

**Author:** [@jzakiya](https://discourse.julialang.org/u/jzakiya)\
**Replies:** 56\
**Last updated:** [June 27, 2022, 7:53pm UTC](https://discourse.julialang.org/t/can-julia-do-this-algorithm-faster/74516 "2022-06-27T19:53:50Z")

</div>

So I’ve developed the fastest algorithm to find Twin (Cousin) Primes. Here’s the paper on it. If you’re REALLY interested in the math also check out these: and its video: https://www.youtube.com/watch?v=HCUiPknHtfY …

---

## [\[ANN\] BipartiteMatching.jl: for fast and scalable bipartite matching](https://discourse.julialang.org/t/ann-bipartitematching-jl-for-fast-and-scalable-bipartite-matching/81996)

<div class="topic-metadata">

**Author:** [@isaac.rubberducky](https://discourse.julialang.org/u/isaac.rubberducky)\
**Replies:** 2\
**Last updated:** [May 31, 2022, 10:10pm UTC](https://discourse.julialang.org/t/ann-bipartitematching-jl-for-fast-and-scalable-bipartite-matching/81996 "2022-05-31T22:10:54Z")

</div>

The Goal There are many algorithms in other Julia packages capable of finding maximum cardinality matches in bipartite graphs. However, those algorithms are very general, and mostly use linear programming or generic flow…

---

## [Lanczos tridiagonalization algorithm in Julia?](https://discourse.julialang.org/t/lanczos-tridiagonalization-algorithm-in-julia/77085)

<div class="topic-metadata">

**Author:** [@falbarelli](https://discourse.julialang.org/u/falbarelli)\
**Replies:** 19\
**Last updated:** [March 10, 2022, 7:15am UTC](https://discourse.julialang.org/t/lanczos-tridiagonalization-algorithm-in-julia/77085 "2022-03-10T07:15:29Z")

</div>

Hi everyone! I have been looking for an implementation of Lanczos algorithm in Julia, but to my surprise I haven’t found anything obvious! I need the actual tridiagonalization, i.e. the tridiagonal matrix T and the uni…

---

## [Problems using meshgrid to plot a surface in an attempt to visualize feature mapping and SVM](https://discourse.julialang.org/t/problems-using-meshgrid-to-plot-a-surface-in-an-attempt-to-visualize-feature-mapping-and-svm/76792)

<div class="topic-metadata">

**Author:** [@Jasper\_De\_Landsheere](https://discourse.julialang.org/u/Jasper_De_Landsheere)\
**Replies:** 0\
**Last updated:** [February 20, 2022, 10:58am UTC](https://discourse.julialang.org/t/problems-using-meshgrid-to-plot-a-surface-in-an-attempt-to-visualize-feature-mapping-and-svm/76792 "2022-02-20T10:58:15Z")

</div>

Hi all, I am working on a little project using toy data to visualize what happens when you map data to a higher feature space and perform SVM (Support Vector Machine) in this higher space. With the obtained set of weigh…

---

## [How to compute algorithm complexity?](https://discourse.julialang.org/t/how-to-compute-algorithm-complexity/75638)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [February 2, 2022, 10:41am UTC](https://discourse.julialang.org/t/how-to-compute-algorithm-complexity/75638 "2022-02-02T10:41:52Z")

</div>

I know nothing of computational theory, if not that sometimes you come across to some “big O” notation to rank algorithm efficiency. How do I compute this “big O” notation for the two implementations of prime number gen…

---

## [Collecting all solutions in a recursive branching algorithm](https://discourse.julialang.org/t/collecting-all-solutions-in-a-recursive-branching-algorithm/70936)

<div class="topic-metadata">

**Author:** [@Eugeleo](https://discourse.julialang.org/u/Eugeleo)\
**Replies:** 13\
**Last updated:** [November 5, 2021, 3:09pm UTC](https://discourse.julialang.org/t/collecting-all-solutions-in-a-recursive-branching-algorithm/70936 "2021-11-05T15:09:32Z")

</div>

Moved this from the New to Julia to a more fitting section I’m trying to translate a divide and conquer algorithm for a modified subset sum problem from Python. A simplified version might look like this: You are given a…

---

## [Single Transferable Vote by Meek's Method](https://discourse.julialang.org/t/single-transferable-vote-by-meeks-method/59701)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 4\
**Last updated:** [April 26, 2021, 2:42am UTC](https://discourse.julialang.org/t/single-transferable-vote-by-meeks-method/59701 "2021-04-26T02:42:43Z")

</div>

Algorithm 123 — SINGLE TRANSFERABLE VOTE BY MEEK’S METHOD Thinking of working on this as a weekend project. Anyone has interest or suggestions for the implementation?

---

## [Equally dividing a circular area](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151)

<div class="topic-metadata">

**Author:** [@JuliusAurelius](https://discourse.julialang.org/u/JuliusAurelius)\
**Replies:** 6\
**Last updated:** [March 30, 2021, 9:05am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151 "2021-03-30T09:05:32Z")

</div>

Hi, I am working on a project where I need to divide a unit circle into roughly equal areas. Ideally I’d have a function location, area = divideCircleArea(nAreas); where nAreas is the number of areas (typically about …
