frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Linear Programming for Fun and Profit

https://modal.com/blog/resource-solver
62•hmac1282•10mo ago

Comments

ayhanfuat•10mo ago
> X = [x1, ..., Xn]: instances of each type to launch

Is this a continuous variable? Seems discrete to me. I am surprised it is solved by simplex.

Frummy•10mo ago
It's the answer, a vector of integers
ayhanfuat•10mo ago
Simplex cannot give a vector of integers though, unless the constraint matrix is unimodular. Maybe the integrality constraint was relaxed.
cweld510•10mo ago
You're right -- we do relax the integrality constraint, gaining performance at the expense of some precision, and we're generally able to paper over the difference at scheduling time. We've investigated integer linear programming for some use cases, but for solves to run quickly, we have to constrain the inputs significantly.
ayhanfuat•10mo ago
Thanks for the clarification. I guess it wouldn’t matter much if the numbers are large. Initially I thought they were mostly ones and zeros.
stncls•10mo ago
If this is business critical for you, you may want to switch to a faster solver. Glop is very nice, but it would be reasonable to expect a commercial solver (Gurobi, XPress, COpt) to be 60x faster [1]. By the same measure, the best open source solvers (CLP, HiGHS) are 2-3x faster than Glop.

Actually, the commercial solvers are so fast that I would not be surprised if they solved the IP problem as fast as Glop solves the LP. (Yes, the theory says it is impossible, but in practice it happens.) The cost of a commercial solver is 10k to 50k per license.

[1] ... this 60x number has very high variance depending on the type of problem, but it is not taken out of nowhere, it comes from the Mittelmann LP benchmarks https://plato.asu.edu/ftp/lpopt.html There are also benchmarks for other types of problems, including IP, see the whole list here: https://plato.asu.edu/bench.html

petters•10mo ago
If you are able to paper over the fractional numbers and get a usable solution, an integer solver should also be able to find a feasible solution easily. Perhaps not optimal, but better than just solving the LP and rounding
hustwindmaple1•10mo ago
You are basically doing a heurstic. Your solutions are not guaranteed to be optimal. Integer programming is the way to do.
cweld510•10mo ago
Great to see this post here -- really enjoyed writing it! I think it's really cool how an algorithm from an operational research context can play a critical role in a high-availability large-scale cloud service.
sumtechguy•10mo ago
LP is a shockingly good way to optimize a system. If you can put inputs/outputs into the correct form. Had an econ prof that loved these things for doing supply/demand maxima and minimum finding. He didnt outright say it but I think it was his current line of study when I was taking classes from him the 90s. I thought that, as he managed to bring it up in every class he taught.
Onavo•10mo ago
Well, kantorovich did win the Nobel for inventing that.
underanalyzer•10mo ago
Neat article. I do wish it mentioned that there are polynomial time algorithms to solve linear programming problems. According to the Google ortools docs it has the option to use those as well (but not with the GLOP solver). Might be good for when simplex is struggling (https://developers.google.com/optimization/lp/lp_advanced)
stncls•10mo ago
You're right, but it's very subtle and complicated.

In theory, the simplex method is not known to be polynomial-time, and it is likely that indeed it is not. Some variants of the simplex method have been proven to take exponential time in some worst cases (Klee-Minty cubes). What solvers implement could be said to be one such variant ("steepest-edge pricing"), but because solvers have tons of heuristics and engineering, and also because they work in floating-point arithmetic... it's difficult to tell for sure.

In practice, the main alternative is interior-point (aka. barrier) methods which, contrary to the simplex method, are polynomial-time in theory. They are usually (but not always) faster, and their advantage tends to increase for larger instances. The problem is that they are converging numerical algorithms, and with floating-point arithmetic they never quite 100% converge. By contrast, the simplex method is a combinatorial algorithm, and the numerical errors it faces should not accumulate. As a result, good solvers perform "crossover" after interior-point methods, to get a numerically clean optimal solution. Crossover is a combinatorial algorithm, like the simplex method. Unlike the simplex method though, crossover is polynomial-time in theory (strongly so, even). However, here, theory and practice diverge a bit, and crossover implementations are essentially simplified simplex methods. As a result, in my opinion, calling iterior-point + crossover polynomial-time would be a stretch.

Still, for large problems, we can expect iterior-point + crossover to be faster than the simplex method, by a factor 2x to 10x.

There is also first-order methods, which are getting much attention lately. However, in my experience, you should only use that if you are willing to tolerate huge constraint violations in the solution, and wildly suboptimal solutions. Their main use case is when other solvers need too much RAM to solve your instance.

underanalyzer•10mo ago
Very interesting! Thanks for the reply. I wonder if they tried these other solvers and decided they were either too slow b/c their problems were too small or the answers were too inaccurate
Onavo•10mo ago
The most interesting question is how you scrape the prices. The cloudprovider really need to provide an API.

We intercepted the White House app's traffic. 77% of requests go to 3rd parties

https://www.atomic.computer/blog/white-house-app-network-traffic-analysis/
103•donutpepperoni•1h ago•29 comments

The Claude Code Source Leak: fake tools, frustration regexes, undercover mode

https://alex000kim.com/posts/2026-03-31-claude-code-source-leak/
898•alex000kim•14h ago•365 comments

TinyLoRA – Learning to Reason in 13 Parameters

https://arxiv.org/abs/2602.04118
94•sorenjan•4d ago•8 comments

TruffleRuby

https://chrisseaton.com/truffleruby/
61•tosh•3d ago•3 comments

A dot a day keeps the clutter away

https://scottlawsonbc.com/post/dot-system
184•scottlawson•6h ago•62 comments

U.S. exempts oil industry from protecting Gulf animals, for 'national security'

https://www.npr.org/2026/03/30/nx-s1-5745926/endangered-species-committee-hegseth-security
154•Jimmc414•2h ago•60 comments

Ministack (Replacement for LocalStack)

https://ministack.org/
156•kerblang•6h ago•30 comments

Show HN: 1-Bit Bonsai, the First Commercially Viable 1-Bit LLMs

https://prismml.com/
132•PrismML•6h ago•58 comments

OpenAI closes funding round at an $852B valuation

https://www.cnbc.com/2026/03/31/openai-funding-round-ipo.html
361•surprisetalk•7h ago•305 comments

Neanderthals survived on a knife's edge for 350k years

https://www.science.org/content/article/neanderthals-survived-knife-s-edge-350-000-years
16•Hooke•2h ago•1 comments

Why Don't You Use String Views Instead of Passing Std:Wstring by Const&

https://giodicanio.com/2024/05/14/why-dont-you-use-string-views-like-std-wstring_view-instead-of-...
15•Orochikaku•2d ago•1 comments

My son pleasured himself on Gemini Live. Entire family's Google accounts banned

https://old.reddit.com/r/LegalAdviceUK/comments/1s92fql/my_son_pleasured_himself_in_front_of_gemi...
70•samlinnfer•1h ago•26 comments

4D Doom

https://github.com/danieldugas/HYPERHELL
145•chronolitus•4d ago•33 comments

Ordinary Lab Gloves May Have Skewed Microplastic Data

https://nautil.us/ordinary-lab-gloves-may-have-skewed-microplastic-data-1279386
71•WaitWaitWha•6h ago•18 comments

Slop is not necessarily the future

https://www.greptile.com/blog/ai-slopware-future
190•dakshgupta•12h ago•340 comments

Open source CAD in the browser (Solvespace)

https://solvespace.com/webver.pl
297•phkahler•14h ago•98 comments

Back to FreeBSD – Part 2 – Jails

https://hypha.pub/back-to-freebsd-part-2
57•vermaden•4d ago•10 comments

Teenage Engineering's PO-32 acoustic modem and synth implementation

https://github.com/ericlewis/libpo32
91•ericlewis•4d ago•22 comments

Cohere Transcribe: Speech Recognition

https://cohere.com/blog/transcribe
169•gmays•10h ago•53 comments

Inside the 'self-driving' lab revolution

https://www.nature.com/articles/d41586-026-00974-2
15•salkahfi•1d ago•1 comments

Learn Something Old Every Day, Part XVIII: How Does FPU Detection Work?

https://www.os2museum.com/wp/learn-something-old-every-day-part-xviii-how-does-fpu-detection-work/
31•kencausey•3d ago•2 comments

I Traced My Traffic Through a Home Tailscale Exit Node

https://tech.stonecharioteer.com/posts/2026/tailscale-exit-nodes/
87•stonecharioteer•7h ago•40 comments

OkCupid gave 3M dating-app photos to facial recognition firm, FTC says

https://arstechnica.com/tech-policy/2026/03/okcupid-match-pay-no-fine-for-sharing-user-photos-wit...
401•whiteboardr•9h ago•81 comments

Why the US Navy won't blast the Iranians and 'open' Strait of Hormuz

https://responsiblestatecraft.org/iran-strait-of-hormuz/
210•KoftaBob•17h ago•548 comments

Axios compromised on NPM – Malicious versions drop remote access trojan

https://www.stepsecurity.io/blog/axios-compromised-on-npm-malicious-versions-drop-remote-access-t...
1790•mtud•1d ago•726 comments

Show HN: Forkrun – NUMA-aware shell parallelizer (50×–400× faster than parallel)

https://github.com/jkool702/forkrun
122•jkool702•4d ago•30 comments

From 300KB to 69KB per Token: How LLM Architectures Solve the KV Cache Problem

https://news.future-shock.ai/the-weight-of-remembering/
91•future-shock-ai•3d ago•7 comments

Show HN: Postgres extension for BM25 relevance-ranked full-text search

https://github.com/timescale/pg_textsearch
107•tjgreen•10h ago•34 comments

GitHub's Historic Uptime

https://damrnelson.github.io/github-historical-uptime/
421•todsacerdoti•8h ago•106 comments

A Primer on Long-Duration Life Support

https://mceglowski.substack.com/p/a-primer-on-long-duration-life-support
85•zdw•5d ago•21 comments