r/optimization • • Jul 20 '26

Optimal sugarcane farm layout in Minecraft using CP-SAT - 13% better

Post image
673 Upvotes

Sugarcane in Minecraft only grows next to water, so farm layout is really a 2D coverage problem: where do you place water to maximize adjacent plantable tiles?

Each water tile can cover up to 4 neighbors, which caps theoretical max coverage at 80% regardless of arrangement. I modeled this as an integer program (CP-SAT via OR-Tools) to find the actual optimal layout for a given terrain shape.

Results for a 9x9 square plot:

  • Community-standard pattern: 66.7% coverage

  • Optimal (CP-SAT): 75.3% coverage (94% of theoretical max)

The symmetric square case is the easy comparison point against human intuition. What's more interesting is irregular terrain with obstacles, where there's no established heuristic and the exact solver is the only way to get a real answer - including one case (unconstrained/open terrain) where the solver converges to a hexagonal-ish pattern and actually hits the 80% theoretical ceiling.

Code + more examples (different grid sizes, obstacle terrain, other crops) in the repo: https://github.com/Serranegra/optifarm

Curious if anyone here has tackled similar tiling/coverage problems. Happy to share the formulation details if useful.


r/optimization • • Jan 07 '26

I got paid minimum wage to optimize an impossible problem (and accidentally learned why most algorithms make life worse)

255 Upvotes

I was sweeping floors at a supermarket and decided to over-engineer it.

Instead of just… sweeping… I turned the supermarket into a grid graph and wrote a C++ optimizer using simulated annealing to find the “optimal” sweeping path.

It worked perfectly.

It also produced a path that no human could ever walk without losing their sanity. Way too many turns. Look at this:

Turns out optimizing for distance gives you a solution that’s technically correct and practically useless.

Adding a penalty each time it made a sharp turn made it actually walkable:

But, this led me down a rabbit hole about how many systems optimize the wrong thing (social media, recommender systems, even LLMs).

If you like algorithms, overthinking, or watching optimization go wrong, you might enjoy this little experiment. More visualizations and gifs included! Check comments.


r/optimization • • Jan 12 '26

For 4 years, I've built a Genetic Algorithm-backed app for generating travel itineraries with a "Rick Steves" view of Europe (tripsnek)

67 Upvotes

r/optimization • • Sep 02 '26

Looking for study partners — MIT 6.7220 Nonlinear Optimization

56 Upvotes

I'm working through MIT OCW 6.7220 Nonlinear Optimization (Spring 2025) and looking for 2–5 people who want to follow the course together.

The goal would be:

  • watch lectures according to the course schedule

  • independently attempt each problem set

  • meet online once/twice a week

  • discuss difficult problems and compare approaches

  • explain proofs/optimization theory to each other

  • work through the material over ~8–12 weeks

Topics include convex optimization, optimality conditions, Lagrange multipliers, KKT, duality, gradient/Newton methods, etc.

I'm particularly interested in people doing mathematical optimization / numerical optimization / operations research / ML / control.

If interested, comment or DM me and we can create a Discord/WhatsApp/Telegram group.

Edit : This course does not have any videos or you won't find much material else where to watch . You have to be okay putting your time to read and analyse and think and do some arguments.

Edit 2 : surprising number of people want to join my discord server which is nice , that is why I will post the link here just click it and join https://discord.gg/rMqqj2GmY


r/optimization • • Jan 12 '21

Stephen Boyd's tricks for analyzing convexity

52 Upvotes

I saw this today and it made me smile. https://youtu.be/ijD2KSXWDyo


r/optimization • • Mar 20 '25

NVIDIA open-sources cuOpt. The era of GPU-accelerated optimization is here.

50 Upvotes

r/optimization • • Aug 06 '21

I have finally finished my video series on Convex Optimization. The last video explains the KKT conditions and how they relate to the Interior Point Method.

Thumbnail
youtube.com
41 Upvotes

r/optimization • • Jul 31 '20

What is the best deal?

Post image
39 Upvotes

r/optimization • • Jun 09 '26

Announcing oximo: Mathematical Optimization Modeling in Rust

33 Upvotes

Hi!

I've been working on oximo, a mathematical optimization modeling framework for Rust (https://github.com/oximo-rs/oximo).

The library lets users formulate and solve optimization problems in Rust using a high-level modeling API, similar to tools like Pyomo (Python), JuMP (Julia), or GAMS.

oximo supports modeling and solving:

  • Linear Programming (LP)

  • Mixed-Integer Linear Programming (MILP)

  • Quadratic Programming (QP)

  • Nonlinear Programming (NLP)

  • Mixed-Integer Nonlinear Programming (MINLP)

Example:

let m = Model::new("transport");
let x = m.var("x").lb(0.0).build();
let y = m.var("y").lb(0.0).ub(4.0).build();

m.constraint("c1", (x + 2.0 * y).le(14.0));
m.constraint("c2", (3.0 * x).ge(y));
m.constraint("c3", x.le(y + 2.0));
m.maximize(3.0 * x + 4.0 * y);

let result = Highs.solve(&m, &HighsOptions::default())?;

I'd like to get feedback on the API design, modeling ergonomics and solver integrations you'd like to see. Future releases will have integration with more solvers, autodiff, GDP, Polars integration, and better docs.

Contributions, bug reports, and feature requests are welcome.

Links:


r/optimization • • Nov 02 '22

Books on Optimization

33 Upvotes

Can anyone suggest books from basic to advance as well as online lectures on Optimization. Currently a PhD student and like to work in this domain.


r/optimization • • Jan 06 '23

The Evolutionary Computation Methods No One Should Use

32 Upvotes

So, I have recently found that there is a serious issue with benchmarking evolutionary computation (EC) methods. The ''standard'' benchmark set used for their evaluation has many functions that have the optimum at the center of the feasible set, and there are EC methods that exploit this feature to appear competitive. I managed to publish a paper showing the problem and identified 7 methods that have this problem:

https://www.nature.com/articles/s42256-022-00579-0

Now, I performed additional analysis on a much bigger set of EC methods (90 considered), and have found that the center-bias issue is extremely prevalent (47 confirmed, most of them in the last 5 years):

https://arxiv.org/abs/2301.01984

Maybe some of you will find it useful when trying out EC methods for black-box problems (IMHO they are still the best tools available for such problems).


r/optimization • • Sep 22 '26

How do researchers verify that a new mathematical result is actually correct?

30 Upvotes

For people working in numerical analysis, numerical linear algebra, or optimization:

Suppose you develop a new theorem, lemma, error bound, stability argument, or related mathematical result for a research paper.

How do you independently check that:

  1. the statement is actually true, and

  2. the proof has no hidden assumptions or subtle gaps?

I’m especially interested in practical and reproducible ways of doing this, rather than simply having another person read the proof.

Are there established tools, workflows, or techniques that can help with this? How much of the process can realistically be automated?

I’d be particularly interested in hearing how researchers handle this for their own research.


r/optimization • • Feb 15 '21

Easy access to theoretical optimization knowledge - Optimization Geeks

29 Upvotes

Hey Geeks,

we've created a Youtube Channel (https://www.youtube.com/channel/UCJaL6SBbC7XaP7BbWKbR5nA) to explain the topic of optimization and solve problems in a simple and understandable way.

With our passion for mathematical Optimization, we want to give you easy access to theoretical knowledge and potential applications for these approaches. It all started when I started to optimize and realized that the theoretical knowledge was there in papers but was hard to process. That’s why I started to do videos to easily explain how optimizers work (i.e. NGSA-II).

Stop by and give feedback or ask me your questions - and never forget, keep optimizing!!


r/optimization • • Aug 17 '21

Learn how DoorDash solves the dispatch problem using ML and optimization

28 Upvotes

If you are interested in applications of mixed-integer programming in industry, then you will enjoy this new article I wrote on the DoorDash engineering blog “Using ML and Optimization to Solve DoorDash’s Dispatch Problem.” The article takes a deep dive under the hood of DoorDash’s logistics platform. We discuss the unique factors we have to consider in our dispatch problem and how we optimize over a variety of data inputs, including predictions from our ML models, to ensure speedy deliveries and maximize opportunities for Dashers. Check it out! https://doordash.engineering/2021/08/17/using-ml-and-optimization-to-solve-doordashs-dispatch-problem/


r/optimization • • Jun 09 '22

Optimization with Python

27 Upvotes

Hi all. If anyone is interested in using Python to solve optimization problems, you may find my blog of interest:

https://dukesexplorations.blogspot.com/


r/optimization • • Jul 16 '21

Visually Explained: Convex Optimization | Part 2: Convexity and The Principle of Duality

Thumbnail
youtube.com
27 Upvotes

r/optimization • • Aug 25 '26

How to test if your numerical code is mathematically correct?

26 Upvotes

I contribute to SciPy and kept running into a class of bug that annoys me: the outputs look plausible, the tests pass, but the equation the code implements is subtly wrong. So I've been building a tracer that runs Python/NumPy code and hands back whatever mathematics it actually computed, as a SymPy expression you can simplify or differentiate like anything else.

It's been more useful than I expected. Comparing an implementation against the formula in a paper, catching two functions that agree on my test data but turn out to compute different things, digging up the inputs my tests never hit (ties, zero denominators). It traces real library code too, most of numpy and a good chunk of scipy, scikit-learn, statsmodels, cvxpy.

Write-up: https://medium.com/@aadyachinubhai/scikit-verify-translate-python-numpy-programs-to-symbolic-mathematics-c664d41ba571

Github: https://github.com/aadya940/scikit-verify

Still rough in places, would genuinely like feedback. There may be other better solutions, happy to hear them as well!


r/optimization • • Apr 01 '25

Optimization of LEDs for uniform light on surface

Thumbnail
gallery
26 Upvotes

So I have this problem where i want to make a pattern of LEDs such that the most uniform light is achieved within an area on a plane 5cm away. I can't change the power of the LEDs individually and I can't change the radiation pattern of the LEDs. So all I can do is distribute the LEDs within a 40×40 cm area to achieve the most uniform distribution within a 20×20 cm area 5 cm away from the LED plane. I havr tried different methods but havent found a good way still, the closest I have gotten is the picture below but that was not with my real radiation pattern. I want to use between 100-200 LEDs which also makes it a fairly computationally large problem atleast with the things I have tried. Does anyone know of this having been solved somewhere else or have a good idea for it?


r/optimization • • Sep 16 '24

Join the Optimization challenge and win prizes 🏆

25 Upvotes

Welcome to the Practical Optimization Sprint! 🚀

We (Cristina Radu, PhD, Carlos Armando Zetina, Ph.D., and I -Borja Menéndez-) are a lively group of Operations Research professionals who 🫶 love connecting with fellow OR enthusiasts through LinkedIn discussions or our online optimization courses.

To add some excitement, we are launching a series of 5 events designed to showcase OR from various viewpoints while creating a fun, competitive atmosphere with a chance to win one of ten prizes 🏆 adding up to $1000!

We recognize a disconnect between academic theory and real-world optimization challenges. There is a need for greater visibility regarding practical applications of OR. And we believe that engaging with one another will enhance our collective knowledge and professional skills.

We warmly invite you to join us from September 30th to October 4th for a lively exploration of the world of Operations Research!

👉 https://theoptimizationchallenge.com/

Here’s what you can expect in 📅 the agenda:

🌯 Monday, September 30th: Kick off the week with the Burrito Optimization Game, a hands-on activity designed to challenge your problem-solving abilities and introduce you to the fun world of optimization.

🎤 Tuesday, October 1st: Get inspired by a video interview featuring a leader in Operations Research from Amazon. Gain valuable insights into the complexities of implementing optimization on a large scale.

📗 Wednesday, October 2nd: Explore the Playbook of Practical Operations Research, a detailed guide that will provide you with a robust toolkit of strategies, methodologies, and best practices for addressing complex challenges in your optimization projects.

🔄 Thursday, October 3rd: Participate in a live Zoom session where we discuss end-to-end OR project management. Share your experiences in scoping, formulating, solving, and deploying optimization solutions, and receive feedback from the organizers of the optimization sprint.

💼 Friday, October 4th: Conclude the week with a live Career Panel on Zoom. We will share personal insights about our operations research journey, industry trends, and strategies for thriving in this dynamic field.

Moreover, by actively engaging in the sprint, you can earn points and have the opportunity to win one of our ten prizes:

You win points starting NOW by sharing this announcement on LinkedIn (repost with your thoughts) and leaving comments (check out the welcome email).

For further information about the points system, please visit our website. Remember to sign up previously!

👉 https://theoptimizationchallenge.com/

Don’t miss this opportunity to broaden your perspective about practical operations research and gain a competitive advantage.

Join us today and prepare to learn more about optimization in the real world!

We extend our gratitude to our wonderful sponsors: Bluecrux, Nextmv, and Gurobi Optimization!


r/optimization • • Jul 30 '26

Optimization Jobs

24 Upvotes

I’m currently working as an optimization engineer at a logistics company, and I really enjoy my job. But I think there’s a limit to how much we can optimize problems at this company—at some point, there won’t be any more optimization projects left for us there. Am I wrong? In other words, if OR projects come to an end at one company, should we look for OR positions at another company, or do you think we should transition to different job titles? What do those who have worked in optimization in the private sector for a long time think?


r/optimization • • Jun 28 '21

Visually Explained: Convex Optimization | Part 1: What Is Optimization?

Thumbnail
youtube.com
24 Upvotes

r/optimization • • Aug 23 '26

I built an open-source university course timetabling solver

Thumbnail
github.com
23 Upvotes

I’ve been working on KAIROS, a university course timetabling system written in Python.

It takes course and room data and builds a weekly schedule while enforcing constraints such as room capacity, instructor availability, lab requirements, fixed sessions, and double-booking. Once it finds a feasible timetable, it tries to improve practical details such as student idle gaps, late classes, room stability, and instructor schedules.

The solver uses OR-Tools CP-SAT, followed by repair and local-search stages. The final timetable is checked by a separate validator rather than being accepted directly from the solver.

There is a bilingual web interface, a command-line version, sample data, and CSV, JSON, and PDF export. The optimization model is also documented in the repository.

Live demo: https://kairos.huguryildiz.com
Source: https://github.com/huguryildiz/KAIROS

The project is MIT-licensed. I’d be interested in feedback from anyone working on timetabling, constraint programming, or university scheduling, particularly regarding missing real-world constraints.


r/optimization • • Jul 22 '26

Combining Bayesian Probabilistic Forecasting and Mathematical Optimization for Stochastic Energy Planning webinar available on YouTube

23 Upvotes

Dear Optimization Community,

Our friends at PyMC Labs and colleagues at FICO hosted a free online webinar to accompany the blog post and open-source repo that bridges Bayesian Forecasting and Optimization through an energy planning use case.

If you were unable to catch it, we have now uploaded it to YouTube so you can view it on your time.

In the webinar, we discuss the strengths and weaknesses of two approaches to combining these frameworks.

  1. Chance-Constrained: Meet the 95th percentile demand. Simple. Deterministic. But ignore what happens in the tail.

  2. CVaR (Conditional Value-at-Risk): Minimize cost in the worst 5% of scenarios. Explicitly controls tail risk.

Happy Optimizing!

Link to the video on YouTube: https://www.youtube.com/watch?v=aWnukair33Q

Link to the blog post: https://www.pymc-labs.com/blog-posts/probabilistic-forecasting-optimization-under-uncertainty

Link to the repo: https://github.com/fico-xpress/xpress-community/tree/main/StochasticEnergyPlanning


r/optimization • • Aug 07 '26

What are some real world optimization problems that need to be solved?

22 Upvotes

I would like to learn about real-world problems that no one has yet taken up, or could be solved better. Or even mathematical problems (like np hard ones) that have good applications.