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

Tableau Solution

Let's add a method to our class to get the current solution from the state of the tableau. Remember, this isn't the final solution; it's just the solution of the current tableau, which we'll update in the next assignments.

Assignment

Complete the get_solution_from_tableau method. It should return a tuple containing 1) a list of numbers that represent the current values of each variable in column order, including slack variables, and 2) the current value of the profit variable.

For example, this tableau, with self.basis set to [2, 3, 4]:

[1.0, 0.0, 1.0, 0.0, 0.0, 250.0]
[0.0, 1.0, 0.0, 1.0, 0.0, 200.0]
[1.0, 1.0, 0.0, 0.0, 1.0, 300.0]
[-5.0, -1.0, 0.0, 0.0, 0.0, 0.0]

Would return the following tuple:

([0, 0, 250.0, 200.0, 300.0], 0.0)