frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Linear Programming for Fun and Profit

https://modal.com/blog/resource-solver
41•hmac1282•12h ago

Comments

ayhanfuat•6h 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•6h ago
It's the answer, a vector of integers
ayhanfuat•6h ago
Simplex cannot give a vector of integers though, unless the constraint matrix is unimodular. Maybe the integrality constraint was relaxed.
cweld510•6h 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•6h 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•6h 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•6h 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
cweld510•6h 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•6h 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.
underanalyzer•6h 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•5h 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•10m 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

ALICE detects the conversion of lead into gold at the LHC

https://www.home.cern/news/news/physics/alice-detects-conversion-lead-gold-lhc
400•miiiiiike•6h ago•216 comments

What's New in Swift 6.2?

https://www.hackingwithswift.com/articles/277/whats-new-in-swift-6-2
19•ingve•41m ago•5 comments

Launch HN: Nao Labs (YC X25) – Cursor for Data

87•ClaireGz•4h ago•41 comments

Sofie: open-source web based system for automating live TV news production

https://nrkno.github.io/sofie-core/
223•rjmunro•7h ago•30 comments

21 GB/s CSV Parsing Using SIMD on AMD 9950X

https://nietras.com/2025/05/09/sep-0-10-0/
204•zigzag312•7h ago•96 comments

Past, present, and future of Sorbet type syntax

https://blog.jez.io/history-of-sorbet-syntax/
85•PaulHoule•4h ago•46 comments

Inventing the Adventure Game (1984)

http://www.warrenrobinett.com/inventing_adventure/
35•CaesarA•2h ago•2 comments

New Tool: lsds – List All Linux Block Devices and Settings in One Place

https://tanelpoder.com/posts/lsds-list-linux-block-devices-and-their-config/
39•mfiguiere•2h ago•5 comments

Show HN: Oliphaunt – A native Mastodon client for macOS

https://testflight.apple.com/join/Epq1P3Cw
59•anosidium•4h ago•23 comments

Reverse Engineering "DNA Sequences" in the Lost World: Jurassic Park Video Game

https://32bits.substack.com/p/under-the-microscope-the-lost-world
23•bbayles•2d ago•1 comments

Itter.sh – Micro-Blogging via Terminal

https://www.itter.sh/
147•rrr_oh_man•7h ago•49 comments

Show HN: A backend agnostic Ruby framework for building reactive desktop apps

https://codeberg.org/skinnyjames/hokusai
52•zero-st4rs•5h ago•19 comments

Why 536 was 'the worst year to be alive' (2018)

https://www.science.org/content/article/why-536-was-worst-year-be-alive
51•Jimmc414•1h ago•8 comments

Rollstack (YC W23) Is Hiring TypeScript Engineers (Remote US/CA)

https://www.ycombinator.com/companies/rollstack-2/jobs/QPqpb1n-software-engineer-typescript-us-canada
1•yjallouli•4h ago

Show HN: Aberdeen – An elegant approach to reactive UIs

https://aberdeenjs.org/
158•vanviegen•8h ago•88 comments

In the Network of the Conclav: How we "guessed" the Pope using network science

https://www.unibocconi.it/en/news/network-conclave
83•taubek•3h ago•55 comments

LegoGPT: Generating Physically Stable and Buildable Lego

https://avalovelace1.github.io/LegoGPT/
530•nkko•16h ago•135 comments

All BART trains were stopped due to ‘computer networking problem’

https://www.kqed.org/news/12039472/bart-shuts-down-entire-train-service-due-to-computer-networking-problem
139•ksajadi•6h ago•99 comments

Show HN: Hyvector – A fast and modern SVG editor

https://www.hyvector.com
221•jansan•10h ago•49 comments

Rust’s dependencies are starting to worry me

https://vincents.dev/blog/rust-dependencies-scare-me/?
73•chaosprint•11h ago•74 comments

Show HN: BlenderQ – A TUI for managing multiple Blender renders

https://github.com/KyleTryon/BlenderQ
37•TechSquidTV•4h ago•3 comments

NSF faces shake-up as officials abolish its 37 divisions

https://www.science.org/content/article/exclusive-nsf-faces-radical-shake-officials-abolish-its-37-divisions
369•magicalist•8h ago•475 comments

CryptPad: An Alternative to the Google Suite

https://cryptpad.org/
122•ColinWright•9h ago•32 comments

The birth of AI poker? Letters from the 1984 WSOP

https://www.poker.org/latest-news/the-birth-of-ai-poker-letters-from-the-1984-wsop-a4v2W4N4X3EP/
38•indigodaddy•4d ago•11 comments

Odin, a Pragmatic C Alternative with a Go Flavour

http://bitshifters.cc/2025/05/04/odin.html
18•hmac1282•3h ago•6 comments

Math Machine – A notebook will show your kid how far they have travelled

https://kidswholovemath.substack.com/p/math-machine
6•sebg•3d ago•0 comments

Cell Mates: Extracting Useful Information from Tables for LLMs

https://www.gojiberries.io/cell-mates-extracting-useful-information-from-tables-for-llms/
19•goji_berries•3d ago•1 comments

Graphcore unveils GC200 and M2000 IPU Machine–1 petaFLOP "pizza box" AI server

https://www.graphcore.ai/articles/graphcore-unveils-new-gc200-chip-and-the-expandable-m2000-ipu-machine-that-runs-on-them
7•bit_qntum•54m ago•0 comments

Data manipulations alleged in study that paved way for Microsoft's quantum chip

https://www.science.org/content/article/data-manipulations-alleged-study-paved-way-microsoft-s-quantum-chip
170•EvgeniyZh•9h ago•124 comments

"Night of the Living Dead" accidentally became public domain (2019)

https://screenrant.com/night-living-dead-movie-public-domain-copyright-accident/
53•edavis•3d ago•57 comments