Linear Algebra · Linear Algebra
Introduction to Linear Programming: Decision Variables, Objective Function, and Constraints
Explanation
Intuition: What Is an Optimization Problem?
Suppose you have limited resources (time, raw materials, budget) and need to decide how to allocate them among several options to achieve the best possible outcome — maximize profit, or minimize cost. This is an "optimization problem." Linear Programming (LP) is its most important and common special case: the case where every relationship — both the goal and the restrictions — can be described using linear expressions (sums of variables multiplied by constants, with no squares, products of variables, or roots).
The word "programming" here does not refer to computer programming — it is a historical term for the "planning" methods George Dantzig developed in the 1940s (the Simplex method). Linear programming underlies an entire field called Operations Research, used in industrial planning, logistics, nutrition, finance, and more.
The Three Components of an LP Model
Every LP problem is built from three components, and they should be identified and written in this order:
1. Decision Variables — the unknown quantities we must decide on, e.g. (often written when there are only two).
2. Objective Function — a linear expression we want to maximize or minimize:
where are given coefficients (e.g., profit per unit, or cost per unit).
3. Constraints — a system of linear inequalities (or equalities) restricting the variables' values:
We almost always add non-negativity constraints as well: , since decision variables typically represent physical quantities (product units, work hours) that cannot be negative.
A Guiding Example: "Carmel Glass Co."
A company plans to produce two new products: special glass doors ( units per week) and special glass windows ( units per week). It has three plants:
- Plant 1 produces frames for doors only — each door requires 1 hour of production, and the plant has 4 hours available per week.
- Plant 2 produces frames for windows only — each window requires 2 hours of production, and the plant has 12 hours available per week.
- Plant 3 produces the glass for both products — each door requires 3 hours and each window requires 2 hours, and the plant has 18 hours available per week.
Profit per unit is 3 (thousand ILS) per door and 5 (thousand ILS) per window. The decision variables are (doors) and (windows). The objective function (maximize weekly profit):
The constraints (each plant's production hours cannot exceed its available time):
This is a complete LP model. In the next lesson, we'll learn to describe such a model's feasible region graphically, and in the lesson after that, how to find the optimal solution.
Why Is Linearity Critical?
Linearity guarantees that every single constraint defines a half-plane — a convex region: the segment joining any two points in the region lies entirely inside it. The intersection of convex half-planes is itself convex. This property — that the feasible region is always convex — is the foundation for everything in the rest of this lesson group: it guarantees that this region is a polygon (if bounded), and that the optimal solution is always found at one of its vertices.
Edge Cases and Key Points
- **Strict inequalities ():** Standard LP always works with (not ) — this way the feasible region includes its own boundary (it is closed), which guarantees (for a bounded region) that some point actually attains the extreme value, rather than merely "approaching" it.
- Integer variables: LP assumes decision variables are continuous (any non-negative real number). If the solution must consist of whole numbers only (e.g., the number of cars produced), this is a different and harder problem called Integer Programming — the LP solution methods (covered later) do not automatically guarantee an integer solution.
- Any non-linear expression (such as , , ) in the objective function or a constraint means the problem is not LP, and nonlinear programming methods are required.
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 8
1
Which of the following is NOT a component of a linear programming model?
★Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)