Learning Outcomes
Resources
Try it out visually!
From Words to Math: a step-by-step interactive modeling tutorial.
Linear Programming, also known as Linear Optimization, is the starting point for most forms of optimization. It is the problem of optimizing a linear function over linear constraints.
In this chapter, we will define what this means, how to set up a linear program, and discuss many examples. Examples will be connected with code in Excel and Python (using PuLP or Gurobipy modeling tools) so that you can easily start solving optimization problems. Tutorials on these tools will come in later chapters.
As a warm-up, consider the following word problem.
Question: A movie theater sells adult tickets for each and child tickets
for each. On Saturday,
the theater sold tickets
total and collected
in ticket sales. How many adult and child tickets were sold?
Solution: Let and denote the number of adult and child tickets sold, respectively. Then
Substituting from (1) into (2) gives , which simplifies to , so and .
In optimization, we follow a similar process of assigning variables and writing mathematical expressions from a word problem. However, instead of equations that pin down a unique answer, we typically have inequalities that bound the variables in different ways, and an objective function we wish to maximize or minimize. Thus, there can be many feasible solutions, and the goal is to find the best one.
We begin with a simple example.
Example 2.1: Screen Printing Shop
A screen printing shop prints custom t-shirts and tote bags and must decide how many of each to make this week. Here is what the owner knows. On the revenue side, t-shirts sell for against of materials, and tote bags sell for against of materials. On the production side, two resources are scarce: the printing press (at most hours this week) and the drying/packaging station (at most hours). A t-shirt occupies the press for hours and a tote bag for ; each item then spends hour in drying and packaging. One more piece of information limits the plan: local demand for t-shirts tops out around per week, so making more than that would be wasted effort. What production plan earns the most profit?
To turn this story into mathematics, we need decision variables, an objective, and constraints. The decisions are the production quantities: let be the number of t-shirts and the number of tote bags made this week. Since each t-shirt nets and each tote bag nets , the quantity the owner wants to maximize is the weekly profit:
| (2.1) |
Next, each scarce resource becomes an inequality. Printing shirts and totes ties up press hours, which cannot exceed the available:
| (2.2) |
The drying and packaging station tells the same kind of story, one hour per item against a -hour budget:
| (2.3) |
The demand ceiling is the simplest constraint of all: . Assembling the objective and the constraints, and remembering that production cannot be negative, gives the complete linear program:
| (2.4) |
Learning Outcomes
A Generic Linear Program (LP) Linear programming (LP) is a mathematical optimization framework widely used in decision-making and resource allocation. In its most basic form, an LP seeks to optimize (maximize or minimize) a linear objective function subject to a set of linear constraints. These constraints typically represent limitations or requirements in real-world scenarios, such as budgets, capacities, or resource availability.
Variables:
The decision variables represent the quantities we want to determine. For example:
: Continuous variables (, i.e., a real number), .
These variables could represent amounts of products to produce, resources to allocate, or investments to make. We can use any letters to represent these variables. Typically we use , but frequently will use or other letters depending on the context and what makes reading the problem most convenient.
Parameters:
Parameters are the given data in the problem, which are assumed to be known in
advance:
: Cost coefficients for each decision variable, . These values represent the contribution of each variable to the objective function.
: Constraint coefficients, and . These define the relationships between decision variables and the constraints.
: Right-hand side values of the constraints, . These represent limits or requirements for each constraint.
The general form of a linear program can be written as follows:
| (2.5) |
Objective Function: The linear function represents the goal to optimize. This could involve maximizing profit, minimizing cost, or achieving some other measurable outcome.
Constraints: The system of inequalities (or equalities) restricts the values of the decision variables. Each constraint reflects a real-world limitation, such as resource availability or capacity limits.
Feasibility: The set of all possible solutions that satisfy the constraints is called the feasible region. The optimal solution must lie within this region.
Linear Relationships: Both the objective function and constraints are linear, meaning the relationships between variables are additive and proportional.
Sets: For specific optimization problems, it can be useful to define sets of variables or parameters to help write down the problem in a generic formulation.
Example 2.2: Example of a Linear Program
To illustrate, consider a specific example with three decision variables and four constraints, including a mix of constraint types (, , and ):
Variables:
: Continuous
variables (, i.e.,
a real number), .
Parameters:
: Cost coefficients, .
: Constraint coefficients, and .
: Right-hand side values for each constraint, .
Model:
A key feature of linear programming is the use of linear functions, defined as follows:
Definition 2.3: Linear Function
A function is linear if there are constants such that:
| (2.6) |
Linear functions are characterized by their simplicity and additivity, making them well-suited for optimization problems where proportionality is assumed. This simplicity allows linear programs to be solved efficiently, even for large-scale problems.
When we wrote down the model in Example 2.1, we quietly made four modeling assumptions. They are worth stating out loud, because they tell you when a linear program is the right tool and when it is not.
Proportionality
Doubling a variable doubles its effect. If one t-shirt earns $8 and consumes 15 minutes of press time, then 50 shirts earn $400 and consume 750 minutes. No quantity discounts, no economies of scale, no setup costs: every unit behaves like the first one.
Additivity
Effects add up across variables, with no interactions. The press time used by t-shirts and the press time used by posters simply sum; producing one product does not make another product cheaper, more profitable, or harder to make.
Divisibility
Variables may take fractional values. The model is allowed to recommend printing half a shirt, whether or not that makes physical sense.
Certainty
Every number in the model (the profit per shirt, the minutes per press run, the hours available) is treated as known exactly, not as an estimate or a random quantity.
Proportionality and additivity together say exactly that the objective and constraint functions are linear in the sense of Definition 2.3. If your problem has quantity discounts, interaction effects, or fixed setup charges, a plain linear program does not capture it, though we will see in the integer programming chapters that some of these features can be recovered with clever modeling.
Divisibility deserves a closer look. Some quantities divide naturally: ounces of ink, hours of labor, dollars of budget. Items like t-shirts do not; nobody sells six tenths of a shirt. In practice this matters less than it first appears. When production quantities are large, an optimal plan calling for, say, several hundred shirts plus a fraction can be rounded to whole units with only a tiny effect on profit. When whole-number answers truly matter, we add the integrality requirement explicitly, and the model becomes an integer program, the subject of Part III of this book.
Certainty is the assumption most often violated in the real world: demand forecasts miss, prices move, machines run slow. Fields such as stochastic programming and robust optimization extend linear programming to handle uncertain data, and sensitivity analysis (Chapter 10) lets us ask how much the data could change before our optimal plan changes. For now, we take the data as given.
Learning Checkpoint 2.2.1
In a short sentence or two, discuss whether the problem in Example 2.1 meets all assumptions of a linear programming model.
Hint: Can you print of a t-shirt? Can you run a process for of an hour?
Learning Outcomes
We will begin with a few examples, and then discuss specific problem types that occur often.
Example 2.4: Production Planning
A manufacturing firm seeks to optimize its production schedule over a two-day planning horizon to meet daily demand while minimizing costs. The firm starts with an initial inventory of units. The costs associated with production and inventory are as follows:
Production costs: $10 per unit on Day 1, and $16 per unit on Day 2.
Inventory cost: $5 per unit for carrying excess inventory from one day to the next.
Solution
Sets:
Days of production .
Parameters:
: Per unit production cost on Day 1 ($10).
: Per unit production cost on Day 2 ($16).
: Per unit inventory cost ($5).
: Demand on Day 1 (10 units).
: Demand on Day 2 (4 units).
: Inventory at the start of Day 1.
Variables:
: Number of units produced on Day 1.
: Number of units produced on Day 2.
: Inventory at the end of Day 1.
: Inventory at the end of Day 2.
Model:
Definition 2.5: Optimization model components
When defining an optimization model, it is essential to identify and clearly articulate the following five components:
Sets: What lists of data do you need to write down? These could include indices, categories, or groups relevant to the problem.
Parameters (Data): What is the actual data for the problem? These are the fixed numerical values such as costs, capacities, or resource availabilities.
Decision Variables: What decisions need to be made to provide a solution? These variables represent the quantities that can be controlled or adjusted, such as production levels or resource allocations.
Objective Function: The expression that we want to maximize or minimize. This is the goal of the optimization, such as minimizing cost or maximizing profit.
Constraints: Certain rules that those decision variables should satisfy. These include limitations or requirements, such as resource capacities or demand fulfillment.
Each of these components plays a key role in formulating a well-structured optimization model that accurately represents the problem and provides actionable solutions. The role of Sets will become more important as we get into more complicated optimization models.
Example 2.6: Bakery Production
A small bakery produces three products each day: cakes, cookies, and muffins. Each item requires a specific amount of ingredients and baking time, and each contributes to the bakery’s profit. The bakery operates with daily limits on flour, sugar, and baking time due to ingredient supply and staffing constraints.
Each cake earns a profit of $6.00, requires 500 grams of flour, 200 grams of sugar, and 60 minutes of baking time. Each cookie earns a profit of $1.50, requires 100 grams of flour, 50 grams of sugar, and 10 minutes of baking time. Each muffin earns a profit of $2.50, requires 200 grams of flour, 80 grams of sugar, and 20 minutes of baking time.
The bakery has at most 4,800 grams of flour, 2,060 grams of sugar, and 480 minutes of baking time available each day.
Determine how many cakes, cookies, and muffins the bakery should produce each day in order to maximize its total profit, while staying within the limits on flour, sugar, and baking time.
Example 2.7: Production with welding robot
You have 21 units of transparent aluminum alloy (TAA), LazWeld1, a joining robot leased for 23 hours, and CrumCut1, a cutting robot leased for 17 hours of aluminum cutting. You also have production code for a bookcase, desk, and cabinet, along with commitments to buy any of these you can produce for $18, $16, and $10 apiece, respectively. A bookcase requires 2 units of TAA, 3 hours of joining, and 1 hour of cutting, a desk requires 2 units of TAA, 2 hours of joining, and 2 hours of cutting, and a cabinet requires 1 unit of TAA, 2 hours of joining, and 1 hour of cutting.
Formulate an LP to maximize your revenue given your current resources.
Solution
Sets:
The types of objects bookcase, desk, cabinet.
Parameters:
Purchase cost of each object
Units of TAA needed for each object
Hours of joining needed for each object
Hours of cutting needed for each object
Hours of TAA, Joining, and Cutting available on robots
Variables:
: number of
units of product
to produce,
for all bookcase, desk, cabinet.
Model:
Example 2.8: The Diet Problem
In the future (as envisioned in a bad 70’s science fiction film) all food is in tablet form, and there are four types, green, blue, yellow, and red. A balanced, futuristic diet requires at least 20 units of Iron, 25 units of Vitamin B, 30 units of Vitamin C, and 15 units of Vitamin D. Formulate an LP that ensures a balanced diet at the minimum possible cost.
Solution
Sets:
Set of tablets
Parameters:
Iron in each tablet
Vitamin B in each tablet
Vitamin C in each tablet
Vitamin D in each tablet
Cost of each tablet
Variables:
: number of tablets
of type to include
in the diet, .
Model:
Example 2.9: The Next Diet Problem
Progress is important, and our last problem had too many tablets, so we are going to produce a single, purple, 10 gram tablet for our futuristic diet requirements, which are at least 20 units of Iron, 25 units of Vitamin B, 30 units of Vitamin C, and 15 units of Vitamin D, and 2000 calories. The tablet is made from blending 4 nutritious chemicals; the following table shows the units of our nutrients per, and cost of, grams of each chemical.
Formulate an LP that ensures a balanced diet at the minimum possible cost.
Solution
Sets:
Set of chemicals
Parameters:
Iron in each chemical
Vitamin B in each chemical
Vitamin C in each chemical
Vitamin D in each chemical
Cost of each chemical
Variables:
: grams of chemical
to include in the
purple tablet, .
Model:
The diet problem might feel like a toy. It is not.
Case Study: Feeding Millions: The World Food Programme’s Optimization Engine
The United Nations World Food Programme (WFP) is the world’s largest humanitarian organization, assisting roughly 100 million people a year in places like Iraq, Yemen, and South Sudan. Every operation must answer the same questions: what food basket to provide, where to buy it, and how to move it. WFP built an optimization tool, Optimus, that answers all three at once, and the team won the 2021 INFORMS Franz Edelman Award for it.
A food basket must meet nutritional requirements (energy, protein, fat, micronutrients) for a beneficiary, using commodities that can actually be procured and delivered through a network of suppliers, ports, warehouses, and distribution points, each with costs and capacities. Cheaper baskets can be less nutritious; more nutritious baskets can be undeliverable. Before Optimus, these decisions were made separately by different teams.
Model type: mixed-integer linear program. The core is the classical diet LP joined to a min-cost flow model; integer variables handle choices such as transfer modality (food vs. cash). No machine learning inside the optimization; demand and price inputs come from WFP assessments.
A simplified version with the two key ingredients:
Variables:
Let be the amount of commodity (grams per person per day) in the food basket.
Let be the flow of commodity on arc of the supply network.
Model:
where is the amount of nutrient per gram of commodity and is the daily requirement. The published model adds palatability rules (e.g., the basket cannot be all lentils), sourcing decisions, multi-period planning, and the food-vs.-cash modality choice, which is where the integer variables enter.
Nutritional needs are modeled per “average beneficiary”; the paper discusses requirements by demographic profile.
Prices and lead times are taken as data; the paper describes how WFP updates them per operation.
In Iraq, the tool cut operating costs by 17 percent, and the resulting food baskets met 98 percent of the nutrition requirements; WFP has since applied it across its major operations. The full MILP is printed in the paper, which is open access, so students can read exactly what was modeled and what was assumed.
K. Peters, S. Silva, R. Gonalves, M. Kavelj, H. Fleuren, D. den Hertog, O. Ergun, M. Freeman. “The Nutritious Supply Chain: Optimizing Humanitarian Food Assistance.” INFORMS Journal on Optimization 3(2), 200–226, 2021. https://doi.org/10.1287/ijoo.2019.0047
Example 2.10: Work Scheduling Problem
You are the manager of LP Burger. The following table shows the minimum number of employees required to staff the restaurant on each day of the week. Each employee must work for five consecutive days. Formulate an LP to find the minimum number of employees required to staff the restaurant.
Solution
This problem has multiple optimal solutions for which days workers begin working on, all of which result in 8 total workers hired.
Variables:
:
the number of workers that start 5 consecutive days of work on day ,
Model:
One solution is as follows. The LP relaxation gives with fractional values . Rounding to an integer solution yields with .
Example 2.11: LP Burger - extended
LP Burger has changed its policy, and allows, at most, two part-time workers, who work for two consecutive days in a week. Formulate this problem.
Solution
Variables:
:
the number of workers that start 5 consecutive days of work on day ,
:
the number of workers that start 2 consecutive days of work on day , .
Model:
We consider now a simple example where the variables can only take the values of 0 or 1. We call these binary variables.
Example 2.12: Camping Trip
Imagine you are preparing for a week-long camping trip to the mountains. You
have a backpack with a weight capacity of 20 kilograms. Your goal is to
pack the most valuable items to ensure a comfortable and safe trip without
exceeding the backpack’s weight limit. Each item has a weight and a value
associated with it, representing its importance and utility for the trip. The table
below lists the potential items you can take, their weights in kilograms,
and their values on a scale from 1 to 10 (with 10 being the most valuable).
Formulate an Integer Program to find the optimal items you should bring on your
trip with you.
Solution
Variables:
: whether to
include item in the
backpack, where ,
if item is included,
and
otherwise.
Model:
We next see a similar application of binary variables.
Example 2.13: Capital Allocation Problem
You are a financial planner for an investment firm. The firm has $100,000 to invest in a portfolio of projects. Each project has a projected return and requires an initial investment. The goal is to maximize the total return of the portfolio while not exceeding the available capital. The following table lists potential projects, their required investments, and their projected returns.
Formulate an LP to maximize the total return of the portfolio while not exceeding the available investment capital.
Solution
Sets:
Projects:
Parameters:
: investment required for project
: projected return from project
: total available capital
Variables:
: 1 if
project
is selected, 0 otherwise
Model:
Compact Form:
Example 2.14: Solar Panel Shipping
SolTranz Inc. manufactures high-efficiency solar panels at three factories located in Reno (R), Boulder (B), and Tucson (T). The maximum production at each facility is 4,500, 5,500, and 7,000 panels, respectively. These panels must be shipped to five warehouses (labeled 1 through 5), each with a fixed demand.
The cost of producing a solar panel depends on the factory, and the shipping costs to each warehouse are also known. However, no more than 2,000 panels can be shipped from a factory to a single warehouse. The table below summarizes the data.
Formulate a linear program that minimizes the total cost of production and shipping to satisfy all warehouse demands.
Warehouse Demands:
Solution
Sets:
Factories:
Warehouses:
Parameters:
: production cost per panel at factory
: supply capacity of factory
: demand at warehouse
: shipping cost per panel from factory to warehouse
: max panels shipped from any factory to any warehouse
Variables:
: number of solar panels
shipped from factory
to warehouse
Model:
Consider the assignment of employees to tasks, where each employee has a cost to do each task. How to figure out the best assignment to the tasks?
Example 2.15: Hiring for tasks
In this assignment problem, we need to hire three people (Person 1, Person 2, Person 3) to three tasks (Task 1, Task 2, Task 3). In the table below, we list the cost of hiring each person for each task, in dollars. Since each person has a different cost for each task, we must make an assignment to minimize our total cost.
| Cost | Task 1 | Task 2 | Task 3 |
| Person 1 | 45 | 38 | 60 |
| Person 2 | 52 | 41 | 33 |
| Person 3 | 27 | 49 | 56 |
Given the specific costs of assigning three people to three tasks, we can write out the mathematical model explicitly using the given numbers.
Solution
Sets:
Persons:
Tasks:
Parameters:
: cost for person to complete task
Variables:
if person is assigned
to task ,
and
otherwise.
Model:
Work through the following problems to practice formulating linear programs.1
Exercise 2.16: Identify Linear Functions
Which ones are linear functions?
Exercise 2.17: Identify Linear Function
Which one is a linear function?
Exercise 2.18: Hoodies and Posters
A print shop produces custom hoodies and posters. Each hoodie sells for $30 and costs $18 in materials, while each poster sells for $8 and costs $3 in materials. A hoodie requires 3 hours of printing time and 1 hour of finishing, while a poster requires 1 hour of printing time and 1 hour of finishing. The shop has at most 120 hours of printing time and 70 hours of finishing time available per week, and it will sell no more than 35 hoodies per week. Following the structure of Example 2.1, define decision variables, compute the profit coefficients, and write out the complete linear program that maximizes weekly profit.
Exercise 2.19: Smoothie Powders
A smoothie stand blends three supplement powders into its daily mix. Per scoop, powder A costs $1.20 and provides 6 g of protein, 3 g of fiber, and 2 mg of iron; powder B costs $0.80 and provides 4 g of protein, 2 g of fiber, and 3 mg of iron; powder C costs $0.60 and provides 2 g of protein, 4 g of fiber, and 1 mg of iron. The daily mix must contain at least 24 g of protein, 18 g of fiber, and 12 mg of iron. Following the structure of Example 2.8, formulate an LP that meets the requirements at minimum cost. Then solve it with software and verify that the optimal mix uses exactly 2 scoops of each powder, at a cost of $5.20.
Exercise 2.20: Chemical Manufacturing
A specialty coatings plant makes three additives, labeled A, B, and C, as joint outputs of two continuous production lines. Each hour that Line 1 runs costs $5 in energy and labor and outputs 2 drums of A, 3 drums of B, and 1 drum of C. Each hour that Line 2 runs costs $2 and outputs 1 drum of A and 2 drums of C (Line 2 cannot make B). Contracts require the plant to deliver at least 8 drums of A, 6 drums of B, and 5 drums of C each day. The plant manager wants a daily operating schedule for the two lines that meets the contracts at the lowest cost.
Formulate a linear program for the manager’s problem. State your decision variables clearly, including their units.
[Hint: the decisions are how long to run each line, not how much of each chemical to make. Once you choose those variables, both the cost and the output of each chemical are linear expressions in them.]
Exercise 2.21: E-Bike Showroom
A showroom sells three e-bike models: commuter, cargo, and mountain. Each commuter, cargo, and mountain bike on display requires, respectively, 2, 4, and 3 square meters of floor space; the showroom has 60 square meters available. Selling one bike takes 2, 3, and 2 hours of staff time respectively, and 120 staff hours are available per month. Each sold bike also needs 1, 3, and 2 hours respectively in the assembly bay, which has 75 hours available per month.
If the profit (in dollars) per commuter, cargo, and mountain bike is 150, 300, and 240 respectively, how many of each model should the showroom plan to sell each month to maximize profit, and what is the maximum profit?
Exercise 2.22: Manufacturing Profit Problem
A furniture workshop builds bookcases, desks, and cabinets. Every piece passes through two workstations: a CNC router and a finishing station. The router is available 200 hours per month and the finishing station 240 hours per month. The table below shows the time requirements (in hours per unit) and profit per unit for each product.
Exercise 2.23: Juice Bottling Plants
A beverage company bottles three juices (apple, orange, and grape) at two plants. The number of cases each plant bottles per day of operation is listed below:
Exercise 2.24: Quiz Grading Minimization
Professor Wright gives three types of quizzes (objective, recall, and recall-plus) and decides to give at least 20 quizzes next quarter. Each type of quiz requires the students to spend extra preparation time:
He wants students to spend at least 12 hours (720 minutes) in total preparation for these quizzes (beyond normal study time).
Average quiz scores are:
He wants the total of all quiz scores to be at least 130 points.
It takes the professor:
How many of each type should he give in order to minimize his own grading time?
Exercise 2.25: Campus Café Scheduling
A campus café is open seven days a week. Each barista works four consecutive days and then has three days off. The minimum number of baristas needed each day is:
Exercise 2.26: Identify Linear Inequalities
Which ones are linear inequalities? Can any be made into linear inequalities?
Exercise 2.27: Random Costs in the Objective
In every model so far, the objective coefficients were fixed numbers. Now suppose each cost coefficient is not known exactly; instead, you know its probability distribution. Propose a single deterministic linear program whose solution is a sensible plan under this uncertainty, and explain what your objective function represents.
[Hint: if a lottery ticket pays some amount between $1 and $2 with all values equally likely, what single number summarizes its worth to you? Apply the same summary to each .]
[§2.2]
Exercise 2.28: Which Assumption Breaks?
For each scenario below, name the linear programming assumption (proportionality, additivity, divisibility, or certainty) that is most clearly violated, and explain your choice in one sentence.
Then answer: in scenario (a), does the violation cause any harm if the company is certain to buy more than 100 units, and the model only needs to be accurate in that range?
Exercise 2.29: Production with Rented Labor
A workshop makes three products, A, B, and C, with profits of $30, $45, and $24 per unit. Each unit of A, B, C uses 2, 4, and 1 machine-hours, and at most 160 machine-hours are available per week. Each unit uses 3, 3, and 2 labor hours. The workshop has 180 labor hours of its own, and here is the twist: it may also rent up to 30 additional labor hours from a staffing agency at $9 per hour, choosing the rented amount as part of the plan.
Solution
(Exercise 2.20) Let and be the daily running time (in hours) of Line 1 and Line 2. Each hour of Line 1 costs $5 and each hour of Line 2 costs $2, and each contract becomes a lower-bound constraint on total output:
Solving (graphically or with software) gives hours and hours, with daily cost . The A and B contracts are met exactly ( and ), while C is over-delivered: the schedule produces drums against the required.
Solution
(Exercise 2.26) Only (4) and (5) are linear as written: both have the form compared to a constant. (An equation like (4) is fine in a linear program; it is equivalent to the pair of inequalities and .) Inequality (1) is not linear because the variables appear in a ratio, but it can be made linear: if we know , multiplying both sides by the denominator gives , that is, . Inequalities (2) and (3) cannot be repaired: and are nonlinear functions of the variables, and no algebraic rearrangement removes them.
Solution
(Exercise 2.22) Let be the number of bookcases, desks, and cabinets built per month. Each workstation’s hours give one constraint:
The optimal solution is bookcases, desks, cabinets, with maximum profit $4200. Both workstation constraints are binding, and it is not worth building cabinets: a cabinet earns $55 but uses more router and finishing time than the combination of bookcases and desks it displaces.
Solution
(Exercise 2.23) Let and be the number of days that Plant 1 and Plant 2 operate. We minimize operating cost subject to filling the order:
The optimal solution is days and day, with minimum cost $49,500. At this point the orange and grape constraints are binding, while apple juice is overproduced ( cases).
Solution
(Exercise 2.18) Let be the number of hoodies and the number of posters produced per week. The profit per hoodie is and the profit per poster is , so the model is
The optimal solution is hoodies and posters, where the printing and finishing constraints intersect, with weekly profit . Producing the maximum 35 hoodies is not optimal: it leaves only printing hours for posters, and the profit drops to .
Solution
(Exercise 2.29) Hint: rented hours enter the objective as a cost, , and enter the labor constraint as extra capacity, with . Since product C converts each labor hour into $12 of profit and rented hours cost only $9, an optimal plan rents all 30 hours. Software gives the optimal plan , , , , with both the machine and labor constraints binding and net profit .