We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Solving the Whole Simplex

Pat yourself on the back! You've done all the hard stuff; now we just need to tie it all together.

Reminder of Our Problem at Mappy

At Mappy we sell 3 different subscriptions to our app:

  • Basic – $30/mo.
  • Pro – $60/mo.
  • Enterprise – $120/mo.

Due to the number of external API licenses that we hold, we have the following constraints:

  • We can sell no more than 100 basic subscriptions each month.
  • We can sell no more than 25 pro subscriptions each month.
  • We can sell no more than 10 enterprise subscriptions each month.
  • We have only 150 API keys available each month. A basic subscription uses 1, a pro subscription uses 2, and an enterprise subscription uses 3.

We'll be using our simplex solver to help answer the question:

How many of each subscription should we sell to maximize profit?

Assignment

Implement the solve method. It assumes a SimplexSolver has been constructed and the constraints have been added. Its job is to add the slack variables and pivot until the tableau is in its optimal solved state.

Once this is working, we'll finally have a program that can answer our original question (and any other optimization problems the business has in the future)!