# A Production Planning Problem#

## Problem Statement#

A company produces two versions of a product. Each version is made from the same raw material that costs $10 per gram, and each version requires two different types of specialized labor to finish.

\(U\) is the higher priced version of the product. \(U\) sells for \(\$270\) per unit and requires 10 grams of raw material, one hour of labor type \(A\), two hours of labor type \(B\). The market demand for \(U\) is limited to forty units per week.

\(V\) is the lower priced version of the product with unlimited demand that sells for \(\$210\) per unit and requires 9 grams of raw material, 1 hour of labor type \(A\) and 1 hour of labor type \(B\).

This data is summarized in the following table:

Version |
Raw Material |
Labor A |
Labor B |
Market |
Price |
---|---|---|---|---|---|

U |
10 g |
1 hr |
2 hr |
\(\leq\) 40 units |
$270 |

V |
9 g |
1 hr |
1 hr |
unlimited |
$210 |

Weekly production at the company is limited by the availability of labor and by the inventory of raw material. The raw material has a shelf life of one week and must be ordered in advance. Any raw material left over at the end of the week is discarded. The following table details the cost and availability of raw material and labor.

Resource |
Amount |
Cost |
---|---|---|

Raw Material |
? |
$10 / g |

Labor A |
80 hours |
$50 / hour |

Labor B |
100 hours |
$40 / hour |

The company wishes to maximize gross profits.

How much raw material should be ordered in advance for each week?

How many units of \(U\) and \(V\) should the company produce each week?

## Mathematical Model#

The problem statement above describes an optimization problem. Reformulating the problem statement as a mathematical model involves three kinds of elements:

**decision variables****objective function****constraints**

The starting point in developing a mathematical model is to list decision variables relevant to the problem at hand. Decision variables are quantities that can be modified to achieve a desired outcome. While some decision variables introduced at this stage may prove redundant later, the goal at this point is to create a comprehensive list of variables that will be useful in expressing the problem’s objective and constraints.

For this problem statement, listed below are decision variables with symbols, descriptions, and any lower and upper bounds that are known from the problem data.

Decision Variable |
Description |
lower bound |
upper bound |
---|---|---|---|

\(x_M\) |
amount of raw material used |
0 |
- |

\(x_A\) |
amount of Labor A used |
0 |
80 |

\(x_B\) |
amount of Labor B used |
0 |
100 |

\(y_U\) |
number of \(U\) units to produce |
0 |
40 |

\(y_V\) |
number of \(V\) units to produce |
0 |
- |

The next step is to formulate an **objective function** describing that describes how we will measure the value of candidate solutions to the problem. In this case, the value of the solution is measured by profit, which is to be maximized.Profit is equal to the difference between total revenue from sales and total cost of operations:

Total revenue, in turn, is the sum of the revenues from the two products, and total cost is the sum of the costs of the three resources:

Putting these together, we have the following objective function expressing maximization of profit:

Finally, the decision variables \(y_U, y_V, x_M, x_A, x_B\) need to satisfy the specific conditions given in the problem statement. **Constraints** are mathematical relationships among decision variables or expressions, formulated either as equalities or inequalities. In this problem, for each resource there is a requirement that the amount used in production of \(U\) plus the amount used in the production of \(V\) must not exceed the amount available. These requirements can be expressed mathematicaly as linear inequalities:

We are now ready to formulate the full mathematical optimization problem in the following canonical way: First we state the objective function to be maximized (or minimized), then we list all the constraints, and lastly we list all the decision variables and their bounds:

This completes the mathematical description of this example of a production planning problem.

An **optimal solution** of this problem is any assignment of values to the decision variables that meets the constraints and that achieves the maximum/minimum objective.

However, even for a simple problem like this one, it is not immediately clear what the optimal solution is. This is exactly where mathematical optimization algorithms come into play. They are generic procedures that can find the optimal solutions of problems as long as these problems can be formulated in a standardized fashion as above.

For a practitioner, mathematical optimization often boils down to formulating the problem as a model above, then passing it over to one of the many software packages that can solve such a model regardless of what was the original *story* behind the model. To do so, we need an interface of communication between the models and the algorithms. In this book, we adopt an interface based on the AMPL modeling language and the Python programming language. AMPL is based on the same mathematical formulation that practitioners use, but is standardized so that it can be read and translated by a computer system. Python provides access to powerful tools for processing data and presenting results.

Thus the next step is to create the corresponding AMPL model.