Reinforced Generation of Combinatorial Structures: Ramsey Numbers

This paper introduces AlphaEvolve, an LLM-based code mutation agent that serves as a unified meta-algorithm to improve the lower bounds of five classical Ramsey numbers and successfully recover or match existing bounds across various cases, demonstrating a shift from bespoke search methods to a single, adaptable framework for combinatorial structure generation.

Ansh Nagda, Prabhakar Raghavan, Abhradeep Thakurta

Published Wed, 11 Ma
📖 4 min read☕ Coffee break read

Imagine you are a master architect trying to build the largest possible city without ever creating two specific, forbidden patterns:

  1. A super-gang of 4 friends who all know each other (a "clique").
  2. A silent club of 15 strangers who all don't know each other (an "independent set").

In the world of mathematics, this is the quest for Ramsey Numbers. The question is: "How big can your city get before you are forced to accidentally create one of these forbidden patterns?"

If you can build a city of 159 people without these patterns, you've proven the answer is at least 160. The bigger the city you can build, the better you are at the game.

The Problem: The Search is Hard

For decades, mathematicians have been trying to build these "forbidden-pattern-free" cities. It's like trying to find a needle in a haystack, but the haystack is infinite, and the needle keeps changing shape.

Previously, to find a slightly bigger city, a human expert had to write a custom, one-of-a-kind computer program (a "search algorithm") for each specific problem. It was slow, manual, and required a genius to design the search strategy for every single new number.

The Solution: The "Evolutionary Code Gardener"

This paper introduces a new tool called AlphaEvolve. Think of AlphaEvolve not as a calculator, but as a digital gardener or a code-mutation agent.

Here is how it works, using a simple analogy:

  1. The Garden (The Population): AlphaEvolve starts with a small garden of different computer programs. Some are bad at building cities; some are okay.
  2. The Mutator (The LLM): A powerful AI (a Large Language Model) acts as the gardener. It looks at the best-performing programs in the garden and says, "Let's tweak this one." It might change a few lines of code, swap a strategy, or try a new way of connecting people. This is like a gardener taking a healthy plant, cutting a branch, and grafting it onto a new stem to see if it grows better.
  3. The Test (The Simulation): The new, mutated program tries to build a city.
    • Success: If it builds a city of 159 people without the forbidden patterns, it gets a high score.
    • Failure: If it accidentally creates a super-gang or a silent club, it gets a low score.
  4. Survival of the Fittest: The programs that built the biggest cities are kept. The ones that failed are thrown out. The AI then takes the winners, mutates them again, and repeats the process thousands of times.

Over time, the AI doesn't just find a better city; it invents a better way to build cities. It evolves the search algorithm itself.

The Big Wins

Using this "self-evolving" approach, the researchers achieved something remarkable. They didn't just find one new city; they found five new record-breaking cities where no one had ever gone before:

  • R(3, 13): They built a city of 61 people (previously the record was 60).
  • R(3, 18): They built a city of 100 people (previously 99).
  • R(4, 13): They built a city of 139 people (previously 138).
  • R(4, 14): They built a city of 148 people (previously 147).
  • R(4, 15): They built a city of 159 people (previously 158).

Why This is a Game Changer

In the past, if you wanted to improve the record for R(4, 15), you needed a human to spend months designing a specific search strategy.

With AlphaEvolve, the AI automatically discovered the strategy.

  • For some numbers, it realized, "Hey, let's start with a random mess and clean it up."
  • For others, it figured out, "No, we need to start with a very specific, math-heavy structure (like a Paley graph) and tweak it."
  • For others, it invented a "fractal" approach, copying patterns from smaller parts of the city to build the whole.

The AI didn't just solve the puzzle; it wrote the instruction manual on how to solve the puzzle, and it did it for five different difficult cases at once.

The Takeaway

This paper shows that we are entering an era where AI doesn't just solve math problems by being "smart"; it solves them by learning how to write the code that solves them.

It's like giving a robot a toolbox and a goal. Instead of the robot just picking up a hammer, it realizes, "I need a better hammer," so it builds a new hammer, tests it, and then uses that new hammer to build a bigger house. In this case, the "house" is a mathematical proof, and the "bigger house" is a new record in the history of mathematics.