In this project, you will solve a resource allocation problem using Linear Programming.
You are the operations director for a processing plant at a large mine. Your job is to devise a program (i.e., plan) for the plant that maximizes profits while operating within the given constraints. The plant produces four major minerals: copper, gold, silver and platinum. Your plan must specify how much copper, silver, gold, and platinum (all in ounces) you will produce, and you will need to report how much profit you will achieve.
In a given week, the mine can produce up to 2,000 tons of ore that must be processed into some combination of the four major minerals. A ton of ore contains 10 ounces of copper, 2 ounces of gold, 3 ounces of silver, and 1 ounce of platinum. To keep things simple, you may only extract one mineral from any batch (of arbitrary size) of ore processed (note that the amounts of ore processed for each type need not be integer valued).
Processing the ore requires power, water, labor and use of processing lines. Producing each of the minerals requires different amounts of processing resources.
One ounce of copper requires exactly:
One ounce of gold requires exactly:
One ounce of silver requires exactly:
One ounce of platinum requires exactly:
There is only a limited amount of power, water, labor and processing line time available. In a given week, you may use the following resources (but no more):
Finally, each ounce of finished mineral has an associated profit:
After converting an LP problem into the representation we referred to as “standard form up to step #1”, the conversion to matrix-vector form is quite straight-forward. Let $m$ be the number of constraints and $n$ be the number of variables in standard form up to step #1.
Matrix-vector form was introduced in Lecture #27 (slides #38 and #39 in the PowerPoint).
For the implementation of the simplex algorithm, we require a padded version of matrix-vector form. The padded matrix-vector form reflects the presence of slack variables and is derived directly from matrix-vector form. The number of our original (now “non-basic”) variables is $n$, and the number of slack (now “basic”) variables is $m$, one for each of $m$ constraints. (Be sure to read the Linear Programming Notes linked from the course schedule in order to understand the terms “basic” and “non-basic” variables.)
Padded matrix-vector form was introduced in Lecture #29 (slide #21 in the PowerPoint).
For part #1 of this project, use the “prime” notation ($A^\prime, b^\prime$, etc.). For part #2, when working with the Simplex and Pivot pseudo-code, drop the primes. e.g., $A^\prime$ is simply referred to as $A$ in the pseudo-code. Note also that the pseudo-code does not use the $x^\prime$ vector.
When a formerly non-basic variable is pivoted to become a basic variable, then the new basic variable becomes the left side of a new constraint equation. In the algorithm, you need a simple way to find the new constraint equation for the new basic variable (with index $i$) at row $i$ of matrix A. Since any of the $n + m$ variables can be a basic variable during the run of the algorithm, you need $n + m$ rows. You also need $n + m$ columns, because the coefficient for variable $x_j$ (which might be 0 or might not be) in the constraint for variable $x_i$ needs a place to stay which is also easy to find later. A pivot operation allows any variable to end up in the constraints for any other variable so you need all $n + m$ columns in addition to all $n + m$ rows.
Also, to verify that your implementation is working properly, consider trying it out on the homework problem #7.1. If you are able to reproduce the result you computed (and which is provided in the homework key), then you can be confident in your implementation and your final answer on the given problem. You could also try your implementation on other examples worked in class for which you have the correct answers.
Another method of verification on the problem posed here is to try an online solver to replicate your result. If you fail to replicate, then you probably have a bug.
You are developing as a problem solver. You are also learning to solve a problem before you start writing code. In this project, we require you to step up to a whiteboard after reading these instructions before writing any code. Use the whiteboard to walk through the solution with a friend. Your friend could be another CS major, a CS 312 classmate, or another technical person with an eye for detail.
Make sure you walk through a step or two of the Simplex algorithm using the padded matrix-vector representation. Understand how the pseudo-code is doing the algebra we did by hand. Think out loud and with sketches. By the time you are done with the whiteboard experience, be sure that you understand the Simplex algorithm, including the pseudo-code. If you do not understand the pseudo-code, then you have not adequately finished the whiteboard experience. Doing so will save you a lot of time translating the algorithm into code.
In short, make sure you understand what you are going to do before you write a stitch of code. As you will note below, including a photo of your “whiteboard experience” is a required element of your project report.
Have a “whiteboard experience” and document it with a photograph of you next to the whiteboard sketches, etc.
Prepare a whiteboard experience report as a .pdf file. It should consist of one page with the following elements:
Submit the whiteboard experience report online by the whiteboard experience deadline for this project.
Your answer will have six sections:
Have a “whiteboard experience” as directed above. Again, by the time you are done with the whiteboard experience, be sure that you understand the Simplex algorithm, including the pseudo-code. If you do not understand the pseudo-code, then you have not adequately finished the whiteboard experience. Submit it online by the deadline for the whiteboard experience.
Solve the problem algebraically by hand.
Write a type-written report containing the following distinct sections as a single PDF document, and submit it by following the submission directions in the course syllabus. For Winter 2015: Submit online in PDF format as Homework #21 through Learning Suite.
Write a type-written report containing the following distinct sections as a single PDF document, and submit it by following the submission directions in the course syllabus. Note that the project report simply includes part 2, since part 1 was submitted earlier.