News for hackers. Stuff that matters.

klamike

Re:Interactive Linear Programming in the Browser on Sunday October 18, 2026 @01:51PM (#50143475)
Fair, good point :)
Re:Interactive Linear Programming in the Browser on Sunday October 18, 2026 @01:48PM (#50143435)
> A fun fact which is not so difficult to prove in 2 dimensions is that if a linear program has an optimal point (guaranteed when the constraints define a convex polytope), then the minimum objective value will be achieved at one of the vertices of the polytope.

That is, if you assume there is no dual degeneracy :) https://lpviz.net/?s=AsEABN_FCIDiCQC_ixGg4BQAAMCLEYCS9AEAZAA

Re:Interactive Linear Programming in the Browser on Sunday October 18, 2026 @01:40PM (#50143354)
lpviz visualizes how different linear programming (LP) solver algorithms arrive at their solution, and how they react to adjustments in the problem definition. To start using lpviz you first draw a number of vertices to define the so-called feasible region. Then you point the objective arrow, defining the improvement direction. The answer/optimal point is the point furthest along the improvement direction, while still being inside the feasible region.

LP finds applications in tons of downstream fields, though the typical real-world problem has thousands to millions of variables (whereas lpviz is limited to 2) and constraints. Courses typically focus on how to model real-world problems as LP, instead of diving into how the solvers work. lpviz tries to fill that gap, so you can develop some intuition for how the different algorithms work.

There's tons of great videos/lectures introducing LP, this two-minute one is pretty good: https://www.youtube.com/watch?v=7ZjmPATPVzI

Re:Interactive Linear Programming in the Browser on Sunday October 18, 2026 @11:46AM (#50142089)
Thanks! Yeah this is something I've been thinking about, agreed it could be really cool. Just not quite sure on the UX yet, perhaps a separate site (i.e. lpviz.net/step, like the in-progress 3-variable mode https://0b2df09c-lpviz.michael-4e4.workers.dev/3d) that uses some LaTeX animations to show the actual calculations of each step..
Re:Interactive Linear Programming in the Browser on Sunday October 18, 2026 @11:40AM (#50142024)
Thanks for the suggestion, always looking to add more solvers. Here's a share link to a branch that adds criss-cross and a proximal primal-dual active set, animating criss-cross looks pretty cool on the Many Facets preset:

https://9b7c882e-lpviz.michael-4e4.workers.dev/?s=AtUAHIDTDg...

Show HN: lpviz – Interactive linear programming visualization in the browser

https://lpviz.net/

https://github.com/lpviz/lpvizVisualize linear programming solvers - Simplex, Interior Point, PDHG, and Central Path - in the browser. Drag the objective/vertices/constraints around and watch the solver trajectory respond in real time. Enter 3D mode to view solver metadata (like centrality for IPM or KKT residual for PDHG) on the z-axis. Always happy to get feedback and feature requests, one...

( Read More... | 1 comment | 6 points | on HN )
Re:Algorithms for Optimization [pdf] on Monday December 01, 2025 @12:53PM (#46110554)
Thanks! I’m glad you enjoyed it. You may also get a kick out of the YouTube hyperlinks in the GitHub readme, especially the advanced methods for establishing convexity one :)
Re:Algorithms for Optimization [pdf] on Sunday November 30, 2025 @08:57PM (#46102609)
Great to see optimization on the front page of HN! One thing I love about the book is it's full of really nice figures. If like me you love visualizations, you may enjoy this website I've been working on to visualize linear programming (LP) solvers: https://lpviz.net.

It's by no means polished, but it can be pretty fun to play around with, visualizing how the iterates of different LP algorithms (described in sections 11, 12 of the book) react to changes in the feasible region/objective, by just dragging the vertices/constraints around.

If you go to https://lpviz.net/?demo it will draw a polytope for you, and click around the interface to show off some of the features. I'm constantly chipping away at it in my free time, I welcome any feedback and suggestions!

Re:Ask HN: What Are You Working On? (October 2025) on Monday October 13, 2025 @12:45AM (#45564749)
https://lpviz.net/

lpviz is like Desmos, but for linear programming - I've implemented a few LP solvers in Typescript and hooked them up to a canvas so you can draw a feasible region, set an objective direction, and see how the algorithms work. And it all runs locally, in the browser!

If you go to https://lpviz.net/?demo it should show you a short tour of the features/how to use it.

It's by no means complete but I figured there may be some fellow optimization enthusiasts here who might be interested to take a look :) Super open to feedback, feature requests, comments!

For a 2-min intro to LP, I recommend https://www.youtube.com/watch?v=7ZjmPATPVzI