Introduction to Linear Programming Linear Programming is the study of - - PowerPoint PPT Presentation

introduction to linear programming linear programming is
SMART_READER_LITE
LIVE PREVIEW

Introduction to Linear Programming Linear Programming is the study of - - PowerPoint PPT Presentation

Introduction to Linear Programming Linear Programming is the study of optimization problems in which the objective function and all constraints are linear. Linear Programming is the study of optimization problems in which the objective function


slide-1
SLIDE 1

Introduction to Linear Programming

slide-2
SLIDE 2

Linear Programming is the study of optimization problems in which the objective function and all constraints are linear.

slide-3
SLIDE 3

Linear Programming is the study of optimization problems in which the objective function and all constraints are linear. A linear function in n variables is one of the form f(x1, x2, . . . , xn) = c1x1 + c2x2 + · · · + cnxn for some constants c1, c2, . . . , cn.

slide-4
SLIDE 4

Linear Programming is the study of optimization problems in which the objective function and all constraints are linear. A linear function in n variables is one of the form f(x1, x2, . . . , xn) = c1x1 + c2x2 + · · · + cnxn for some constants c1, c2, . . . , cn. A linear inequality in n variables if one of the form f(x1, x2, . . . , xn) ≤ b or f(x1, x2, . . . , xn) ≥ b where f is a linear function and b is a constant.

slide-5
SLIDE 5

Linear Programming is the study of optimization problems in which the objective function and all constraints are linear. A linear function in n variables is one of the form f(x1, x2, . . . , xn) = c1x1 + c2x2 + · · · + cnxn for some constants c1, c2, . . . , cn. A linear inequality in n variables if one of the form f(x1, x2, . . . , xn) ≤ b or f(x1, x2, . . . , xn) ≥ b where f is a linear function and b is a constant. Linear Programming is concerned with optimizing a linear function subject to a set of constraints given by linear inequalities.

slide-6
SLIDE 6

A linear program (an LP) is a linear optimization problem taking the following form: Maximize (or minimize) f(x1, x2, . . . , xn) = c1x1 + c2x2 + · · · + cnxn subject to a1,1x1 + a1,2x2 + · · · a1,nxn ≤ ≥ b1 a2,1x1 + a2,2x2 + · · · a2,nxn ≤ ≥ b2 : : am,1x1 + am,2x2 + · · · am,nxn ≤ ≥ bm x1, x2, . . . xn ≥ 0 The inequalities, except for the last one, can be greater than or equal or less than or equal.

slide-7
SLIDE 7

This general form is often expressed with vectors and matrices:

slide-8
SLIDE 8

This general form is often expressed with vectors and matrices: Maximize (or minimize) cT x subject to A x≤ ≥

  • b

and x ≥ 0

slide-9
SLIDE 9

This general form is often expressed with vectors and matrices: Maximize (or minimize) cT x subject to A x≤ ≥

  • b

and x ≥ 0 This looks very concise but it obscures a lot of things we will want to talk about, so I will not use this form at all. You will run across it in some papers and books on the subject.

slide-10
SLIDE 10

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico).

slide-11
SLIDE 11

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic.

slide-12
SLIDE 12

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic. One unit of guacamole requires 1/2 tomato and 4 cloves

  • f garlic.
slide-13
SLIDE 13

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic. One unit of guacamole requires 1/2 tomato and 4 cloves

  • f garlic.

We only have 30 tomatoes and 20 cloves of garlic.

slide-14
SLIDE 14

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic. One unit of guacamole requires 1/2 tomato and 4 cloves

  • f garlic.

We only have 30 tomatoes and 20 cloves of garlic. We have an unlimited supply of all other ingredients (salt, cilantro, lime juice, etc.)

slide-15
SLIDE 15

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic. One unit of guacamole requires 1/2 tomato and 4 cloves

  • f garlic.

We only have 30 tomatoes and 20 cloves of garlic. We have an unlimited supply of all other ingredients (salt, cilantro, lime juice, etc.) How many units of salsa and guacamole should we make to maximize the total number of units (salsa+guacamole) we make?

slide-16
SLIDE 16

LP example

Suppose we are making salsa and guacamole (dips or sauces originally from Mexico). One unit of salsa requires 5 tomatoes and 1 clove of garlic. One unit of guacamole requires 1/2 tomato and 4 cloves

  • f garlic.

We only have 30 tomatoes and 20 cloves of garlic. We have an unlimited supply of all other ingredients (salt, cilantro, lime juice, etc.) How many units of salsa and guacamole should we make to maximize the total number of units (salsa+guacamole) we make? Fractional units are okay.

slide-17
SLIDE 17

Let x1 be the number of units of salsa we make. Let x2 be the number of units of guacamole we make.

slide-18
SLIDE 18

Let x1 be the number of units of salsa we make. Let x2 be the number of units of guacamole we make. Then the quantity we want to maximize is x1 + x2. This is our objective function.

slide-19
SLIDE 19

Let x1 be the number of units of salsa we make. Let x2 be the number of units of guacamole we make. Then the quantity we want to maximize is x1 + x2. This is our objective function. We see that we cannot simply make x1 and x2 huge due to

  • ur limited amount of garlic and tomatoes.
slide-20
SLIDE 20

If we make x1 units of salsa and x2 units of guacamole, then the amount of tomatoes we’ll need is 5x1 + 1 2x2.

slide-21
SLIDE 21

If we make x1 units of salsa and x2 units of guacamole, then the amount of tomatoes we’ll need is 5x1 + 1 2x2. Since we only have 30 tomatoes, we have the following constraint 5x1 + 1 2x2 ≤ 30.

slide-22
SLIDE 22

If we make x1 units of salsa and x2 units of guacamole, then the amount of tomatoes we’ll need is 5x1 + 1 2x2. Since we only have 30 tomatoes, we have the following constraint 5x1 + 1 2x2 ≤ 30. Similarly, since we have a limited amount of garlic, we have another constraint: x1 + 4x2 ≤ 20.

slide-23
SLIDE 23

If we make x1 units of salsa and x2 units of guacamole, then the amount of tomatoes we’ll need is 5x1 + 1 2x2. Since we only have 30 tomatoes, we have the following constraint 5x1 + 1 2x2 ≤ 30. Similarly, since we have a limited amount of garlic, we have another constraint: x1 + 4x2 ≤ 20. We also require x1, x2 ≥ 0 since we cannot make a negative amount of salsa or guacamole.

slide-24
SLIDE 24

Thus, the LP we wish to solve is: Maximize x1 + x2 subject to: 5x1 + 1 2x2 ≤ 30 x1 + 4x2 ≤ 20 x1, x2 ≥ 0 Since the non-negative constraints are always with us, we will often refer to such an LP as having two variables and two constraints.

slide-25
SLIDE 25

In this course, we will not be concerned with the methods used or solving LPs.

slide-26
SLIDE 26

In this course, we will not be concerned with the methods used or solving LPs. Instead, we will focus on lots of different applications of the LP idea, and we will use software to solve the LPs for us. In Math 407, you will learn methods for solving LPs.

slide-27
SLIDE 27

Just once, though, let’s look at how we might solve our salsa and guacamole LP “by hand”.

slide-28
SLIDE 28

Just once, though, let’s look at how we might solve our salsa and guacamole LP “by hand”. A classic approach (for two-variable LPs) is to consider the LP graphically.

slide-29
SLIDE 29

Just once, though, let’s look at how we might solve our salsa and guacamole LP “by hand”. A classic approach (for two-variable LPs) is to consider the LP graphically. We begin by making a sketch of our inequalities.

slide-30
SLIDE 30
slide-31
SLIDE 31

The feasible region is the set of points (x1, x2) that satisfy both constraints. This is the doubly-shaded portion in the picture.

slide-32
SLIDE 32

The feasible region is the set of points (x1, x2) that satisfy both constraints. This is the doubly-shaded portion in the picture. The points in the feasible region represent combinations

  • f amounts of salsa and quacamole that we can make.
slide-33
SLIDE 33

The feasible region is the set of points (x1, x2) that satisfy both constraints. This is the doubly-shaded portion in the picture. The points in the feasible region represent combinations

  • f amounts of salsa and quacamole that we can make.

Other points are not feasible.

slide-34
SLIDE 34

We note that our objective function x1 + x2 is an increasing function of x1 and x2.

slide-35
SLIDE 35

We note that our objective function x1 + x2 is an increasing function of x1 and x2. This means that, if (x1, x2) is a point in the feasible region, it will not yield the maximum value of x1 + x2 unless the point is “pushed up” against one of the constraint lines.

slide-36
SLIDE 36

We note that our objective function x1 + x2 is an increasing function of x1 and x2. This means that, if (x1, x2) is a point in the feasible region, it will not yield the maximum value of x1 + x2 unless the point is “pushed up” against one of the constraint lines. That is, if (x1, x2) is in the feasible region, and not on one

  • f the constraint lines, then we can increase the value of

x1 + x2 by increasing x1 or x2. Hence, that point does not yield the maximum.

slide-37
SLIDE 37

We note that our objective function x1 + x2 is an increasing function of x1 and x2. This means that, if (x1, x2) is a point in the feasible region, it will not yield the maximum value of x1 + x2 unless the point is “pushed up” against one of the constraint lines. That is, if (x1, x2) is in the feasible region, and not on one

  • f the constraint lines, then we can increase the value of

x1 + x2 by increasing x1 or x2. Hence, that point does not yield the maximum. So, the maximum must occur on one of the line segments bounding the feasible region.

slide-38
SLIDE 38

Where does the maximum occur?

slide-39
SLIDE 39

Where does the maximum occur? Let’s consider the function f(x1, x2) = x1 + x2.

slide-40
SLIDE 40

Where does the maximum occur? Let’s consider the function f(x1, x2) = x1 + x2. If we draw level curves of this function, i.e., curves given by f(x1, x2) = k for various values of k, we see that these are all lines with slope −1.

slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43

Now, if we increase k, the line f(x1, x2) = k moves away from the origin into the first quadrant.

slide-44
SLIDE 44

Now, if we increase k, the line f(x1, x2) = k moves away from the origin into the first quadrant. For a while, the line intersects the feasible region: there are combinations of salsa and guacamole that we can make to achieve a total output of k units.

slide-45
SLIDE 45

Now, if we increase k, the line f(x1, x2) = k moves away from the origin into the first quadrant. For a while, the line intersects the feasible region: there are combinations of salsa and guacamole that we can make to achieve a total output of k units. But eventually, the line f(x1, x2) = k will intersect the feasible region for the last time, and then for any larger k will not intersect the feasible region at all.

slide-46
SLIDE 46

Now, if we increase k, the line f(x1, x2) = k moves away from the origin into the first quadrant. For a while, the line intersects the feasible region: there are combinations of salsa and guacamole that we can make to achieve a total output of k units. But eventually, the line f(x1, x2) = k will intersect the feasible region for the last time, and then for any larger k will not intersect the feasible region at all. We want to figure out what this largest value of k is. This is the maximum we are looking for.

slide-47
SLIDE 47
slide-48
SLIDE 48

We can note that the two constraint lines have slope −10 and −0.25.

slide-49
SLIDE 49

We can note that the two constraint lines have slope −10 and −0.25. Since the level curves have slope −1, and −10 < −1 < −0.25, we can conclude that the level curves will last hit the feasible region at P, the intersection of the two constraint lines.

slide-50
SLIDE 50

We can note that the two constraint lines have slope −10 and −0.25. Since the level curves have slope −1, and −10 < −1 < −0.25, we can conclude that the level curves will last hit the feasible region at P, the intersection of the two constraint lines. Calculating the intersection of the two constraint lines, we find P = 220

39 , 140 39

  • ≈ 5.64, 3.59.
slide-51
SLIDE 51

We can note that the two constraint lines have slope −10 and −0.25. Since the level curves have slope −1, and −10 < −1 < −0.25, we can conclude that the level curves will last hit the feasible region at P, the intersection of the two constraint lines. Calculating the intersection of the two constraint lines, we find P = 220

39 , 140 39

  • ≈ 5.64, 3.59.

Thus, to maximize our production of salsa and guacamole, we should make 5.64 units of salsa and 3.59 units of guacamole, for a total of 9.23 units of stuff.

slide-52
SLIDE 52

We see that it is the slope of the level curves of our

  • bjective function f(x1, x2) the determine the nature of the

solution.

slide-53
SLIDE 53

We see that it is the slope of the level curves of our

  • bjective function f(x1, x2) the determine the nature of the

solution. Suppose we change the situation slightly.

slide-54
SLIDE 54

We see that it is the slope of the level curves of our

  • bjective function f(x1, x2) the determine the nature of the

solution. Suppose we change the situation slightly. Suppose now we want to sell our salsa and guacamole, say at $p per unit of salsa and $q per unit of guacamole. What should we produce to maximize the money we make from our sales (we’ll assume we will sell all we make)?

slide-55
SLIDE 55

We see that it is the slope of the level curves of our

  • bjective function f(x1, x2) the determine the nature of the

solution. Suppose we change the situation slightly. Suppose now we want to sell our salsa and guacamole, say at $p per unit of salsa and $q per unit of guacamole. What should we produce to maximize the money we make from our sales (we’ll assume we will sell all we make)? Now, the objective function is f(x1, x2) = px1 + qx2 and level curves have slope − p

q.

slide-56
SLIDE 56

We see that it is the slope of the level curves of our

  • bjective function f(x1, x2) the determine the nature of the

solution. Suppose we change the situation slightly. Suppose now we want to sell our salsa and guacamole, say at $p per unit of salsa and $q per unit of guacamole. What should we produce to maximize the money we make from our sales (we’ll assume we will sell all we make)? Now, the objective function is f(x1, x2) = px1 + qx2 and level curves have slope − p

q.

So, depending on the relationship between the value of − p

q and the slopes of the constraint lines, our solution

might be the same as earlier, or it might be to create all salsa, or all guacamole.

slide-57
SLIDE 57

We see then that it is a combination of the objective function and the constraints that determine the solution to an LP.

slide-58
SLIDE 58

We see then that it is a combination of the objective function and the constraints that determine the solution to an LP. Next time: more complex LPs that we will not try to solve by hand.