Lec1 Linear Program 3e1 14

35
Lectures on Linear Programming by Dr. Brendan Browne (1)Introduction (2)Graphical Solution (3) Geometric Simplex Method (4)Simplex Algorithm (5) Two-Stage Simplex Algorithm (6) Duality Theory 1

Transcript of Lec1 Linear Program 3e1 14

Page 1: Lec1 Linear Program 3e1 14

Lectures on Linear Programming

by Dr. Brendan Browne

(1)Introduction

(2)Graphical Solution

(3) Geometric Simplex Method

(4)Simplex Algorithm

(5) Two-Stage Simplex Algorithm

(6) Duality Theory

1

Page 2: Lec1 Linear Program 3e1 14

Lecture 1 Lecture on Linear Programming

by Dr. Brendan Browne

Linear Programming is concerned with solving just one mathematical problem, namely maximizing or minimizing a linear function of variables(called the objective function)subject to linear constraints, that is

subject to ……………………………………… … ……………………………………… …

and trivial constraints …..In matrix terms a linear programming model is subject to

where is an matrix

, and

Note: The coefficients , , ,…., are called cost coefficients.

2

Page 3: Lec1 Linear Program 3e1 14

Many management decisions involve trying to make the most effective use of an organization’s resources. Resources typically include machinery, labour, money, time,warehouse space and raw materials. These resources may be used to produce products(such as machinery, furniture, food or cloths etc) or services(such as schedules for airlines, shipping or production, advertising policies or investment decisions).Linear Programming is a widely used mathematical technique designed to help managers and engineers in planning and decision making relative to resource allocation.

The reason why linear programming is so important, is that so many different problems in many diverse fields are modelled mathematically by the mathematical problem of Linear Programming, namely subject to .Indeed the solution of Linear Programming problems in industry, government and academic institutions all over the world represents one of the greatest amount of computing time in scientific computing (as distinct from data processing).

The following are some of the main fields in which Linear Programming has been widely and successfully applied.(1)Oil refinery optimization.(2)Production allocation(3)Blending of mixtures(4)Distribution problems(5)Financial and economic planning

A Short History of Linear Programming

Although the problem of solving a system of linear inequalities goes back to at least Joseph Fourier(1768-1830) after whom the method of Fourier-Motzkin elimination is named, it was not until before the Second World war that linear programming was developed. Indeed Fourier and the Belgian mathematician Vallee Poussin in 1911 each wrote a research paper describing todays methods of linear programming The founders of the subject are Leonid Kantorovich( 1912-1986 )a Russian mathematician(who also won the Nobel Prize for economics in 1975) who developed linear programming problems, George B.Dantzig(1914-2005) who published the Simplex method in 1947 .Linear programming was extensively used in the Second World war to solve problems of finding the most economical and effective strategies for developing aircraft, submarines, troops and so on. Indeed George B.Dantzig(1914-2005) during the Second World war was employed as a U.S. Air Force mathematician in the Office of Statistical Control where he developed an interest in linear programming problems. Interest in the techniques of linear programming continued after the war, where they were applied to industrial and government planning and flourished with the development of powerful computers, which enabled large-scale linear programming problems to be solved with comparative ease.

3

Page 4: Lec1 Linear Program 3e1 14

An early application of linear programming was by Stigle in 1946 in solving the diet problem by a process of trial and error. Linear programming problems were first shown to be solvable in polynomial time in 1979 by Leonid Khachiyan. In 1984 a larger and practical breakthrough in the field occurred with the introduction of Narendra K.Karmarhar’s(1957-) new interior point method for solving linear programming problems.

General Mathematical Programming To put linear programming into context we should realize that it is part of a much bigger area, namely general mathematical programming. The figure below summarizes briefly the different areas of mathematical programming and their relationship.

4

Page 5: Lec1 Linear Program 3e1 14

Overview

Mathematical or Non-Linear Programming---non-linear objectivr function

subject to non-linear constraints

------------------------------ -------------------------------

Quadratic Programming Linear Programming

Non-linear objective function linear objective function

subject to linear constrains subject to linear constraints

------------------------------------------------- -------------------------------------------------

Geometric Programming Integer Programming(arises in Engineering Design same as Linear programming Find vector such that except variables

Min function must be integer.

Subject to

and ,

--------------

where and .

Note different areas of mathematical programming require different methods.

Some Simple Linear Programming Problems and their formulations

We will introduce linear programming, by considering a few simple linear programming problems and their formulations.

5

Page 6: Lec1 Linear Program 3e1 14

Example I Table Manufacturing problem

A small co-operative craft workshop makes two types of table : a standard rectangular table and a deluxe circular table. The market can absorb as many of either types of table as the workshop can product, so we can assume unlimited demand. Each type of table is made from the same wood and once the wood has been cut, each table has to go through 3 processes : joinery, pre-finishing and final finishing (in that order). Sufficient cut wood is always available. Each rectangular tables takes 2 hours for joinery, 40 minutes for pre-finishing and 5 hours 20 minutes for final finishing. Each circular table requires 3 hours for joinery, 2 hours for pre-finishing, and 4 hours for final finishing. The workshop employs five joiners, two sanders and eight polishers. The joiners each work a fixed six-hour day while the sanders and polishers each work a fixed eight-hour day on the pre-finishing and final finishing respectively. No overtime is worked and full six-hour or eight-hour days are worked by each employee irrespective of whether there is work for that employee to do. All running costs, including wages are fixed. The co-operative sells each rectangular table for €120 and each circular table for €150. How many of each type of table should the workshop produce each day in order to maximise its profit? Formulate this linear programming problem.

Solution

Let x1 = number of rectangular tables made per day x2 = number of circular tables made per day z = daily income in Euro.

Now we have to derive for the objective function and the constraints and tables such as table 1 below is very useful in this respect.

Table 1

Rectangular Tables Circular Tables Upper Limit per day

Income €120 €150Joinery(hours) 2 3 30Prefinishing(hours) 2/3 2 16Final finishing(hours)

5 1/3 4 64

It is clear that there is a linear relationship between the daily income and the numbers of tables sold given by

6

Page 7: Lec1 Linear Program 3e1 14

The numbers of hours spent daily on each of joinery, pre-finishing and final finishing are given using table above by simple linear expressions.

.

The upper limits on the number of hours available for each of these processes each day can be combined with these expressions to give the following constraints:

Finally, we must, as so often in mathematics state the obvious : the co-operative cannot make a negative number of tables. So we must also include the constraints and

.

Thus our complete linear programming model is:

Maximise

subject to

with and (It is vital that all final linear programming models havethese trivial constraints).

Note: All linear programming models are of similar form to above. They consist of:

(1) an objective function z which is linear that is to be maximised or minimised(2) subject to linear constraint.(3) all variables are always restricted to be non-negative.

7

Page 8: Lec1 Linear Program 3e1 14

Example 2 An oil company owns two refineries, say refinery A and refinery B. Refinery A is capable of producing 20 barrels of gasoline and 25 barrels of fuel oil per day. Refinery B is capable of producing 40 barrels of gasoline and 20 barrels of fuel oil per day. The company requires at least 1000 barrels of gasoline and at least 800 barrels of fuel oil. If it costs €300 per day to operate refinery A and €500 per day to operate refinery B, how many days should each refinery be operated by the company so as to minimize costs?

Formulate this problem as a linear programming model.

Solution Let the number of days operating refinery A. Let the number of days operating refinery B. Then total cost.We wish to minimize subject to the following constraints.Note that the company must incur some positive costs since it is constrained by minimum petroleum requirements. Refinery A is capable of producing 20 barrels of gasoline per day and Refinery B is capable of producing 40 barrels of gasoline per day.Hence the total amount of gasoline produced per day is . As at least 1000 barrels of gasoline is required we have the inequality

Similarly Refinery A is capable of producing 25 barrels of fuel oil per day and. Refinery B is capable of producing 20 barrels of fuel oil per day.Hence the total amount of fuel oil produced per day is . As at least 800 barrels of fuel oil is required we have the inequality

.

Hence our linear programming model is minimize subject to

. and and since negative days cannot be operated by the refineries.

8

Page 9: Lec1 Linear Program 3e1 14

Example 3(Production Plan Problem)

In a given factory there are three machines , and used in making two products and respectively. One unit of occupies for 5 minutes, for 3 minutes and for 4 minutes respectively. The corresponding figures for one unit of are for 1 minute , 4 minutes and for 3 minutes respectively. The net profit per unit of produced is € 30 and for per unit of produced is € 20(independent of whether the machines are used to full capacity or not). What production plan gives the most profit? Formulate this linear programming problem Hint: translate all times into hours. Solution Let number of units of produced per hour and let number of units of produced per hour.

Hence profit is given by There are restrictions on and obtained as follows:

1 unit of occupies hours, hours and for hours.

Hence units of occupies hours, hours and for hours.

Similarly units of occupies hours, hours and for hours.

Therefore for each machine we must have that

for machine

for machine

for machine

Simplifying ,our inequalities are for machine

for machine for machine

Thus our programming model for the production plan above is

9

Page 10: Lec1 Linear Program 3e1 14

Maximize subject to

and the trivial constraints and since we cannot produce negativenumber of either units.N.B. These trivial constraints must always be stated as linear programming modals always have non-negative variables and this insures that the feasible regions of linear programming models always lie in the first quadrant.

10

Page 11: Lec1 Linear Program 3e1 14

It is important that you should be able to formulate mathematically a linear programming problem or model from a description of the linear problem as we have done in the examples above.The following is a guide for doing such formulations:Formulating linear programming models

Given a precise statement of a linear programming problem, including a specified purpose and any appropriate data and assumptions, the problem may be formulated as a linear programming model as follows:(i) Identify the objective of the model (for example maximising profit or minimising

cost) and decide on the units the objective functions to be measured (for example units of currencies).

(ii) Identify the variables and decide on the units in which each is to be measured.

(iii) Identify the constraints and parameters for the problem.

(iv) Assign algebraic symbols to the objective function (usually z) and to the variables (usually ) and write down precise definitions including units of measurement, for all of these.

(v) Using a table of parameter values or otherwise, identify the linear relationships between the objective function and the variables and between the constraints and the variables, being careful to use consistent units when identifying these relationships.

(vi) Write down the objective of the problem in the form

optimise

(vii) Write down the non-trivial constraints where the ith non-trivial constraint is a linear relationship of one of the following forms:

(viii) Write down the non-negativity or trivial constraints

N.B. You must always write down the trivial constraints as they

are always an important part of all linear programming models.

Note: The constraints and the objective function need to be dimensionally consistent.

11

Page 12: Lec1 Linear Program 3e1 14

Exercise 1 A workshop in a Greek village makes small and large inlaid trays. Production involves three processes: cutting, firing and polishing. The following table gives the time in hours for each process for each type of tray and the total number of hours available in a day together with the sale price in euros for each tray.Process Small trays Large trays Hours availableCutting(hours) 1 1 6Firing(hours) 1 2 8Polishing(hours) 2 3 13Sale price(euros) 16 28The workshop wishes to maximize its sales receipts for its daily production, giventhat it can sell all the trays it makes.

(a)Formulate the workshop’s problem as a linear programming model.

(b) Use graphical methods to solve this model and interpret the solution

(c) The polisher is prepared to work up to two hours longer each day for extra money. Determine whether it is worthwhile for the workshop to employ the polisher for longer. If so, how does it change your solution in (b)? How much longer should this polisher work, and for what maximum pay?

Exercise 2 (A Nutritionist’s Linear Programming Model)

The next problem is an example of a special case of linear programming problems known as ingredient or blending problems.

A nutritionist is planning a menu in a hospital consisting of two foods and . Each ounce of contains 2 units of fat, 1 unit of carbohydrate and 4 units of protein. Each ounce of contains 3 units of fat, 3 units of carbohydrates and 3 units of protein. The nutritionist wants the meal to provide at least 18 units of fat, at least 12 units of carbohydrates and at least 24 units of protein. If an ounce of costs 20 cent and an ounce of costs 25 cent, how many ounces of each food should be served to minimize the cost of the meal and yet satisfy the nutritionist’s requirements?. Formulate the linear programming problem and solve graphically.

12

Page 13: Lec1 Linear Program 3e1 14

Some Important Definitions

Before we study the graphical solution of linear programming problems we need a few very important definitions.Definition: The general form of a linear programming model consists of:

(i) an objective to maximise or minimise some quantity z, known as the objective function, which is expressed as a linear combination of the variables

.(ii) non-trivial constraints on the variables which are inequalities or equation

involving linear combinations of the variables.(iii) Trivial or non-negative constraints on the variables to ensure that each one is

positive or zero.It can be expressed mathematically as follows:

optimise

subject to

.

where

The (called the cost coefficients), and are the parameters of the model.We should include the running costs (which are assumed to be constant though it is often convenient to omit them) in the objective function. However we are effectively changing the objective function from the actual profit (or cost) say say to

13

Page 14: Lec1 Linear Program 3e1 14

where c represents the total of the constant terms. It is important, therefore, when solving linear programming problems to remember to add the value of any constant terms omitted from the objective function to the maximum (or minimum) value of z in order to determine the correct value of the maximum profit (or minimum cost).Now it is very important that we are able to convert the general form of a linear programming problem into the standard form of a linear programming problem because if we have a linear programming problem in standard form we can obtain some very powerful theoretical results, namely the Duality Theorem.

Definition: A linear programming model is in standard form if it is expressed in the

form:

Maximise

subject to , .

Note: No restriction put on the sign of .

To convert a linear programming model to standard form we proceed as follows:

(1) Remove any constant term c from the objective function by replacing

by where .

(2) If the problem is a minimisation problem

Minimise ,

rewrite it asmaximise

where and .(3) Remove any free variables by setting where and and replacing by where it occurs in the objective function and the constraints.

(4) Remove any equality constraint such as

either by eliminating one of the variables say, by writing

where

14

Page 15: Lec1 Linear Program 3e1 14

and replacing whenever it occurs in the objective function and the constraints, by this combination of the other ( ) variables

orby replacing it by the following two inequalities

(5) Change each constraint, such as

to a constraint by changing all the signs, to give

(6) If necessary and if desired, rename the variables.

Example 1 Convert the table manufacturing problem, namelyMaximise subject to

where and to matrix standard form.

Solution This is already in standard form and we just have to put it into matrix form as follows:Maximise subject to

where , , and .

Example 2 Convert the our oil refinery linear programming model above,

namely Minimize subject to

15

Page 16: Lec1 Linear Program 3e1 14

. and and into matrix standard form.

Solution First we must turn the minimisation model to a maximisation model by simply changing sign

Maximise .Next we change the inequalities into inequalities by multiplying them across by to get .Putting above into matrix form we get the matrix standard form of the oil refinery model namely,Maximise subject to where

, and .

Note Unlike canonical form as we will see later, the standard form does not insist that .Indeed as in this case . However we must have always in the standard

form.

16

Page 17: Lec1 Linear Program 3e1 14

Example 3 Convert the our production plan linear programming model above namely , Maximize subject to

and and into matrix standard form.SolutionThis is already in standard form so all we have to do is to put it into matrix form, namely subject to

, where

, , and

Note: In problems where we are maximizing income the parameters often represent the contribution made to income by selling price of some product so is sometimes called the price vector. In minimization problems the parameters often represent costs, so is instead known as the cost vector. Indeed, as any maximization problem

can be regarded as a minimization problem by rewriting it in the form we often regard the components of a price vector as negative

costs and use the term cost vector for both maximization and minimization problems

Example 4 Express the following linear programming model in standard formMinimise

17

Page 18: Lec1 Linear Program 3e1 14

subject to . where and .Solution: A number of points to notice

(i) There is a constant term in the objective function(ii) is a free variable since is not given as .(iii) we have an equality constraint equation.

We ignore the 6 in the objective function and turn minimisation into maximisation problem

Maximise No constraint on the so it is free variable. We could let where and or we could just put where and so objective function becomes and first and third constraints become .

To treat the equality constraint. Since we have no information about the problem that led to the model, we can have no good reason for choosing to replace it by two inequality constraints. We shall therefore substitute for , or . We choose for then we only have to substitute into one non-trivial and one trivial constraint, compared with one non-trivial constraint, one trivial constraint and the objective function if we choose . We have from the equality constraint

.Substituting for in the (new) third non-trivial constraint gives and the non-negativity constraint for becomes that is .We must change the signs in the last (new) non-trivial constraint to give and in to give .

Having replaced by and eliminated we now have four variables and . It can often help to reduce confusion, in such circumstances to renumber the variable from 1 to 4 for example by relabelling as

18

Page 19: Lec1 Linear Program 3e1 14

So renumbering we recast above problem as Maximize subject to

where , and .Note: Here is negative.

19

Page 20: Lec1 Linear Program 3e1 14

Canonical Form. The standard form is important since it allows us to access some powerful theoretical results namely, the duality theorem. However another very important form of the linear programming problem is the canonical form which leads to the general method of solution of linear programming problems namely the simpler method or algorithm. In the canonical form the inequalities are transformed to equalities by the introduction of additional variables.Definition A linear programming model is in canonical form if it is expressed in the form

Maximise subject to , , .

N.B All the signs must be chosen so that .Of course must be .To express a linear programming model in canonical form(i) Remove any constant term c from the objective function by replacing

by where .(ii) If the model is a minimisation model, i.e. minimise

Minimize Rewrite as maximize

maximisewhere and

(iii) Remove any free variables by setting where and

and replacing by wherever it occurs in the objective function and the constraints.

(iv) For any , change all the signs in the corresponding constraint and reverse the direction of any inequality sign.

(v) (i) Convert any constraint of the form

to an equality by adding a slack variable to give where .

(iii) Convert any constraint of the form

to an equality by subtracting a surplus variable to give where

(iv) Extend to include zero elements for the slack and surplus variables . If necessary and if desired renumber the variables.

Example 1 Convert the table manufacturing linear programming problem namelyMaximise

20

Page 21: Lec1 Linear Program 3e1 14

subject to

where and to canonical form.Solution We must first convert the inequalities to equalities by the introduction of slack variable , and to give

Now , and and are all of the correct form and need no changing but we must incorporate the slack variables into the objective function thus

so that

Thus our linear programming model in matrix canonical form isMaximise subject to , , .

where

, , and

Example 2 Convert the oil refinery, linear programming model,

21

Page 22: Lec1 Linear Program 3e1 14

namely minimize subject to . and and into matrix canonical form.Solution First we must turn the minimisation model to a maximisation model by simply changing sign

Maximise .Next we turn the inequalities into equalities by subtracting surplus variables and to give with , , and .Also we have to add these surplus to the objective function .The are of the correct form namely, and .Hence our oil refinery linear programming model in matrix canonical form is

Maximise subject to , , .where

, , and .

22

Page 23: Lec1 Linear Program 3e1 14

Example 3 Convert the our production plan linear programming model above namely , Maximize subject to

and and into matrix canonical form.SolutionFirst we turn the inequalities into equalities by adding slacks variables , and

to give

with , , , .and .Next the objective function has to be changed to accommodate the slack variables. Thus .The are of the correct form namely, , and .

Thus the production plan linear programming model in matrix canonical form isMaximise subject to , , .where

, , and

23

Page 24: Lec1 Linear Program 3e1 14

Exercise 3 Convert the Greek workshop linear programming problem , namely Maximize subject to and and into (1) standard form and (2) canonical form.

Exercise 4 Convert the nutritionist’s linear programming namely, Minimize subject to and , into (1) standard form and (2) canonical form.

24

Page 25: Lec1 Linear Program 3e1 14

25