Professional Documents
Culture Documents
Optimization Theory
林顯易
陽明交大 電控所
sofin@nycu.edu.tw
Linear programming
1
INTRODUCTION
The goal of linear programming is to determine the values of decision variables
that maximize or minimize a linear objective function, where the decision
variables are subject to linear constraints.
A linear programming problem is a special case of a general constrained
optimization problem. In the general setting, the goal is to find a point that
minimizes the objective function and at the same time satisfies the constraints.
We refer to any point that satisfies the constraints as a feasible point. In a linear
programming problem, the objective function is linear, and the set of feasible
points is determined by a set of linear equations and/or inequalities.
INTRODUCTION
In this part, we study methods for solving linear programming problems. Linear
programming methods provide a way of choosing the best feasible point among
the many possible feasible points. In general, the number of feasible points is
infinitely large.
2
Simple example of linear programs
minimize 𝒄𝑻 𝒙
subject to 𝑨𝒙 = 𝒃
𝒙 ≥ 𝟎,
where 𝑐 ∈ ℝ , 𝒃 ∈ ℝ , and 𝑨 ∈ ℝ × . The vector inequality 𝒙 ≥ 𝟎 means that
each component of 𝒙 is nonnegative. Several variations to the above problem are
possible; for example, instead of minimizing, we can maximize, or the
constraints may be in the form of inequalities, such as 𝑨𝒙 ≥ 𝒃, or 𝑨𝒙 ≤ 𝒃. We
also refer to these variations as linear programs. In fact, as we shall see later,
these variations can all be rewritten into the standard form shown above.
Example
Example 15.1 A manufacturer produces four different products 𝑋 , 𝑋 , 𝑋 , and 𝑋 . There
are three inputs to this production process: labor in man weeks, kilograms of raw material
A, and boxes of raw material B. Each product has different input requirements. In
determining each week's production schedule, the manufacturer cannot use more than
the available amounts of manpower and the two raw materials. The relevant information
is presented in Table 15.1. Every production decision must satisfy the restrictions on the
availability of inputs. These constraints can be written using the data in Table 15.1. In
particular, we have
𝑥 + 2𝑥 + 𝑥 + 2𝑥 ≤ 20
6𝑥 + 5𝑥 + 3𝑥 + 2𝑥 ≤ 100
3𝑥 + 4𝑥 + 9𝑥 + 12𝑥 ≤ 75.
𝑥 ≥ 0, 𝑖 = 1,2,3,4.
3
Example
Now, suppose that one unit of product 𝑋 sells for $6, and 𝑋 , 𝑋 , and 𝑋 sell for
$4, $7, and $5, respectively. Then, the total revenue for any production decision
𝑥 , 𝑥 , 𝑥 , 𝑥 is
𝑓 𝑥 , 𝑥 , 𝑥 , 𝑥 = 6𝑥 + 4𝑥 + 7𝑥 + 5𝑥 .
𝑥 + 2𝑥 + 𝑥 + 2𝑥 ≤ 20
6𝑥 + 5𝑥 + 3𝑥 + 2𝑥 ≤ 100
3𝑥 + 4𝑥 + 9𝑥 + 12𝑥 ≤ 75.
𝑥 ≥ 0, 𝑖 = 1,2,3,4.
The problem is then to maximize 𝑓, subject to the given constraints (the three
inequalities and four nonnegativity constraints).
Example
Note that the above problem can be written in the compact form:
maximize 𝑓(𝒙) = maximize 𝒄 𝒙
subject to 𝑨𝒙 ≤𝒃
𝒙 ≥𝟎
where
𝒄 = [6,4,7,5],
𝒙 = 𝑥 ,𝑥 ,𝑥 ,𝑥 ,
1 2 1 2
𝑨 = 6 5 3 2 ,
3 4 9 12
20
𝒃 = 100 .
75
4
Example
Example 15.2 Diet problem. Assume there are 𝑛 different food types available.
The 𝑗 th food sells at a price 𝑐 per unit. In addition there are 𝑚 basic nutrients.
To achieve a balanced diet, you must receive at least 𝑏, units of the 𝑖th nutrient
per day. Assume that each unit of food 𝑗 contains 𝑎 units of the ith nutrient.
Denote by 𝑥 the number of units of food 𝑗 in the diet.
The objective is to select the 𝑥,'s to minimize the total cost of the diet, that is,
minimize 𝑐 𝑥 + 𝑐 𝑥 + ⋯ + 𝑐 𝑥
subject to the nutritional constraints
𝑎 𝑥 +𝑎 𝑥 +⋯+𝑎 𝑥 ≥ 𝑏
Example
𝑎 𝑥 + 𝑎 𝑥 + ⋯+ 𝑎 𝑥 ≥𝑏
⋮
𝑎 𝑥 +𝑎 𝑥 + ⋯+ 𝑎 𝑥 ≥𝑏 ,
and the nonnegativity constraints
𝑥 ≥ 0, 𝑥 ≥ 0, … , 𝑥 ≥ 0
10
5
Example
minimize 𝒄 𝒙
subject to 𝑨𝒙 ≥ 𝒃
𝒙 ≥ 𝟎,
where 𝒙 is an 𝑛 -dimensional column vector, that is, 𝒙 =
𝑥 , 𝑥 , … , 𝑥 , 𝑐 is an 𝑛-dimensional row vector, 𝑨 is an 𝑚 × 𝑛
matrix, and 𝒃 is an 𝑚-dimensional column vector. We call the above
problem the diet problem,
11
Example
Example 15.3 A manufacturer produces two different products 𝑋 and 𝑋 using
three machines 𝑀 , 𝑀 , and 𝑀 . Each machine can be used only for a limited
amount of time. Production times of each product on each machine are given in
Table 15.2. The objective is to maximize the combined time of utilization of all
three machines.
Every production decision must satisfy the constraints on the available time.
These restrictions can be written down using data from Table 15.2. In particular,
we have
𝑥 +𝑥 ≤8
𝑥 + 3𝑥 ≤ 18
2𝑥 + 𝑥 ≤ 14,
where 𝑥 and 𝑥 denote the
production levels.
12
6
Example
13
Example
Example 15.4 A manufacturing company has plants in cities A, B, and C. The
company produces and distributes its product to dealers in various cities. On a
particular day, the company has 30 units of its product in A, 40 in B, and 30 in C.
The company plans to ship 20 units to D, 20 to E, 25 to F, and 35 to G, following
orders received from dealers. The transportation costs per unit of each product
between the cities are given in Table 15.3. In the table, the quantities supplied
and demanded appear at the right and along the bottom of the table. The
quantities to be transported from the plants to different destinations are
represented by the decision variables.
14
7
Example
This problem can be stated in the form:
minimize 7𝑥 + 10𝑥 + 14𝑥 + 8𝑥 + 7𝑥 + 11𝑥 + 12𝑥
+6𝑥 + 5𝑥 + 8𝑥 + 15𝑥 + 9𝑥
subject to 𝑥 + 𝑥 + 𝑥 + 𝑥 = 30
𝑥 + 𝑥 + 𝑥 + 𝑥 = 40
𝑥 +𝑥 +𝑥 +𝑥 = 30
𝑥 +𝑥 +𝑥 = 20
𝑥 +𝑥 +𝑥 = 20
𝑥 +𝑥 +𝑥 = 25
𝑥 +𝑥 +𝑥 = 35,
and
𝑥 ,𝑥 ,…,𝑥 ≥ 0.
15
Example
In this problem, one of the constraint equations is redundant because it can be
derived from the rest of the constraint equations.
The mathematical formulation of the transportation problem is then in a linear
programming form with twelve (3 × 4) decision variables and six (3 + 4 − 1)
linearly independent constraint equations.
Obviously, we also require nonnegativity of the decision variables, since a
negative shipment is impossible and does not have any valid interpretation.
16
8
Example
Example 15.5 Figure 15.1 shows an electric circuit that is designed to use a 30 V source to
charge 10 V, 6 V, and 20 V batteries connected in parallel. Physical constraints limit the
currents 𝐼 , 𝐼 , 𝐼 , 𝐼 , and 𝐼 to a maximum of 4 A, 3 A, 3 A, 2 A, and 2 A, respectively. In
addition, the batteries must not be discharged, that is, the currents 𝐼 , 𝐼 , 𝐼 , 𝐼 , and 𝐼 must
not be negative. We wish to find the values of the currents 𝐼 , … , 𝐼 such that the total power
transferred to the batteries is maximized.
The total power transferred to the batteries is the sum of the powers transferred to each
battery, and is given by 10𝐼 + 6𝐼 + 20𝐼 W. From the circuit in Figure 15.1, we observe that
the currents satisfy the constraints 𝐼 = 𝐼 + 𝐼 , and 𝐼 = 𝐼 + 𝐼 .
17
Example
18
9
Example
Example 15.6 Consider a wireless communication system as shown in Figure 15.2. There are
𝑛 "mobile" users. For each 𝑖 = 1, … , 𝑛, user 𝑖 transmits a signal to the base station with power 𝑝
and an attenuation factor of ℎ (i.e., the actual received signal power at the base station from
user 𝑖 is ℎ 𝑝 ). When the base station is receiving from user 𝑖, the total received power from all
other users is considered "interference" (i.e., the interference for user 𝑖 is ∑ ℎ 𝑝 ). For the
communication with user 𝑖 to be reliable, the signal-to-interference ratio must exceed a
threshold 𝛾 , where the "signal" is the received power for user 𝑖.
We are interested in minimizing the total power transmitted by all the users subject to having
reliable communications for all users.
19
Example
We can formulate the problem as a linear programming problem of the form
minimize 𝒄 𝒙
subject to 𝑨𝒙 ≥ 𝒃
𝒙 ≥ 𝟎.
We proceed as follows. The total power transmitted is 𝑝 + ⋯ + 𝑝 . The signal-to-
interference ratio for user 𝑖 is
ℎ𝑝
∑ ℎ𝑝
Hence, the problem can be written as
minimize 𝑝 + ⋯+ 𝑝
ℎ𝑝
subject to ≥ 𝛾 , 𝑖 = 1, … , 𝑛
∑ ℎ𝑝
𝑝 , … , 𝑝 ≥ 0.
20
10
Example
subject to ℎ 𝑝 −𝛾 ℎ 𝑝 ≥ 0, 𝑖 = 1, … , 𝑛
𝑝 , … , 𝑝 ≥ 0.
In matrix form, we have
𝒄 = [1, … , 1]
ℎ −𝛾 ℎ ⋯ −𝛾 ℎ
−𝛾 ℎ ℎ ⋯ −𝛾 ℎ
𝑨 =
⋮ ⋱ ⋮
−𝛾 ℎ −𝛾 ℎ ⋯ ℎ
𝒃 =𝟎
21
22
11
Two-dimensional linear programs
In the case of the above example, we can easily solve the problem using
geometric arguments. First let us sketch the constraints in ℝ𝟐 . The region of
feasible points (the set of points 𝑥 satisfying the constraints 𝑨𝒙 ≤ 𝒃, 𝒙 ≥ 𝟎)
is depicted by the shaded region in Figure 15.3.
Geometrically, maximizing 𝒄𝑻 𝒙 = 𝑥 + 5𝑥 subject to the constraints can be
thought of as finding the straight line 𝑓 = 𝑥 + 5𝑥 that intersects the
shaded region and has the largest 𝑓. The coordinates of the point of
intersection will then yield a maximum value of 𝒄𝑻 𝒙. In our example, the
point [0,5] is the solution (see Figure 15.3). In some cases, there may be
more than one point of intersection; all of them will yield the same value for
the objective function 𝒄𝑻 𝒙, and therefore any one of them is a solution.
23
24
12
Standard form linear programs
25
26
13
Standard form linear programs
27
28
14
Example
Example 15.7 Suppose that we are given the inequality constraint
𝑥 ≤ 7.
We convert this to an equality constraint by introducing a slack variable 𝑥 ≥ 0 to obtain
𝑥 +𝑥 =7
𝑥 ≥ 0.
Consider the sets 𝐶 = 𝑥 : 𝑥 ≤ 7 and 𝐶 = 𝑥 : 𝑥 + 𝑥 = 7, 𝑥 ≥ 0 . Are the sets 𝐶 and
𝐶 equal? It is clear that indeed they are; in this example, we give a geometric
interpretation for their equality. Consider a third set 𝐶 = 𝑥 , 𝑥 : 𝑥 + 𝑥 = 7, 𝑥 ≥
0}. From Figure 15.7, we can see that the set 𝐶 consists of all points on the line to the
left and above the point of intersection of the line with the 𝑥 axis. This set, being a
subset of ℝ , is of course not the same set as the set 𝐶 (a subset of ℝ ). However, we can
project the set 𝐶 onto the 𝑥 -axis (see Figure 15.7). We can associate with each point
𝑥 ∈ 𝐶 a point 𝑥 , 0 on the orthogonal projection of 𝐶 onto the 𝑥 -axis, and vice
versa. Note that 𝐶 = 𝑥 : 𝑥 , 𝑥 ∈𝐶 =𝐶 .
29
Example
30
15
Example
31
Example
𝑥 ,𝑥 ,𝑥 ≥ 0
Define the sets
𝐶 = 𝑥 , 𝑥 : 𝑎 𝑥 + 𝑎 𝑥 ≤ 𝑏, 𝑥 , 𝑥 ≥ 0 ,
𝐶 = 𝑥 , 𝑥 : 𝑎 𝑥 + 𝑎 𝑥 + 𝑥 = 𝑏, 𝑥 , 𝑥 , 𝑥 ≥ 0 ,
𝐶 = 𝑥 , 𝑥 , 𝑥 : 𝑎 𝑥 + 𝑎 𝑥 + 𝑥 = 𝑏, 𝑥 , 𝑥 , 𝑥 ≥ 0 .
We again see that 𝐶 is not the same as 𝐶 . However, the orthogonal projection of 𝐶
onto the 𝑥 , 𝑥 -plane allows us to associate the resulting set with the set 𝐶 . We
associate the points 𝑥 , 𝑥 , 0 resulting from the orthogonal projection of 𝐶 onto the
𝑥 , 𝑥 -plane with the points in 𝐶 (see Figure 15.8). Note that 𝐶 =
𝑥 ,𝑥 : 𝑥 ,𝑥 ,𝑥 ∈𝐶 =𝐶 .
32
16
Example
where, for simplicity, we assume that each 𝑎 > 0 and 𝑏 , 𝑏 ≥ 0. The set of
feasible points is depicted in Figure 15.9. Let 𝐶 ⊂ ℝ be the set of points
satisfying the above constraints.
33
Example
34
17
Example
35
Example
36
18
Example
1. Change objective function to: minimize 𝑥 − 𝑥 .
2. Substitute 𝑥 = −𝑥 .
3. Write 𝑥 ≤ 2 as 𝑥 ≤ 2 and −𝑥 ≤ 2.
4. Introduce slack variables 𝑥 and 𝑥 , and convert the above inequalities
to 𝑥 + 𝑥 = 2 and −𝑥 + 𝑥 = 2.
5. Write 𝑥 = 𝑢 − 𝑣, 𝑢, 𝑣 ≥ 0.
Hence, we obtain
minimize − 𝑥 − 𝑢 + 𝑣
subject to 3𝑥 + 𝑢 − 𝑣 = 5
𝑢−𝑣+𝑥 =2
𝑣−𝑢+𝑥 =2
𝑥 , 𝑢, 𝑣, 𝑥 , 𝑥 ≥ 0.
37
Basic solution
minimize 𝒄𝑻 𝒙
subject to 𝑨𝒙 = 𝒃
𝒙 ≥ 𝟎,
where 𝒄 ∈ ℝ , 𝑨 ∈ ℝ × , 𝒃 ∈ ℝ , 𝑚 < 𝑛, rank 𝑨 = 𝑚, and 𝒃 ≥ 𝟎. In the following
discussion, we only consider linear programming problems in standard form.
Consider the system of equalities
𝑨𝒙 = 𝒃,
where rank 𝑨 = 𝑚. In dealing with this system of equations, we frequently need
to consider a subset of columns of the matrix 𝑨. For convenience, we often
reorder the columns of 𝑨 so that the columns we are interested in appear first.
Specifically, let 𝑩 be a square matrix whose columns are 𝑚 linearly independent
columns of 𝑨. If necessary, we reorder the columns of 𝑨 so that the columns in 𝑩
appear first: 𝑨 has the form 𝑨 = [𝑩, 𝑫], where 𝑫 is an 𝑚 × (𝑛 − 𝑚) matrix whose
columns are the remaining columns of 𝑨. The matrix 𝑩 is nonsingular, and thus
we can solve the equation
38
19
Basic solution
𝑩𝒙 = 𝒃
for the 𝑚-vector 𝒙 . The solution is 𝒙 = 𝑩 𝑏. Let 𝒙 be the 𝑛-vector whose
first 𝑚 components are equal to 𝒙 , and the remaining components are equal
to zero, that is, 𝒙 = 𝒙 , 𝟎 . Then, 𝒙 is a solution to 𝑨𝒙 = 𝒃.
39
Basic solution
Definition 15.1
If some of the basic variables of a basic solution are zero, then the basic solution
is said to be a degenerate basic solution.
40
20
Example
1 1 −1 4 8
𝑨 = 𝒂𝟏 , 𝒂𝟐 , 𝒂𝟑 , 𝒂 𝟒 = ,𝑏 = ,
1 −2 −1 1 2
where 𝑎 denotes the 𝑖 th column of the matrix 𝑨.
41
Example
42
21
Example Using elementary row operations, we transform
the above matrix into the form (see the next
chapter) given by
[𝑨, 𝒃] =
2 3 −1 −1 −1
x (−2) 2 1 14
4 1 1 −2 9 1 0 −
5 2 5 .
2 3 −1 −1 −1 3 3 11
∼ 0 1 − 0 −
0 −5 3 0 4 5 5 5
The corresponding system of equations is given
by
1 2 1 14
4 28 x( ) 𝑥 + 𝑥 − 𝑥 =
∼ 2 0 −1 2 5 2 5
5 5 1
0 −5 3 0 11 x (− ) 3 11
5 𝑥 − 𝑥 =− .
5 5
Solving for the leading unknowns 𝑥 and 𝑥 , we
2 1 14 obtain
1 0 −
∼ 5 2 5 14 2 1
3 4 𝑥 = − 𝑥 + 𝑥
0 1 − 0 − 15 5 2
5 5 11 3
𝑥 =− + 𝑥 ,
5 5
where 𝑥 and 𝑥 are arbitrary real numbers.
43
Example
If 𝑥 , 𝑥 , 𝑥 , 𝑥 is a solution, then we have
14 2 1
𝑥 = − 𝑠+ 𝑡
5 5 2
11 3
𝑥 =− + 𝑠
5 5
𝑥 =𝑠
𝑥 =𝑡
where we have substituted 𝑠 and 𝑡 for 𝑥 and 𝑥 , respectively, to indicate that
they are arbitrary real numbers.
Using vector notation, we may write the above system of equations as
14 2
𝑥 − 1
5 5
𝑥 11 3 2
𝑥 = − +𝑠 +𝑡 0
5 5 0
𝑥 0 1
1
0 0
44
22
Example
Note that we have infinitely many solutions, parameterized by 𝑠, 𝑡 ∈ ℝ For the choice 𝑠 = 𝑡 =
0 we obtain a particular solution to 𝑨𝒙 = 𝒃, given by
14
5
11
𝒗= −
5
0
0
Any other solution has the form 𝒗 + 𝒉, where
2
− 1
5
3 2
𝒉=𝑠 +𝑡 0
5 0
1
1
0
The total number of possible basic solutions is at most
𝑛 𝑛! 4!
= = = 6.
𝑚 𝑚! (𝑛 − 𝑚)! 2! (4 − 2)!
To find basic solutions that are feasible, we check each of the basic solutions for feasibility.
45
Example
Our first candidate for a basic feasible solution is obtained by setting 𝑥 = 𝑥 = 0,
which corresponds to the basis 𝑩 = 𝒂 , 𝒂 . Solving 𝑩𝒙 = 𝒃, we obtain 𝒙 =
[14/5, −11/5] , and hence 𝒙 = [14/5, −11/5,0,0] is a basic solution that is not
feasible.
For our second candidate basic feasible solution, we set 𝑥 = 𝑥 = 0. We have the
basis 𝑩 = 𝒂𝟏 , 𝒂𝟑 . Solving 𝑩𝒙 = 𝒃 yields 𝒙 = [4/3,11/3] . Hence, 𝒙 = [4/3,0,11/
3,0] is a basic feasible solution.
A third candidate basic feasible solution is obtained by setting 𝑥 = 𝑥 = 0.
However, the matrix
2 −1
𝑩 = 𝒂 ,𝒂 =
4 −2
is singular. Therefore, 𝑩 cannot be a basis, and we do not have a basic solution
corresponding to 𝑩 = 𝒂𝟏 , 𝒂𝟒 .
46
23
Example
We get our fourth candidate for a basic feasible solution by setting 𝑥 = 𝑥 = 0.
We have a basis 𝑩 = 𝒂 , 𝒂 , resulting in 𝒙 = [0,2,7,0] , which is a basic
feasible solution.
Our fifth candidate for a basic feasible solution corresponds to setting 𝑥 =
𝑥 = 0 , with the basis 𝑩 = 𝒂 , 𝒂 . This results in 𝒙 = [0, −11/5,0, −28/5] ,
which is a basic solution that is not feasible.
Finally, the sixth candidate for a basic feasible solution is obtained by setting
𝑥 = 𝑥 = 0. This results in the basis 𝑩 = 𝒂𝟑 , 𝒂𝟒 , and 𝒙 = [0,0,11/3, −8/3] ,
which is a basic solution but is not feasible.
47
Fundamental theorem of LP
Definition 15.2
Any vector 𝒙 that yields the minimum value of the objective function 𝒄 𝒙 over
the set of vectors satisfying the constraints 𝑨𝒙 = 𝒃, 𝒙 ≥ 𝟎, is said to be an
optimal feasible solution.
An optimal feasible solution that is basic is said to be an optimal basic feasible
solution.
Theorem 15.1 Fundamental Theorem of LP. Consider a linear program
in standard form.
1. If there exists a feasible solution, then there exists a basic feasible solution;
2. If there exists an optimal feasible solution, then there exists an optimal
basic feasible solution.
48
24
Example
49
Example 2 3 −1
𝑎 = ,𝑎 = ,𝑎 =
4 1 1
where 𝑠, 𝑡 ∈ ℝ. Note that if 𝑠 = 4 and 𝑡 = 0 then 𝑦 𝑎 +𝑦 𝑎 +𝑦 𝑎 = 0
6
−2 3
5 𝑦 = ,𝑦 = ,𝑦 = 1
1 5 5
𝒙 = −2 2 3 3 −1 0
5 + +2 =
4 5 4 5 1 1 0
0
is a non-basic feasible solution. where
There are constants 𝑦 , 𝑖 = 1,2,3, such that 2
−
𝒚𝟏 𝒂 𝟏 + 𝒚 𝟐 𝒂 𝟐 + 𝒚 𝟑 𝒂 𝟑 = 𝟎 5
where 𝒚=
3
For example, let 5
2 1
𝑦 =− , 0
5 If 𝜀 = 1/3, then
3
𝑦 = 4
5
𝑦 = 1. 3
Note that 𝒙𝟏 = 𝒙𝟎 − 𝜀𝒚 = 0
11
𝑨 𝒙 − 𝜀𝒚 = 𝒃, 3
0
is a basic feasible solution.
50
25
Example
Observe that the fundamental theorem of LP reduces the task of solving a linear
programming problem to that of searching over a finite number of basic feasible
solutions. That is, we need only check basic feasible solutions for optimality. As
mentioned before, the total number of basic solutions is at most
𝑛 𝑛!
= .
𝑚 𝑚! (𝑛 − 𝑚)!
Although this number is finite, it may be quite large. For example, if 𝑚 = 5 and
𝑛 = 50, then
𝑛 50
= = 2,118,760.
𝑚 5
This is potentially the number of basic feasible solutions to be checked for
optimality. Therefore, a more efficient method of solving linear programs is
needed. To this end, in the next section, we analyze a geometric interpretation
of the fundamental theorem of LP. This leads us to the simplex method for
solving linear programs, which we discuss in the following chapter.
51
26