STEM

Operations Research/Linear Programming

21/09/2020

This article is copied from wikibooks for educational purposes, see the original article

Linear Programming (LP) is a mathematical modelling technique useful for allocation of limited resources such as material, machines etc to several competing activities such as projects, services etc. A typical linear programming problem consists of a linear objective function which is to be maximized or minimized subject to a finite number of linear constraints. (By a linear function we mean a function of the form a1x1+a2x2+⋯anxna_{\mathclap{1}}x_{\mathclap{1}} + a_{\mathclap{2}}x_{\mathclap{2}} + \cdots a_{\mathclap{n}}x_{\mathclap{n}} where x1,x2,⋯xnx_{\mathclap{1}}, x_{\mathclap{2}}, \cdots x_{\mathclap{n}} are all variables.)

The founders of LP are George B. Dantzig, who published the simplex method in 1947, John von Neumann, who developed the theory of the duality in the same year, and Leonid Kantorovich, a Russian mathematician who used similar techniques in economics before Dantzig and won the Nobel prize in 1975 in economics. The linear programming problem was first shown to be solvable in polynomial time by Leonid Khachiyan in 1979, but a larger major theoretical and practical breakthrough in the field came in 1984 when Narendra Karmarkar introduced a new interior point method for solving linear programming problems.

The Two Variable LP model

Two variable LP models don't usually exist in practice but their study can provide us with an example as to how a general model can be handled.

We will explain the model by an example.

Consider a chemical company which produces two salts: XX and YY. Suppose an acid and a base are the only two chemicals required by the company to produce these two salts. Further suppose that by past experience the owner of the company has obtained the following data:

To make 11 unit of the salt XX, 66 units of the acid and 11 unit of the base is required. To make 11 unit of the salt YY, 44 units of the acid and 22 units of the base are required. At most 2424 units of the acid and 66 units of the base are available daily. 11 unit of the salt XX gets him a profit of 55 (in whatever currency) and 11 unit of the salt Y gets him a profit of 44. In addition due to a market survey he knows that the daily demand for the salt YY cannot exceed that for XX by more than 11 unit, and that the maximum daily demand for the salt YY is 22 units.

The company owner wants the best product mix. That is to say, he wants to know the amount of XX and YY he should make daily so that he gets the highest profit.

To formulate the LP model for this problem we first need to identify the decision variables. These are the variables which will represent the entities about which we have to actually make a decision about. In our problem it is clear that the entities are the salts XX and YY and so the variables should represent the amount they should be each made. So let,

x1x_{\mathclap{1}} = Units produced daily of salt XX

x2x_{\mathclap{2}} = Units produced daily of salt YY

The next step is to decide what should be the objective function for our model. It is clear from the name itself that the objective function represents our objective i.e. maximizing our total profit. Since the total profit is usually the sum of the profits obtained from XX and YY it should be equal to 5x1+4x25x_{\mathclap{1}} + 4x_{\mathclap{2}}. This is assuming that if 11 unit of XX (or YY) gives a profit of 55 (or 44) then x1x_{\mathclap{1}} (or x2x_{\mathclap{2}}) units would give a profit of 5x15x_{\mathclap{1}} (or 4x24x_{\mathclap{2}}). Hence if zz represents the total daily profit the objective is:

Maximize zz = 5x1+4x25x_{\mathclap{1}} + 4x_{\mathclap{2}}

Now we consider the constraints that restrict the usage of the acids and the salts. We know that the total amount of acid which we use in the day can't exceed 2424. Since 6x16x_{\mathclap{1}} and 4x24x_{\mathclap{2}} are reasonably the amounts of the acid used in making the salt XX and YY we may conclude that our constraint is:

6x1+4x2≤246x_{\mathclap{1}} + 4x_{\mathclap{2}} \leq 24

Similarly, for the base: x1+2x2≤6x_{\mathclap{1}} + 2x_{\mathclap{2}} \leq 6 x2−x1x_{\mathclap{2}} - x_{\mathclap{1}} Now the market dictates that the excess of the daily production of Y over X which is x2−x1x_{\mathclap{2}} - x_{\mathclap{1}} can't exceed 11 which means that:

x2−x1≤1x_{\mathclap{2}} - x_{\mathclap{1}} \leq 1

Also the maximum daily demand for the salt YY is 22 units so that:

x2≤2x_{\mathclap{2}} \leq 2

An implicit assumption is that the variables x{\mathclap{1}} and x{\mathclap{2}} can't assume negative values (Why?). The nonnegativity restrictions, x1,x2≥0x_{\mathclap{1}},x_{\mathclap{2}} \geq 0 account for this requirement.

The complete model can be now stated as:

Maximize zz = 5x1+4x25x_{\mathclap{1}} + 4x_{\mathclap{2}}

subject to,

6x1+4x2≤246x_{\mathclap{1}} + 4x_{\mathclap{2}} \leq 24

x1+2x2≤6x_{\mathclap{1}} + 2x_{\mathclap{2}} \leq 6

x2−x1≤1x_{\mathclap{2}} - x_{\mathclap{1}} \leq 1

x2≤2x_{\mathclap{2}} \leq 2

x1,x2≥0x_{\mathclap{1}} , x_{\mathclap{2}} \geq 0

Any values of x1x_{\mathclap{1}} and x2x_{\mathclap{2}} that satisfy all the five constraints constitute a feasible solution. Otherwise the solution is infeasible. For example, the solution x1=3x_{\mathclap{1}} = 3 and x2=1x_{\mathclap{2}} = 1 is feasible because on substitution in the constraints none of the inequalities are violated. On the other hand the solution, the solution x1=4x_{\mathclap{1}} = 4 and x2=1x_{\mathclap{2}} = 1 is infeasible because it does not satisfy constraint (1), namely 6∗4+4∗1=286 * 4 + 4 * 1 = 28 which is larger then the right hand side (=24=24).

Our goal is to find the optimum solution, i.e. one which maximizes the objective function besides being feasible. The procedure to do that will be discussed in the succeeding sections.