# Finding the Optimal Aggro Deck via Computer Simulation

By Frank Karsten : 10/09/13

Suppose that there would be a format in which only the following five cards were legal:

Savannah Lion

Putrid Leech

Geist of Saint Traft

Lightning Bolt

City of Brass

There is no four-card maximum, so you can play any number of copies of these cards, and the goal is to deal 20 damage as quickly as possible. For this format, I want to answer the following question:

## What Is the Optimal Deck?

In other words, what is the fastest 60-card aggro deck when you can pick any number of:

• A 2-power creature for one mana (representative of iconic one-drops such as Kird Ape, Gravecrawler, and Savannah Lions)

• A 4-power creature for two mana (representative of efficient two-drops such as Putrid Leech, Dandân, and Jötun Grunt)

• A 6-power creature for three mana (representative of Geist of Saint Traft, arguably the hardest-hitting three-drop of all time, as well as Knight of the Reliquary and Countryside Crusher when they’re having a good day)

• A spell that deals 3 damage to the opponent for one mana (obviously inspired by Lightning Bolt, though Lava Spike and Bump in the Night are similarly efficient)

• A generic land that taps for one mana (of any color, so just imagine a City of Brass)

This question is intended to offer intellectual entertainment, but may also unlock new insights for deckbuilding. Frankly, I like analysis, so I set out to answer it.

A priori, it was far from clear to me how the best deck would look. Would 20 land and 40 Lightning Bolts be best? Or 15 land and 45 Lightning Bolts ? Would it be better to play 20 lands and 40 Savannah Lions? And how about a balanced mix of one-drops, two-drops, three-drops, Bolts, and lands?

Before answering any of this, I first need to pinpoint the exact meaning of “best deck.” For this article, I will adhere to the optimization criterion: the fastest average goldfish kill on the play.

That is, we are on the play against a goldfish (an opponent who doesn’t do anything) and we aim to find the deck that minimizes the expected number of turns necessary to deal 20 damage. There are alternative optimization criterions that I could have chosen (such as the highest probability of a turn-4 kill, a weighted turn-kill average taking into account both playing and drawing first, or even a game-theoretical analysis with real opponents who attack and block) but I like the one that I chose—it has a straightforward interpretation, rewards fast kills, and punishes slow draws.

I wrote a computer program to enumerate all possible decks (even in this simplified format, there are hundreds of thousands of possible decks) and to simulate tons of games with each of them to estimate each deck’s expected goldfish turn. I will describe my methodology and assumptions in more detail later, but first, the end result:

### The Optimal Aggro Deck

16 Savannah Lions

11 Putrid Leech

13 Lightning Bolt

20 City of Brass

So, it turns out that a balanced mix of one-drops, two-drops, and Bolts is best. The three-drops turn out to be too slow, and the optimal land count coincides with the time-honored standard of 20 lands. Averaging over 20 million simulated games, this deck wins the game on turn 4.222. Turn-4 kills happen 79.3% of the time and turn-5 kills happen 19.6% of the time. The second-best deck (with an average kill-turn of 4.223) had a 14th Lightning Bolt instead of the 15th Savannah Lions, and the third-best deck (with an average kill-turn of 4.224) had a 21st City of Brass instead of the 11th Putrid Leech.

To establish this, I enumerated all possible decks, estimated the goldfish-turn of all of them via computer simulation, and picked the fastest one. (I verified that it was almost surely the best one by simulating 20,000,000 games with every deck that differed at most two cards from it.) Although it is technically possible to do exact analysis via hard-core probability calculations, the staggering number of different opening hands to consider makes this prohibitive. Computer simulation (in which a random number generator determines the cards drawn) is a more convenient way to answer the question at hand. Although simulation is approximate, which admittedly blemishes my use of the term “optimal,” I simulated enough games to be sufficiently certain that my outcome is accurate. Besides, simulating billions of games of Magic is interesting in its own right because I had to tell my computer how to play: which cards to cast in any given situation, how to keep track of the board and life totals, and which opening hands to mulligan.

## How to Play a Turn?

Okay, so we have an opening hand. Hopefully it contains 7 cards, but possibly less if we had to mulligan. Our opponent starts at 20 life. Then what? Here’s the logic of my computer code translated to English.

On turn 1, we do the following:

• If we have a land in hand, we play it and tap it for mana.

• If we have mana in our pool and we have a Savannah Lions in hand, we use our mana to play it.

• If we had no Savannah Lions but are holding a Lightning Bolt, then we burn our opponent for 3.

• Move to the next turn.

On any later turn, we do the following:

• We draw a random card from our deck.

• We attack with all creatures on the battlefield. If that’s enough to bring our opponent’s life down to 0 or less, then we win the game.

• If we have a land in hand, we play it.

• We tap all of our lands for mana.

• If the number of castable Bolts (i.e., the minimum of the number of Lightning Bolts in our hand and the mana in our pool) is enough to bring our opponent’s life down to 0 or less, then we do so and win the game. Otherwise, we hold our Bolts for the time being and cast creatures, depending on how much mana we have available.

• If we have one mana:

—If we have a Savannah Lions in hand, we use our mana to play it.

• If we have two mana:

—If we have a Putrid Leech in hand, we use our mana to play it.

—Otherwise, we play as many Savannah Lions as our hand and mana allow for.

• If we have three mana:

—If we have a Geist of Saint Traft in hand, we use our mana to play it.

—Otherwise, if we have a Putrid Leech in hand, we use our mana to play it.

—Otherwise, we play as many Savannah Lions as our hand and mana allow for.

• If we have four mana:

—If we have two Putrid Leech in hand, we use our mana to play both.

—Otherwise, if we have a Geist of Saint Traft in hand, we use our mana to play it.

—Otherwise, if we have one Putrid Leech in hand, we use our mana to play it.

—Afterwards, we play as many Savannah Lions as our hand and mana allow for.

• If we have five or more mana:

—We first play as many Geist of Saint Traft as possible.

—Subsequently, we play as many Putrid Leech as possible.

—Subsequently, we play as many Savannah Lions as possible.

If we have any mana left after that, we spend it on as many Lightning Bolts as possible.

Move to the next turn. If it’s turn 50, then our goldfish concedes in boredom.

This algorithm aims to add the largest total power worth of creatures to the battlefield each turn. Usually we start by playing the biggest possible creatures, except when we have four lands: then, two Putrid Leech are better than one Geist of Saint Traft.

My algorithm could be refined further because it currently does not look ahead to the next turn. For example, there is the situation in which you have one land and a Savannah Lions on the battlefield, plenty of Lightning Bolts in your deck, one Lightning Bolt and a Savannah Lions in hand, and the opponent is at 8 life after the attack. Then, my algorithm prescribes playing the Savannah Lions, whereas it would be better to cast the Lightning Bolt in anticipation of possibly topdecking and playing another Bolt on the subsequent turn for a faster win. The reason why I left out such one-turn look-ahead procedures is that they rarely matter but add substantial computation.

## An Example Game

To illustrate how it all works, I have an example with the optimal deck. Suppose that we mulligan to 6 cards, keeping 2 Savannah Lions, 1 Putrid Leech, 1 Lightning Bolt, and 2 land.

Turn 1

We play land and a one-drop.

At the end of turn 1 with the opponent at 20 life, the situation is as follows:

Deck: 14 one-drops, 10 two-drops, 0 three-drops, 12 Bolts, and 18 lands.

Board: 1 one-drop, 0 two-drops, 0 three-drops, and 1 lands.

Hand: 1 one-drop, 1 two-drop, 0 three-drops, 1 Bolt, and 1 lands.

Turn 2

At the beginning of the turn, we draw a two-drop. We attack, and play land and a two-drop.

At the end of turn 2 with the opponent at 18 life, the situation is as follows:

Deck: 14 one-drops, 9 two-drops, 0 three-drops, 12 Bolts, and 18 lands.

Board: 1 one-drop, 1 two-drop, 0 three-drops, and 2 lands.

Hand: 1 one-drop, 1 two-drop, 0 three-drops, 1 Bolt, and 0 lands.

Turn 3

At the beginning of the turn, we draw a two-drop. We attack, and play land and a two-drop.

At the end of turn 3 with the opponent at 12 life, the situation is as follows:

Deck: 14 one-drops, 8 two-drops, 0 three-drops, 12 Bolts, and 18 lands.

Board: 1 one-drop, 2 two-drops, 0 three-drops, and 2 lands.

Hand: 1 one-drop, 1 two-drop, 0 three-drops, 1 Bolt, and 0 lands.

Turn 4

At the beginning of the turn, we draw a land. We attack, Bolt our opponent to win the game, and add a two-drop for good measure.

At the end of Turn 4 with the opponent at -1 life, the situation is as follows:

Deck: 14 one-drops, 8 two-drops, 0 three-drops, 12 Bolts, and 17 lands.

Board: 1 one-drop, 3 two-drops, 0 three-drops, and 3 lands.

Hand: 1 one-drop, 0 two-drops, 0 three-drops, 0 Bolts, and 0 lands.

The game ends on turn 4!

eck (with optimized mulligan strategy) for this format is:

## How to Mulligan?

So far, I explained how to play a game of Magic, given that we kept an opening hand. But the decision to keep or mulligan is also an important one. The optimal mulligan strategy, however, depends on deck composition. Keeping 2 land plus 5 Lightning Bolts might be good for a land-light deck, but a land-heavy deck might prefer an average 6-card hand instead. So, the question of how to mulligan is a tricky one. Initially, I started with the relatively loose rule of keeping any opening hand with 1, 2, 3, or 4 lands, figuring that it should work reasonably well for a broad range of decks.

This loose mulligan rule helped to pin down an initial range for the optimal deck composition, but I quickly realized that it isn’t perfect, so I added a procedure to find the optimal mulligan strategy for every deck via dynamic programming. Basically, I work my way from small to large opening hands, comparing the average win-turn for every possible opening hand to the average win-turn of starting with one fewer card. If the former number is no larger than the latter, then it’s a keep; otherwise, it’s a mulligan. For the optimal deck, the procedure and outcome is described below. Averages are based on 100,000 simulated games per hand.

For 1-card opening hands:

Since there is nothing to gain by going down to 0 cards, 1-card opening hands should always be kept.

Average win-turn of a random 1-card opening hand: 8.30.

For 2-card opening hands:

The opening hand with 2 Lightning Bolts has an average win-turn of 8.47, which is worse than an average 1-card hand, so it should be mulliganed. Every other 2-card opening hand has an average win-turn that is less than 8.30, so those should be kept.

Average win-turn resulting from starting with a random 2-card opening hand (which, to clarify, is based on a turn 8.30 win for the 2-Bolt hand because it leads to a mulligan): 7.30.

For 3-card opening hands:

Any all-land or no-land hand has an average win-turn that is greater than 7.30, so they should be mulliganed. Every other 3-card opening hand has an average win-turn that is less than 7.30, so those should be kept.

Average win-turn resulting from starting with a random 3-card opening hand (which, to clarify, is based on a turn 7.30 win for an all-land or no-land hand because they lead to a mulligan): 6.34.

For 4-card opening hands:

Continuing the same procedure as before, the optimal mulligan strategy is:

• Mulligan every opening hand with 0 lands and/or 0 creatures

• Keep every other hand

Average win-turn resulting from starting with a random 4-card opening hand: 5.51.

For 5-card opening hands:

The optimal mulligan strategy is:

• Mulligan every opening hand with 0 lands and/or 0 creatures

• Mulligan an opening hand with 1 land and 4 [d]Putrid Leeches

• Mulligan an opening hand with 4 lands and 1 Savannah Lions

• Keep every other hand

Average win-turn resulting from starting with a random 5-card opening hand: 4.91.

For 6-card opening hands:

The optimal mulligan strategy is:

• Keep 1 land, 1 Putrid Leech, 4 Bolts

• Keep 1 land with at least 1 Savannah Lions and at most 3 Putrid Leech

• Keep 2 land with 0 Savannah Lions and at least 2 Bolts

• Keep 2 land with at least 1 Savannah Lions

• Keep 3 land with 0 Savannah Lions and at least 1 Bolt

• Keep 3 land with at least 1 Savannah Lions and at most 1 Bolt

• Keep 4 land, 1 Savannah Lions, 1 Putrid Leech

• Mulligan the rest (including every opening hand with 0, 5, or 6 lands and/or 0 creatures)

Average win-turn resulting from starting with a random 6-card opening hand: 4.49.

For 7-card opening hands:

The optimal mulligan strategy:

• Keep 1 land, 1 Savannah Lions, 5 Bolts

• Keep 1 land with at least 2 Savannah Lions and least 2 Bolts

• Keep 2 land with 0 Savannah Lions and at least 2 Bolts

• Keep 2 land with at least 1 Savannah Lions

• Keep 3 land with 0 Savannah Lions and at least 2 Bolts

• Keep 3 land with at least 1 Savannah Lions and at most 2 Bolts

• Keep 4 land with at least 1 Savannah Lions and at least 1 Putrid Leech

• Mulligan the rest (including every opening hand with 0, 5, 6, or 7 lands and/or 0 creatures)

Average win-turn resulting from starting with a random 7-card opening hand: 4.22.

## A Format with a Weaker Card Pool

So far, we focused on a format with frequent fourth-turn kills due to the extremely efficient Savannah Lions, Putrid Leech, and Lightning Bolt. These cards may be representative of a large format such as Modern, but how about a format with a more limited card pool, such as Block Constructed? To make things more specific, imagine a format in which only the following five cards were legal:

Mons's Goblin Raiders

Grizzly Bear

Gnarled Mass

Shock

City of Brass

Using the same methodology as before, I determined that the optimal deck :

## Take-aways

So what can we learn from all of this? Well, first off, if you want to build an aggro deck from scratch, you now have a proven base to start from. If you’re only interested in maximizing speed, then my analysis of both formats suggests to build decks with 12-17 one-drops, 10-12 two-drops, 0-4 three-drops, 12-15 burn spells, and 18-21 land. Besides that, my simplified formats led to some interesting insights:

Number of lands

The time-honored tradition of playing 20 lands in aggro decks appears to be correct if the format is filled with powerful cards (such as Savannah Lions, Putrid Leech, and Lightning Bolt) and if the average mana cost of the deck is relatively low.

However, if the format is comprised of weaker cards such as Grizzly Bear, then the optimal number of lands may be less than 20, even if the deck contains several three-drops. The reason for this, I suppose, is that when cards are weaker, mana flood and mulligans are punished more severely. For example, 4 lands, 1 Savannah Lions, and 1 Putrid Leech is still a pretty fast six-card hand, whereas 4 lands, 1 Mons's Goblin Raiders, and 1 Grizzly Bear is quite slow. Hence, when the cards are weak, you may wish to decrease the risk of mana flood by cutting a land.

Finally, with my optimal decks in mind, it seems that all those 18-land mono-red decks in Return to Ravnica Block Constructed may not contain enough lands.

Every card has a role

Every card type has its advantages and disadvantages. Creatures deal repetitive damage, but they have summoning sickness. Bolts are a one-shot deal, but they have an immediate effect on the opponent’s life total. As it turns out, a mix between the two card types yields the fastest wins.

It was also interesting to see that a mix between Savannah Lions and Putrid Leech is correct. Even though you would like to maximize the probability of hitting a turn-1 Savannah Lions, there is still the random element to take into account: sometimes you draw a land-heavy hand or have to mulligan, and in those cases you’d rather have a 4-power creature than a 2-power creature in your hand. For instance, 4 land, Savannah Lions, Putrid Leech is a much better 6-card hand than 4 land, Savannah Lions, Savannah Lions.

Three-drops turned out to be too slow, especially when games are usually won on turn 4. The optimal deck in the Grizzly Bear format still contained 3 Gnarled Mass, but that’s not a lot either. It indicates that drawing one Gnarled Mass is fine but drawing multiple Gnarled Mass is horrible.

When going for speed, mulligan aggressively

Let me give a selection of hands that, according to the optimal mulligan strategy, you should toss back:

• 1 City of Brass, 1 Savannah Lions, 1 Putrid Leech, 4 Lightning Bolt

• 3 City of Brass, 4 Putrid Leech.

• 4 City of Brass, 1 Savannah Lions, 2 Lightning Bolt

• A five-card hand consisting of 4 City of Brass, 1 Savannah Lions

• A three-card hand consisting of 3 City of Brass

These could be seen as fairly aggressive mulligans, but all of these hands turned out to be too risky or too slow—if you want to win the game as quickly as possible, a random hand with one card less is better than all of the above hands. Hopefully, my analysis can serve as a useful reference for mulligan strategy discussions in more realistic formats.

I will be able to outsource the playtesting for Pro Tour Theros to my computer.

Okay, this one is a lie. The number of Standard-legal cards is greater than five, and explaining to a computer when to play around Supreme Verdict or how to navigate complex board situations would take a lot of time.

Nevertheless, I hope that this article encourages future work on simulation, optimization, and artificial intelligence in the context of Magic. Although the game is complex, we might be seeing Magic-playing computer algorithms that can defeat pro players in a decade or so.

Of course, my imaginative format has its limitations.

In my model, there are no opponents who cast Thragtusk to gain life, Doom Blade to kill your creatures, or Loxodon Smiter to attack and block. Although my goal of finding the fastest average goldfish kill is relevant when playing against a non-interactive combo opponent, it is too single-minded when facing off against interactive opponents. Accordingly, you may wish to play fewer Bolts, fewer one-drops, and more three-drops in a real-life tournament than my “optimal” decks would prescribe.

Closing out, if you have any questions about my methodology (which I didn’t describe in full because this is a Magic site and not an academic journal) or numbers (there’s plenty of stuff that I left out for brevity) then I’d be happy to answer those questions in the comments. Also, if you can think of other Magic-related applications for an analysis like this, then I’m open to suggestions!

### The Optimal Aggro Deck

13 Mons's Goblin Raiders

11 Grizzly Bear

3 Gnarled Mass

14 Shock

19 City of Brass

Averaging over 20,000,000 simulated games, the deck wins the game on turn 5.740.