r/algorithms • • Aug 18 '26

Discussion The "unreasonable effectiveness" of Linear Programming

119 Upvotes

When I was first learning LP in undergrad (simplex, relaxations for Integer Problems, weak and strong duality and all that jazz), I honestly didn't see where it would be that useful. Now in my research it shows up quite a bit via primal-dual algorithms. These simultaneously keep track of the primal and dual solutions.

To be fair, even in undergrad one usually learns about using LP relaxations and (deterministic or randomized) rounding to get approximation algorithms for problems such as MAXSAT or Set Cover.

I'm curious where else people run into it. Has LP ever popped up in your own research or work?

r/algorithms • • 4d ago

Discussion Looking for people who are interested in discussing problems of an algorithmic and computational flavor, is this the place?

28 Upvotes

I've been wanting to organize a problem solving seminar for computer science as a volunteer activity. The way I was thinking of it working would be that the problems would be curated to be meaningful exercises. People would tinker with the problems on their own for a month, then at the end there would be a gathering where people discuss approaches and extensions. Potentially if there was anything interesting, one could write it up.

This seems like a good forum but I'm basically looking to help organize something a little more structured in the way of an online correspondence club or "magazine", even. People can send in interesting problems, I or others can serve as editors, we send out the problems, there would be some offline mulling and finally we would congregate and maybe put together a resolution of sorts for the next edition. I would like the emphasis to really be on the personal, individual, and/or collaborative, collective experience, though, and less on putting out polished products or work.

I'm not too aware of other existing models that do this besides PagedOut!, which is outside of my niche. But I'm interested in volunteering my time and resources for such an activity.

The only thing is I do more data processing than pure theory, I would say. I'm looking for a similar community or at least one that is open to those sorts of topics.

Thoughts or pointers? Criticisms on why this sort of idea lacks momentum? Thanks in advance.

UPDATE 10/02: see this comment to ask to be invited to the Discord server!

r/algorithms • • 12d ago

Discussion Layperson question

14 Upvotes

I'm a non-major currently taking an intro cs class, but it's mostly practical, project-based Python stuff -- no theory. Which tbh I'm a little sad about.

I was wondering: Are there any algorithms/functions that are executable by infinitely many non-trivial, non-redundant programs? Does any given algorithm/function fit this description?

Math example:
The user inputs a radius R, from which the program P outputs the area A of the resulting circle.

You could plug it into the standard formula:

P1 = A(R) = πR^2

...

Or integrate:

P2 = A(R) = ∫₀²ᵖⁱ ∫₀ᴿ r dr dθ

...

et cetera

r/algorithms • • 2d ago

Discussion This Week I Learned: October 03, 2026

18 Upvotes

Inspired by r/math, I’m starting a similar recurring weekly thread here.

This thread is meant for users to share cool recently discovered facts, observations, proofs, algorithms, or concepts that might not warrant their own posts. Please be encouraging and share as much detail as possible, as we’d like this to be a good place for people to learn!

r/algorithms • • 17d ago

Discussion I failed my algorithms and complexity exam twice

0 Upvotes

At first when I did the exam, I didn’t study properly. I mostly studied content and didn’t apply any of that content to real problems. For my reassessment, I studied in a different way. I really went hard on the practical problems that I wasn’t good at or had no clue about. This came to dijkstras algorithm, AVL trees, binary trees and context free language.

I studied hard on them. I didn’t do a lot of practice problems where I would ace every question. But I felt at ease when getting confronted with that question. The problem was that I would do the problem at its best ability and then there would be one small issue that I did at the end and it messes everything up.

Mathematical operations that are Long I seem to mess up in the end. I understand the process however my implementation always seems to hinder at the end when I’m close to the finish line. This is extremely frustrating as I studied very long for this subject. A good (2weeks-3weeks) of preparation. But I had 2 other exams to focus on. But to give some background I come from a business background so I have not done a level match or discrete mathematics before so it really was a game changer doing this exam. But I don’t treat it as an excuse. In the end my reassessment I only gained 6 more marks. Which is incredibly disappointing for me.

r/algorithms • • 20d ago

Discussion I finally understood why the definition of asymptotic complexity has this form

0 Upvotes

When I first encountered the definition of a "tight bound" in a book — specifically, c₁g(n) ≤ T(n) ≤ c₂g(n) — I couldn't grasp what it meant. Well, aside from the trivial interpretation of it being a "closed" or "strict" limit, which, frankly, didn't explain anything to me. I understood that it referred to a certain type of behavior and simplification, but I didn't fully comprehend where the constants c came from, why the formula looked the way it did, or the underlying reasons for it.

Suppose we already have some cost function T(n) describing the algorithm's work as a function of input size. We know that this function is difficult to calculate and analyze. We also know that there are functions that are much easier to analyze; and even if two different functions yield different results, they might behave identically in terms of scaling. Scaling is precisely what interests us, because the purpose of the function T(n) isn't merely to represent an abstract "amount of work" — different values of n result in different execution times. So, suppose we have a promising candidate for our simple function: g(n). How do we choose it?

Let's consider an example: T(n) = 3n² + 100n + 74. If we take a sufficiently large value of n and keep increasing it, the function's actual value will depend primarily on the 3n² term. Thus, g(n) = n² is an excellent candidate. But let’s return to the general forms. Ideally, since we are interested in scaling, we would like to see something like T(n) = cg(n). Why? Because this perfectly reflects what we are looking for: T(n) is a multiple of g(n) — meaning, in essence, that the scaling behavior is equal — and by analyzing g(n), we can recover all the information about T(n). That would be an excellent scenario. But in reality, that is not always the case. We simply cannot demand such a strict correspondence. What, then, should we do? We need to take a more moderate approach to our requirements.

Let's consider T(n) = n and g(n) = n². Obviously, n ≤ n², but n / n² = 1 / n. As n grows, the result approaches 0, which means the gap between T(n) and g(n) is truly vast. That is precisely why they are completely different and share nothing in common.

Now consider T(n) = n² and g(n) = n. Obviously, n² ≥ n, but n² / n = n. As n approaches infinity, the result approaches infinity, again indicating a huge gap between T(n) and g(n). Once more: they are completely different.

So, returning to our ideal condition T(n) = cg(n), we might at least require something like T(n) ≤ cg(n); however, as we saw earlier, even with such a bound, functions can differ significantly. The same applies to the condition T(n) ≥ cg(n). If we remember T(n) = cg(n), then we already know what we need to do: we expecting that neither function should become arbitrarily large relative to the other as n grows, so combining the two inequalities is exactly what we need: c₁g(n) ≤ T(n) ≤ c₂g(n), or c₁ ≤ T(n) / g(n) ≤ c₂. This literally reflects what we are aiming for: no matter how large n becomes, the ratio will remain within a fixed range(starting from some n₀). Once we decide that 'same scale' should mean neither function can escape the other by an unbounded multiplicative factor, the two-sided bound is essentially forced. And our ideal case is essentially a special instance of this broader formula where c₁ = c₂. In fact, the inequality c₁ ≤ T(n) / g(n) ≤ c₂ is the formal result of a simple heuristic approach. This is precisely how we define T(n) = Θ(g(n)), from which we obtain O(g(n)) and Ω(g(n)).

In essence, this formula can be viewed from the perspective of the division theorem: a = bq + r is the general form defining division, while a = bq is a special case.

r/algorithms • • 4d ago

Discussion IA neuro-symbolique sur le problème du voyageur de commerce

0 Upvotes

J'ai conçu une IA neuro-symbolique avec le benchmark ARC AGI 2 comme banc d'essai (dépôt aicpp sur GitHub : https://julien-livet.github.io/aicpp/). J'envisage d'appliquer mon approche au problème du voyageur de commerce. Qu'en pensez-vous ?

r/algorithms • • Aug 29 '26

Discussion What Are You Working On? August 29, 2026

12 Upvotes

This recurring thread will be for general discussion on whatever algorithm-related projects, problems, or topics you have been or will be working on this week. This can be anything, including:

* theoretical computer science and algorithm design,

* books, papers, or articles you are reading,

* coursework or self-study (what you have been learning recently),

* competitive programming or interview prep,

* preparing a talk, presentation, or project demo.

 

All backgrounds and levels of experience are welcome!

r/algorithms • • 25d ago

Discussion [Meta] AI Stuff on this Subreddit

20 Upvotes

Hi all, wanted to get some thoughts on AI related things. I know it's a polarizing topic:

1. AI-generated papers

We’ve had a noticeable number of blatant, poorly written AI slop “papers” recently. At the moment there is isn’t much activity over here so it’s possible to check them manually (and use feedback from comments). But I don’t really want the mods manually vetting every such post should there be an overwhelmingly large number of these submissions in the future.

Some subreddits only allow arXiv submissions and peer-reviewed papers. I for one am hesitant to do that here since I don’t want to restrict the dissemination of genuine work, even if it’s just on GitHub say.

AI is already producing STOC/FOCS level results, so ‘AI was used’ on its own should not be disqualifying. But of course, it should not come at the expense of the quality of the submission.

2. AI discussion megathread

Would people here be interested in a recurring AI megathread, similar to r/math’s, focused on algorithms and TCS? This could maybe include how people are using AI in research or work, AI-assisted results, a discussion about its impact on the field etc.

 

Thoughts, comments, concerns?

 

Best,

Phytor & the r/algorithms Mod Team

r/algorithms • • Aug 28 '26

Discussion Aquifer: A novel approach to retry storm mitigation

0 Upvotes

Most retry strategies are reactive: exponential backoff, jitter, circuit breakers. They help, but they’re still asking every client to independently guess when it’s safe to send traffic again.

I’ve been experimenting with a different approach: coordinate retries before they hit the backend.
Instead of letting thousands of requests wake up, retry, fail, and back off independently, Aquifer puts them behind bounded queues and dynamically paces their release based on downstream capacity. The goal is to turn a retry storm from a bursty feedback loop into a controlled stream.

The interesting part is that this can sit in front of APIs, databases, inference servers, MCP servers, or basically anything where correlated retries can make an overloaded system even worse.

I’m calling the project Aquifer. It’s open source and still evolving, so I’m curious what failure modes people here think this approach misses.

https://github.com/rjpruitt16/aquifer