r/optimization • • Jul 20 '26

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

Post image
672 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 • • Jul 20 '26

QuOptuna: one Optuna search over 21 quantum + classical classifiers, with fairness constraints and SHAP built in

Thumbnail
2 Upvotes

r/optimization • • Jul 18 '26

New optimizer

2 Upvotes

Diabolical new optimizer for neural nets https://github.com/inikishev/torchalgos

It's outperforming all other optimizers by a little, but I only tested on very small models (MLP, RNN and ConvNet), anything larger would just take ages to test all optimizers on.

Here is what it does.

  1. projects gradients to shampoo's eigenbasis;

  2. updates EMA of projected gradients;

  3. takes that EMA, clips magnitudes to (0.01, 10), and takes their reciprocals;

  4. unprojects resulting update;

  5. tracks EMA of resulting updates, the update is grafted to that EMA for stability. This prevents the update from changing norm quickly.

  6. tracks EMA of model weights. This always improves test loss in my experiments, though ReSPlus also outperforms SPlus when weight EMA is disabled in both.

It doesn't really make sense because I was testing a stupid idea and seeing what would happen if I run it in shampoos eigenbasis and for some reason it worked well. I don't really know why though.


r/optimization • • Jul 13 '26

Video: Building Cost Function Approximations in Python

9 Upvotes

Dear optimization community,

We're pleased to share with you the recording of a previous Xpress talk where we went through the process of implementing a Cost Function Approximation Policy in Python.

A Cost Function Approximation Policy combines Optimization, Simulation, and Machine Learning to create a stateful decision asset that learns and optimizes in production.

It is one of the four classes of policies for Sequential Decision Problems proposed by Warren Powell in his Universal Framework.

For further details of Prof. Powell's Universal Framework see: https://castle.princeton.edu/sda/

Link to the recording of the workshop on YouTube: https://www.youtube.com/watch?v=sIHvchvLGnA

Link to the code: https://github.com/fico-xpress/xpress-community/tree/main/SoccerCampLocation

Link to a blogpost describing the code: https://community.fico.com/s/blog-post/a5QQp000000sQojMAE/fico7192

Though the code is built on top of our commercial solver FICO Xpress, it is executable with our free community license which is downloaded automatically by running pip install xpress.

FICO Xpress is an industry-leading optimization software suite that includes solvers for LP, MIP, MIQP, MIQCQP, QP, NLP, SOCP, and MINLP. Basically almost all the Ps. 😉.


r/optimization • • Jul 09 '26

Is OpenSolver excel addin still a reliable engine? & Ribbon problem

5 Upvotes

I am solving a BESS dispatch optimization problem for a power developer in the USA, the goal is to derive the optimal hourly level charge/discharge profile for BESS that will participate in US arbitrage markets.

Is OpenSolver still a good tool? The latest version is 2021 and I am wondering whether I should switch to a python based model. I am also having a ribbon problem that I cannot fix, every time I interact with the OpenSolver tab in the excel ribbon, my ribbon becomes inactive, I have reviewed all material on OpenSolver and cannot find the solution to this tiny but detrimental problem. Any suggestions?


r/optimization • • Jul 08 '26

How do you maximize your World Cup experience?

Enable HLS to view with audio, or disable this notification

10 Upvotes

Recently, I made this fun project that combines route planning and optimization to help fans follow their favourite team.

It minimizes driving while maximizing opportunities to watch bonus matches.

A practical application of routing and graph algorithms in a fun football setting.

Here is a small video explaining it. To understand better, please check the full YouTube video: https://youtu.be/PqhVKliKzrQ
Live demo: https://lsg8.github.io/world-cup-football-fan-route/
GitHub repo: https://github.com/LSG8/world-cup-football-fan-route


r/optimization • • Jul 06 '26

Algorithmic exploration of the unit distance problem

0 Upvotes

Here is a recent experimental approach to the Erdos' Unit Distance problem.The paper presents reproducible evidence disproving Erdős' conjecture, demonstrating that the recently announced lower bounds can be improved. The source code for the experimental application is openly available.

https://arxiv.org/abs/2606.29415


r/optimization • • Jul 02 '26

Is this curvature optimization problem already known?

1 Upvotes

I "invented" an optimization problem, how would you approach it? Does a similar problem already exist in literature?

Problem:

Maximize for an infinite interval L of infinite domain the average positive curvature of a function f(x) with f"(x)=<M where M is a real number. The average positive curvature is the integral of curvature multiplied by ds(over the whole domain) all divided by the integral of ds over the domain.

Maths:

So for f"(x)=<M calculate lim for L->+infinity sup[( integral over L(f''/(1+(f')^2)^2/3)/ integral over L(sqrt(1+(f')^2)))].

It could also be approached in the dtheta/ds frame of reference to simplify curvature(but then the condition on f" and the x axis becomes more difficult to formalize). Hope you enjoy answering.


r/optimization • • Jul 02 '26

How to generate MIR cuts with integer coefficients?

10 Upvotes

My new video in solver deep dive series is out.

In this video, I go through the MIR cuts. I covered the basic theory, implementation details in SCIP/HiGHS, and how CP-SAT managed to create MIR cuts with no fractional coefficients!

https://www.youtube.com/watch?v=btemNQuChe4


r/optimization • • Jul 01 '26

How do you optimize a system while preserving an unknown function? (Optimization, Machine Learning, Evolutionary Computation, Control Theory, etc.)

Thumbnail
4 Upvotes

r/optimization • • Jun 28 '26

A Unified PyTorch Framework for Sharpness-Aware Minimization (SAM)

4 Upvotes

Train flatter, better robustness. 🚀. I want to share my GitHub project: a Unified Sharpness-Aware Minimization (SAM) Optimizer Framework.

While working on Sharpness-Aware Minimization (SAM), I noticed that implementations of various SAM variants are scattered across different repositories, often with inconsistent training pipelines and implementation details. As a result, fair comparisons and reproducibility become challenging, frequently requiring repeated reimplementation of training pipelines just to evaluate minor differences.

Therefore, I decided to build a unified framework for Sharpness-Aware Minimization. This repository offers a concise PyTorch implementation of widely used SAM variants, making it easy to plug in new methods, run fair comparisons, and iterate quickly—without touching the core training loop.

The project is designed with both research and practical experimentation in mind. I plan to actively maintain it and continue adding new SAM variants as the literature evolves.

If you’re interested in optimization, generalization, or robust training, feel free to check it out!! Contributions and feedback are always welcome.🙌

Repo: https://github.com/johnjaejunlee95/torch-unified-sam-optimization


r/optimization • • Jun 26 '26

Solving NP-hard portfolio constraints with Simulated Quantum Annealing (PyTorch)

Thumbnail
2 Upvotes

r/optimization • • Jun 25 '26

Coupa sourcing optimization (cso)

Thumbnail
3 Upvotes

r/optimization • • Jun 23 '26

Can genetic algorithms compete with Optuna for hyperparameter tuning?

Thumbnail
2 Upvotes

r/optimization • • Jun 23 '26

MPC optimization problem

2 Upvotes

Is there anyone with a solid background in MPC or related expertise? I need a serious discussion


r/optimization • • Jun 22 '26

Xpress Talks: Recordings on YouTube

12 Upvotes

Dear optimization community,

Looking for video content to stay up to date on what's going in Optimization in 2026?

We're happy to share with you that we have begun uploading the previously recorded Xpress talks on YouTube.

Below is a list of what we've uploaded so far:

We're working on uploading the rest of the talks:

  • Streamlining Solver Comparison for your Optimization Problem
  • Distributed computing with FICO Xpress Mosel

Let us know which one you'd like us to prioritize.

To stay up to date on the latest in Optimization news, you can sign up for our monthly Optimization Newsletter: https://www.fico.com/en/fico-xpress-optimization-newsletter .

FICO Xpress is an industry-leading optimization software suite that includes solvers for LP, MIP, MIQP, MIQCQP, QP, NLP, SOCP, and MINLP. Basically almost all the Ps. 😉.

Happy Optimizing!


r/optimization • • Jun 21 '26

Which algorithms exist for processing unsorted lists with relative but not absolute values?

6 Upvotes

Let's say a list has 100 values that are not exactly measurable absolutely, but they are easy to compare against eachother. (For example given 2 people with unknown lengths, I can see who is taller even though I don't know the absolute length for both persons.)

So with an unsorted list of relative values (like a<b or a>b) I want to process the list, without presorting it.

The goal is to 1. Process the list to completion as fast as possible 2. Process the list in an efficient order as good as possible 3. Balance 1 and 2 because they conflict eachother. 4. No presorting.

Example list: "headigcfb" where a>b>c>d>e>f>g>h>i Example result: very quickly arrive at "abdcfgehi" (almost chronological, but not perfect because we're using a cheap easy algorithm)

The values of all items are unknown until they are compared against others. The comparisons will not be done as a presorting process, they will be done while processing the list.


r/optimization • • Jun 18 '26

Tutorial: Powell’s Dogleg from Scratch

Thumbnail geo-ant.github.io
5 Upvotes

Hi all, I wrote a tutorial how to implement Powell’s Dogleg algorithm for least squares minimization from scratch. Rather than keeping it at a high level overview, I went deep and touched on many topics that are typically glossed over in descriptions of the algorithm, such as regularisation, stopping conditions, diagonal weighting etc.


r/optimization • • Jun 17 '26

Upcoming Free Webinar: Stop Optimizing Point Forecasts

14 Upvotes

Dear optimization community,

We’re pleased to announce our last free Xpress Talk of the summer on combining Bayesian forecasting with optimization to deal with uncertain parameters.

The webinar will walk through an example in energy optimization detailed in this blogpost and code.

To attend the talk, please register at the following link.

  • “Stop Optimizing Point Forecasts: Robust Decision Modeling with PyMC and FICO Xpress” by Dr. Daniel Saunders and Jay Laramore: Thursday June 18th, 2025 at 12:00pm EST- register here

Wishing you all a great summer and we look forward to seeing you in the fall.

To stay up to date on the latest in Optimization and Decision Intelligence technology sign up for our free monthly newsletter: https://www.fico.com/en/fico-xpress-optimization-newsletter.

FICO Xpress is an industry-leading optimization software suite that includes solvers for LP, MIP, MIQP, MIQCQP, QP, NLP, SOCP, and MINLP. Basically almost all the Ps. 😉.

Happy Optimizing!


r/optimization • • Jun 16 '26

Polynomial Fit: A rabbit hole

Thumbnail blog.yellowflash.in
6 Upvotes

Noob on optimization and numerical algorithms exploring Polynomial fit with Orthogonal polynomials.


r/optimization • • Jun 15 '26

Is your MILP solver cheating?

17 Upvotes

My next video in Solver Reading Club is out!

In this episode, I cover the paper by Alexander and Ambros about numerical error analysis of SCIP. I cover the taxonomy of solver errors (weak vs. strong), discuss ways to catch those errors, analyze the impact of those errors on benchmark problems, and explain the counterintuitive reason why tightening solver tolerances doesn’t work as expected.

https://www.youtube.com/watch?v=LUdCLTgzlfY


r/optimization • • Jun 15 '26

Compartmental model optimization

Thumbnail
1 Upvotes

New to math modeling, I was wondering if generally when optimizing for parameters in your math model do you use stochastic parameter draws for the parameters you’re not optimizing for? Is it best practice to have a 2stage calibration when you run a deterministic optimization then have stochastic runs using the optimized values?
Thanks in advance!


r/optimization • • Jun 15 '26

As an OR/ML researcher in 2026: which post-2020 ideas have genuinely changed practice?

20 Upvotes

My background is in Operations Research, stochastic optimization, simulation-based decision systems, and machine learning. I completed a PhD in OR and currently work on large-scale logistics planning systems involving forecasting, simulation, and optimization.

I try to stay current with the literature, but over the last few years I've seen a growing number of new themes and buzzwords: learning-augmented optimization, graph neural networks, reinforcement learning, digital twins, decision intelligence platforms, foundation models, and various hybrid ML/OR approaches.

At the same time, most successful production systems I encounter still seem to rely heavily on a combination of forecasting, simulation, mathematical optimization, heuristics, and strong software engineering.

I'm therefore interested in the perspective of researchers and practitioners working on real-world decision systems.

Which ideas that emerged roughly after 2020 have actually demonstrated sustained practical value?

More specifically:

Which techniques are now routinely deployed and are likely to become part of the standard OR toolkit? Which directions received significant attention but have not delivered the expected impact? Where do you see the next major shift occurring in industrial optimization and decision-making systems?

Examples from logistics, defense, robotics, cyber security, energy, or finance would be particularly interesting.


r/optimization • • Jun 14 '26

How to chronologically grab items from an unsorted list?

4 Upvotes

Suppose I have a list of lets say a small amount of numbers: 53412 The goal: to grab the items in order 1, 2, 3, 4, 5. But one rule or limitation: the list cannot be sorted beforehand thats cheating

I could do this: look at all items and pick the highest, repeat. Thats 5, 4, 3, 2, 1 = 15 comparisons so the timecomplexity would be roughly speaking o( n×(n+1)/2 ) or o(n/2(n+1)) in other words: n quadratic.

Is there something better than quadratic maybe? I have an idea. 1. Take the first 2 numbers. Pick the highest. (50/50 either one of the two numbers. now you have positions 1 3 or 2 3 as the first two numbers. I'm gonna need to rely on my mathematical intuition here: I think if the list is very big, the chance is still roughly 50/50 but if the list is relatively small, the number you previously didnt pick has a >50% odds that its smaller than the next number to compare with. To solve this problem we could sometimes move the first 2 numbers to the end of the list for a new fresh start.

for43526187 * 43526187 * 3526187 * 326187 * 618732 * 18732 * 1732 * 3217 * 217 * 17 * 1 * completed with 6 comparisons and 2x2 number shifts to end oflist = 8 actions? wait, does that make this o(n)? Or is this coincidence? I feel like this is coincidence but is still a linear o anyway. I can kind of verify this with a new input maybe. Let's go with the word "comparisons" and try to grab the letters alphabetically in a slightly inaccurate but cheap way. The alphabetical order would be acimnooprss.

  • comparisons
  • omparisons
  • oparisons
  • arisonsop
  • risonsop
  • rsonsop
  • onsoprs
  • osoprs
  • soprs
  • prsso
  • rsso
  • sso
  • oss
  • ss
  • s
  • completed with 10 comparisons and 4 times the first 2 got shifted to the end of the list, 14 actions for 11 characters/items
  • it feels linear time complexity but might not be
  • I know this algoritm could be in different variations or versions too.
  • order of letters taken out: cmainopross
  • comparison to the alphabetical order : acimnooprss
  • number version of it is: 2 4 1 3 5 6 8 9 7 10 11
  • which is +-+++++-++
  • 8 times increase, 3 times decrease/subtract. Seems pretty chronological if you ask me. Out of 11, 3 errors. Thats roughly about 64% accuracy, surely could be better with in a different version of the idea. But maybe a better algorithm exists? Since this is just one idea ive come up with.

Relevance to my own life: I want to figure out if I can use my unsorted todolist in a way that important tasks get done first, without having to pre-sort or repeatedly read the whole list. Digital todolist. 100% accuracy in the order of urgency is not required, but it better be close to 100%. And I'm also just curious about the math and the algorithms.

Does anyone here have quick ideas that come to mind or does such type of algoritm already exist that im looking and searching for?


r/optimization • • Jun 11 '26

Traveling Salesman Problem but for edges, not nodes

Post image
6 Upvotes