UPI Study › Courses › Quantitative Analysis › Free lessons › Lesson 9.1 Free with a free account
Constraints as Equations
Quantitative Analysis · Chapter 9: Linear and Integer ProgrammingSection 9.1 · lesson 40 of 5512 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Quantitative Analysis.
Lesson complete
Earn the 3 college credits for Quantitative Analysis
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Indivisible by Design →← Across Cultures and BordersNext lesson: Indivisible by Design →
In this lesson
Constructing linear programming models from real business problems.
- Identify variables, objective and constraints
- Translate a verbal description into an LP model
- Distinguish the four business LP problem types
- Formulate a complete multi-resource LP model
Transcript
Everything said in the video, section by section (1,733 words). Read along, or search it.
Linear and Integer Programming · Section 9.1
Constraints as Equations
Welcome to section nine point one, Constraints as Equations. Linear programming is the workhorse of quantitative optimisation in business. But before any solver can help you, somebody has to write the model down. That translation step is called formulation, and it is the whole subject of this section. We begin with the four components that every linear programming model contains. Then we look at the four families of problems that recur across industries. After that come four formulation tips that catch the most common errors. Finally, we build a complete model for a two product manufacturer. By the end, you should be able to turn a paragraph of business description into algebra. That skill transfers to every optimisation topic that follows.
The Workhorse
Why Formulation Comes First
Think about the decisions a manager actually faces each week. How many units of each product to produce. What mix of ingredients to use in a blend. How to allocate workers across shifts, or how to route shipments. Every one of those asks how much of several activities to undertake. And every one of them runs into limits, because resources are finite. Linear programming gives a structured, mathematical way to find the best possible plan. Notice the word possible. The plan has to satisfy the constraints, not just look attractive. Formulation is the bridge between the business situation and the algebra. On one side is the business situation, on the other, a structure that graphical, simplex or software methods can solve. Get the bridge wrong, and even the best solver returns a confident but useless answer.
Model Anatomy
The Four Components of an LP Model
Every linear programming model is built from four essential components. This is true regardless of the industry, and regardless of the size of the problem. First, the decision variables: the quantities the manager controls. In a two product plant, x one is units of product A and x two is units of product B. Second, the objective function, a linear function of those variables. It is maximised for profit or revenue, and minimised for cost or time. Third, the constraints, which are linear inequalities or equalities. They restrict the feasible set to plans the firm can actually carry out. Resource limits use less than or equal to, minimum requirements use greater than or equal to, and exact balances use an equals sign. Fourth, non-negativity. In standard linear programming every variable must be at least zero. That is not bookkeeping. It encodes the fact that you cannot produce a negative quantity.
Recognising The Form
Four Families of LP Problems
Linear programming is a general framework, but in practice it appears in four classic forms. Recognising the form helps you identify variables and constraints much more quickly. The first is product mix. The variables are units of each product. The objective maximises profit, and the constraints are machine hours, labour hours and materials. The second is blending. Here the variables are proportions of ingredients. The objective minimises cost, subject to nutritional or quality specifications. The third is scheduling, where the variables are workers assigned to each shift. The objective minimises labour cost, subject to coverage requirements in every time period. The fourth is transportation, with units shipped from each source to each destination. The objective minimises total shipping cost, subject to supply and demand at every node. Transportation has a special network structure and a specialised solution algorithm. For that reason it gets a chapter of its own, chapter twelve.
Avoiding Errors
Formulation Tips: Variables and Sides
Even experienced analysts can produce an invalid model if they skip the verification steps. These tips separate a model that solves cleanly from one that fails or returns nonsense. Tip one. Define one variable for each controllable quantity. That means a separate variable for each distinct product, ingredient, shift or route. Not one variable per category. If a firm makes standard and deluxe chairs, that is two variables, not one variable called chairs. Collapsing them assumes both chairs use resources identically and earn identical profit. The model will still solve. It will simply answer a different question than the one you asked. Tip two. Put the limiting resource on the right hand side of each constraint. Written that way, the constraint reads as machine A usage is at most machine A availability. That habit makes an error visible the moment you read the line back.
Units And Linearity
Formulation Tips: Units and Linearity
Tip three. Check your units on both sides of every constraint. If the left side is expressed in hours, the right side must also be in hours. Not days, not units of output, and certainly not dollars. Get that wrong and the model may still solve, but it answers a nonsense question. Tip four. Verify linearity, because linear programming requires every term to be linear. That rules out multiplying two decision variables together. It rules out powers, such as a variable squared, and it rules out absolute values and piecewise functions. If your formulation contains any of these, it is not a linear program. It is a non-linear program, and it needs entirely different techniques. Linearity and non-negativity are the standing assumptions behind every method in this course. Dropping either one quietly invalidates the solution you get back.
The Workflow
A Repeatable Five-Step Workflow
The same five moves will formulate any linear programming model. They work for a two product workshop and for a refinery with thousands of variables. Step one. Read the problem and note exactly what the manager controls. Step two. Identify the variables, one per controllable quantity, and state their units. Units matter here, because units per week and units per day give different models. Step three. Write the objective, either a maximisation or a minimisation. It must be linear in the decision variables you just defined. Step four. List the constraints, with the resource amount on the right hand side. Then add the non-negativity restrictions, which are easy to forget. Step five. Verify that units match and that no term contains a product or a power. That last step confirms units and linearity, and it costs almost nothing to run.
Worked Example
The Two-Machine Manufacturer
Now let us formulate a complete model from a verbal description. A manufacturer produces two products using two machines. Machine A is available forty hours per week, and machine B is available thirty hours per week. Product one requires two hours on machine A and one hour on machine B. Product two requires one hour on machine A and three hours on machine B. Profit is five dollars per unit of product one, and four dollars per unit of product two. The task is to formulate the linear programming model completely. Step one is simply to organise the data into a table. That is not decoration. Each resource row of the table becomes a constraint. Each product column becomes a decision variable, and the profit row becomes the objective function. Once the table is laid out, the algebra almost writes itself.
Steps Two And Three
Decision Variables and Objective
Step two. Define the decision variables. The manager controls the production quantity of each product, so there is one variable per product. Let x one be the number of units of product one produced per week. Let x two be the number of units of product two produced per week. Notice that each definition carries a unit and a time period. Per week is part of the definition, not an afterthought. Step three. Write the objective function. Total weekly profit is profit per unit multiplied by units produced, summed across products. So the objective is five x one plus four x two. Because profit should be as high as possible, we maximise that expression. Check the shape of it. A single linear function, no products of variables and no powers. That confirms the objective is admissible for linear programming.
Steps Four And Five
Constraints and the Complete Model
Step four. Express the constraints, because each machine has limited weekly hours available. The hours used by both products on a given machine cannot exceed the hours available. On machine A, product one uses two hours per unit and product two uses one hour. So two x one plus x two must be less than or equal to forty. On machine B, product one uses one hour per unit and product two uses three hours. So x one plus three x two must be less than or equal to thirty. Then add non-negativity, because production cannot be negative. Both x one and x two must be greater than or equal to zero. Step five collects all of it into the complete model, and that is the deliverable. Now read the units back on the first constraint. Two hours per unit times x one units gives hours, and forty is also hours. That check takes seconds, and a mismatch there means the constraint is simply wrong.
Step Six
The Feasible Region and Its Corners
Step six. Visualise the feasible region. Plotting both constraints on a graph shows every valid production plan at once. Every point inside the shaded region satisfies both machine limits and non-negativity. Here is the result that makes two variable problems easy. The optimal solution always lies at a corner point, where constraints intersect. So you only need to evaluate the objective at the four corners of this region. At the origin, producing nothing, profit is zero. At twenty units of product one and none of product two, profit is one hundred dollars. At none of product one and ten of product two, profit is only forty dollars. At eighteen units of product one and four of product two, profit is one hundred and six dollars. That is the maximum, and corner C is where the two machine constraints intersect. At that point both machines run at full capacity, with no idle hours on either.
Section Summary
What to Carry Forward
Let us gather what to carry forward from this section. Define one decision variable for each distinct controllable quantity, with clear notation. Write a single linear objective function, either maximised or minimised. Use less than or equal to for limits, greater than or equal to for requirements. Use an equals sign for exact balances. Standard linear programming requires every decision variable to be at least zero. Run the linearity check: no product of variables, no powers, no absolute values. The feasible region is the set of values that satisfy every constraint at once. A corner point is where two or more constraints meet, and the optimum sits at one of them. With two variables you can solve graphically; at any size, simplex or software will do it. Notice that the answer of eighteen and four followed directly from steps two to four. Careful, correct formulation is the most important step in any optimisation project.
About Quantitative Analysis at UPI Study
Quantitative Analysis (Math 250) is a self-paced online course of 55 video lessons in 13 chapters, from decision analysis and simulation to inventory and queuing models, project scheduling, linear programming and transportation models. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Math courses Every course with PRO →
Compare: Statistics vs Quantitative Analysis
Why take it here
Why students take Quantitative Analysis with UPI Study
Where the credit goes
Universities that work with NCCRS
Quantitative Analysis carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Constraints as Equations
What are the components of a linear programming model?
How do you formulate a linear programming problem from a word problem?
What is an example of a product mix linear program?
What are common mistakes when formulating a linear program?
About the Quantitative Analysis course
How many college credits is Quantitative Analysis?
How much does Quantitative Analysis cost and what is included?
Which universities accept UPI Study credits?
How long does Quantitative Analysis take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Quantitative Analysis.
55 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
3 credits · NCCRSEnroll →