25
Maximize

linear prob ni stan for us

Embed Size (px)

Citation preview

Page 1: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 1/25

Page 2: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 2/25

Linear programming (LP) is a mathematical method for determining a way to achieve the best outcome (such asmaximum profit or lowest cost) in a given mathematical model for some list of requirements represented as linear equations.

More formally, linear programming is a technique for theoptimization of a linear objective function, subject to linear equalityand linear inequality constraints. Given a polyhedron and a real-valued affine function defined on this polyhedron, a linear programming method will find a point on the polyhedron where

this function has the smallest (or largest) value if such pointexists, by searching through the polyhedron vertices.

Introduction

Source : Wikipedia

Page 3: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 3/25

Linear programming can be applied to various fields of study. It isused most extensively in business and economics, but can alsobe utilized for some engineering problems. Industries that uselinear programming models include transportation, energy,

telecommunications, and manufacturing. It has proved useful inmodeling diverse types of problems in planning, routing,scheduling, assignment, and design.

Application

Source : Wikipedia

Page 4: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 4/25

A publisher has orders for 600 copies of a certain text from SanFrancisco and 400 copies from Sacramento. The company has700 copies in a warehouse in Novato and 800 copies in awarehouse in Lodi. It costs $5 to ship a text from Novato to San

Francisco, but it costs $10 to ship it to Sacramento. It costs $15 toship a text from Lodi to San Francisco, but it costs $4 to ship itfrom Lodi to Sacramento. How many copies should the companyship from each warehouse to San Francisco and Sacramento tofill the order at the least cost?

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 5: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 5/25

Steps

0. Read the whole problem.1. Define your unknowns.

2. Express the objective function3. Express the constraints.4. Graph the constraints.5. Find the corner points to the region of feasible solutions.6. Evaluate the objective function at all the feasible corner points.

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 6: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 6/25

Step 1. Define the unknowns

After reading the whole problem we see that they want to knowhow many books to ship from each warehouse to each bookstore.

There are four unknownsLetx = the number of books from Novato to San Franciscoy = the number of books from Novato to Sacramentoz = the number of books from Lodi to San Francisco

w = the number of books from Lodi to Sacramento.

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 7: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 7/25

Step 2. Express the objective function

The objective is to minimize the costcost = 5x + 10y + 15z + 4w

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 8: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 8/25

Step 3. Express the constraintsThe first two constraints have to do with the orders.San Franciscox + z = 600Sacramentoy + w = 400

These are equations. San Francisco has an order for 600 books.They have to get exactly 600 books. More or less will not do. If they get less than 600 books, students will be going without texts,but if they get more than 600 texts, they will say, "We only orderd600 texts. We're not paying for any more." Similarly, Sacramento

needs exactly 400 texts. As a result, we can solve theseequations to express z and w in terms of x and y.z = 600 - xw = 400 - y

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 9: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 9/25

The next two constraints have to do with the suppliesThere are only 700 books in Novato.x + y < 700There are only 800 books in Lodi.z + w < 800If we substitute for z and w, we can express this constraint interms of x and y.600 - x + 400 - y < 8001000 - x - y < 800200 < x + y

The total order is for 1000 books. There are only 800 books in

Lodi.At least 200 books will have to come from Novato.Then there are the implied constraints.x > 0y > 0z > 0w > 0

Maximization Problem

So  

rce :¡  

obert S. ¢    ilson P £   . ¤   . £   tt¥   ://¦ ¦ ¦   

.sonoma.e §  

  

/  

sers/ ¦    / ¦    ilsonst/§   efa  

lt.£   tml

Page 10: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 10/25

When we substitute into the last two, we get600 - x > 0400 - y > 0or 600 > x

400 > yLet us summarize our constraints expressed using only x and y.x + y < 700x + y > 200x < 600

y < 400x > 0y > 0

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 11: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 11/25

Step 4. Graph the constraints

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 12: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 12/25

Step 5. Find the feasible corner pointsThe feasible corner points are

(0, 400)(0, 200)

(200, 0)(600, 0)(600, 100)((300, 400)

We now evaluate the objective function at all of the feasible

corner points. The coordinates tell us how many books are beingshipped from Novato to San Francisco and Sacramento. Once weknow that we can figure how many books are going to be shippedfrom Lodi. We will ship enough books from Lodi to fill the orders.

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 13: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 13/25

At (0, 400) we would be shipping 400 books from Novato to

Sacramento. That would fill the Sacramento order, so we wouldnot need to ship any books from Lodi to Sacramento, but SanFrancisco still needs its 500 copies. Those would all come fromLodi. This would probably be the worst solution. All of the bookswould be shipped to the most expensive places.

At (0, 200), 200 copies would go from Novato to Sacramento, andnone from Novato to San Francisco. All 600 copies to SanFrancisco would come from Lodi. Sacramento would still need200 copies which would also come from Lodi. This is a feasiblesolution, because there would be 800 copies coming from Lodi,and there are 800 copies in Lodi. This would be a better solution

than the first one because not all copies are going to the mostexpensive places. The constraint upon which we find these twosolutions is the one where there are no copies going from Novatoto San Francisco.

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Page 14: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 14/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

At (200, 0), There would be 200 copies going from Novato to San Franciscoand none from Novato to Sacramento. San Francisco would still need 400copies from Lodi, and all 400 copies to Sacramento would be coming fromLodi. Again this would involve using all 800 copies from the Lodiwarehouse. The constraint upon which we find these last two solution are

the constaint that comes from the fact that Lodi has only 800 copies. Theother 200 copies in the total order will come from Novato.At (600, 0), There would be 600 copies coming from Novato to SanFrancisco. This would fill the San Francisco order. If there are no copiesgoing from Novato to Sacramento, then the entire Sacramento order of 400copies must come from Lodi. The constraint upon which we find these last

two solutions is the one where there are no copies going from Novato toSacramento. This is good, because it costs more money to send booksfrom Novato to Sacramento than it does to send them from Novato to SanFrancisco.

Page 15: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 15/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

At (200, 0), There would be 200 copies going from Novato to San Franciscoand none from Novato to Sacramento. San Francisco would still need 400copies from Lodi, and all 400 copies to Sacramento would be coming fromLodi.Again this would involve using all 800 copies from the Lodiwarehouse. The constraint upon which we find these last two solution are

the constaint that comes from the fact that Lodi has only 800 copies. Theother 200 copies in the total order will come from Novato.At (600, 0), There would be 600 copies coming from Novato to SanFrancisco. This would fill the San Francisco order. If there are no copiesgoing from Novato to Sacramento, then the entire Sacramento order of 400copies must come from Lodi. The constraint upon which we find these last

two solutions is the one where there are no copies going from Novato toSacramento. This is good, because it costs more money to send booksfrom Novato to Sacramento than it does to send them from Novato to SanFrancisco.

Page 16: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 16/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

At (600, 100), after filling the San Francisco order with books from Novato,the other 100 copies in the Novato warehouse go to Sacramento. SanFrancisco would not get any copies from Lodi. Lodi would fill the remainder of the Sacramento order and send them 300 copies. Tshe constraint uponwhich these last two solutions find themselves comes from filling the San

Francisco order with books from Novato.Finally, at (300, 400), the entire Sacramento order is filled from Novato, andthe remaining 300 copies in the Novato warehouse would go toSacramento.At this point, Lodi would need to send 100 copies toSacramento to fill their order, but would not have to send anything to SanFrancisco. The constraint upon which we find these last two solutions is the

constraint that comes from the fact that there are 700 copies in the Novatowarehouse.

Page 17: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 17/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

Step 6. Evaluate the objective function at all of the feasible corner points

Now that we know the number of copies from each warehouse to each retailer,we can plug these numbers into the objective function. There is another waythat we have gone over in class. We can express the objective function

5x + 10y + 15z + 4w

using only x and y by substituting z = 600 - x and w = 400 ± y

5x + 10y + 15(600 - x) + 4(400 - y)

= 5x + 10y + 9000 - 15x + 1600 - 4y= 10600 - 10x + 6y

Page 18: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 18/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

The $10600 would be the cost of shipping all 600 copies from Lodi to SanFrancisco and all 400 copies from Lodi to Sacramento. Of course this is not afeasible solution. there are only 800 copies on Lodi. We will have to ship somebooks from Novato. This objective function expresses the fact that we save

money by shipping books from Novato to San Francisco, but it will cost moremoney to ship them from Novato to Sacramento. As a result we will see that thesolution which involves shipping the most books from Novato to San Franciscoand the fewest books from Novato to Sacramento will be best.(0, 400)

= 10600 - 10(0) + 6(400) =10600 - 0 + 2400 = $13,000

Page 19: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 19/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(0, 200)

= 10600 - 10(0) + 6(200) = 10600 - 0 + 1200 = $11800

Page 20: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 20/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(200, 0)

= 10600 - 10(200) + 0 = 10600 - 2000 + 0 = $8600

Page 21: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 21/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(600, 0)

= 10600 - 10(600) + 6(0) = 10600 - 6000 + 0 = $4600

Page 22: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 22/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(600, 100)

=10600 - 10(600) + 6(100) = 10600 - 6000 + 600 = $5200

Page 23: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 23/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(300, 400)

= 10600 - 10(300) + 6(400) = 10600 - 3000 + 2400 = $10,000

Page 24: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 24/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

(300, 400)

= 10600 - 10(300) + 6(400) = 10600 - 3000 + 2400 = $10,000

Page 25: linear prob ni stan for us

8/7/2019 linear prob ni stan for us

http://slidepdf.com/reader/full/linear-prob-ni-stan-for-us 25/25

Maximization Problem

Source : Robert S. Wilson Ph.D. http://www.sonoma.edu/users/w/wilsonst/default.html

The least cost of $4,600 is found at (600, 0). This makes sense if you thinkabout it. You are filling the entire San Francisco order with copies from Novato,which is cheaper, and filling the entire Sacramento order with copies from Lodi,which is also cheaper. One could arrive at this solution by common sense, but it

is good if our techniques validate common sense.