Linear programming in World of Warcraft: a quest of tailoring, skill and gold

Photo by patricia serna on Unsplash

Many video games problems can be modeled with math or solved with programming techniques: n-queens, secretary problem and many more are often encountered in-game!

In World of Warcraft, players can have profession skills: enchanting, tailoring, mining and many others that help gamers to raise money to buy in-game objects, to trade or to sell at the auction house.

As for real life, players have to train skills in order to gain proficiency and to craft more powerful (and valuable) objects.

Just to give you an example, as a tailoring beginner apprentice, you can tailor the following objects:

Images from

As you can see, every object require a different amount of materials (or different materials, too!).

The problem to maximize the amount of gold received by selling crafted items when a player has some amount of materials available is a typical linear programming problem.

In particular it is a blending model, i.e. a problem where the goal is to find the optimal way to mix some ingredients given some constraints, in order to minimize or maximize an “objective” function (a goal). Relationship between ingredients mixing is expressed as a linear function…and that’s why we call it “linear”.

Let’s consider the following availability: 20 linen cloth and 8 coarse thread.

We want to decide how to mix them in brown linen cloak or brown linen pants in order to maximize our income.

We also know that the first can be sold for 1 gold at the auction house and the latter can be sold for 3 gold (ok, it’s a lot for those two items, but let’s simplify!).

How can we model the problem?

Let’s define xc as the quantity of linen cloak to be crafted and of xb as the quantity of brown linen pants to be crafted.

We can observe the following facts:

  • the quantity xc must be integer and greater or equal to zero
  • the quantity xb must be integer and greater or equal to zero
  • the quantity of linen cloth used must be lesser than the linen cloth availability
  • the quantity of coarse thread used must be lesser than the coarse thread availability

We also know that:

  • 1 bolt of linen cloth is made up of 2 pieces of linen cloth.

So the problem can be modeled in the following way:

Let’s graph those inequalities!

We can see that the overlapping planes identify a polyhedron and the fundamental theorem of linear programming states that the optimal solution is one of the vertex of that polyhedron.

So that optimum can be one of the following points: (0,0) (0,8) (2,6) (5,0)

How can we say what’s the optimum? Just calculate the value of the max function in all those points!

To optimize the income we’d better produce 5 brown linen pants! ;)

And now…let’s go to quest! 🙌🙌🙌




Full-time Human-computer interpreter. Opinions are my own.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating a Kubernetes Cron Job to backup Postgres DB

Civil Architecture vs Software Architecture

Demystifying Trees in Data Structures — Part 2

Macos Startup Apps


Cut down on emails: 5 tips to help communicate with your developer

Using Decorators in Python:

Snowflake Vs Azure Synapse Analytics: The Battle of Cloud Data Warehouses

The First Demo for Phi is live on Goerli Testnet!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Juna Salviati

Juna Salviati

Full-time Human-computer interpreter. Opinions are my own.

More from Medium

Notes: The Physical Layer in Detail

Temperature Control | Embedded Systems

Length-Limited Huffman Codes

IBM Sterling SFTP Server Adapter 2.0 vs. SFTP Server Adapter 1.0: Performance Comparison