chapter 2 modeling with linear programmingosp.mans.edu.eg/elbeltagi/cb312 ch2.pdf · chapter 2...

39
Operations Research 12 Dr. Emad Elbeltagi CHAPTER 2 MODELING WITH LINEAR PROGRAMMING This chapter deals with the model formulation using linear programming for different systems. Terminology of linear programming models will be presented. It, also, handles two dimensional problems using the graphical method in order to determine the optimal solution. Students will be introduced to identify problems with unique optima, alternate optima, unbounded solution, and infeasible solution. 2.1 Main Assumptions for Linear Programming In linear programming modeling, the following assumptions are very essential: - There is always a definite objective that can be mathematically represented in an equation format. - Constraints are always limiting the use of the available resources. - There different alternative or solutions for the problem at hand, and for each solution there is a specific value for the objective function. The preferred solution is the one that optimizes the objective and satisfies the constraints. - All relationships between variables are linear. - Linear programming assumes confident in all gathered data. 2.2 Inequalities versus Equations 2.2.1 Equations Equations are relations between a definite thing in the left side that is represented mathematically in the right side and there is an equal sign (=) between them, such as profit = number of sold units x profit per unit.

Upload: lamnga

Post on 10-Mar-2018

237 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 12 Dr. Emad Elbeltagi

CHAPTER 2

MODELING WITH LINEAR PROGRAMMING

This chapter deals with the model formulation using linear programming for different

systems. Terminology of linear programming models will be presented. It, also, handles

two dimensional problems using the graphical method in order to determine the optimal

solution. Students will be introduced to identify problems with unique optima, alternate

optima, unbounded solution, and infeasible solution.

2.1 Main Assumptions for Linear Programming

In linear programming modeling, the following assumptions are very essential:

- There is always a definite objective that can be mathematically represented in an

equation format.

- Constraints are always limiting the use of the available resources.

- There different alternative or solutions for the problem at hand, and for each

solution there is a specific value for the objective function. The preferred

solution is the one that optimizes the objective and satisfies the constraints.

- All relationships between variables are linear.

- Linear programming assumes confident in all gathered data.

2.2 Inequalities versus Equations

2.2.1 Equations

Equations are relations between a definite thing in the left side that is represented

mathematically in the right side and there is an equal sign (=) between them, such as

profit = number of sold units x profit per unit.

Page 2: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 13 Dr. Emad Elbeltagi

2.2.2 Inequalities

Sometimes, it becomes difficult to set an equation relation in a definite form, because one

side of the equation should be greater than or smaller than a specific value. In such case

we use the inequalities as a mathematical format to represent such cases. In equalities, the

equal (=) relationship is replaced by the greater than or equal (≥) or smaller than or equal

(≤) relations. For example:

7x + 4y ≥ 100

2x - 5y ≤ 76

2.2.3 Graphical Representation of Inequalities

Consider the following examples to illustrate how to represent the inequalities.

Example 1: x1 ≥ 0; this inequality consists of two parts:

- x1 = 0 is represented by the vertical x2 axis where each point in that axis has x1 = 0

- x1 > 0, this represent any value of x1 greater than 0 to infinity. This is represented

by vertical lines parallel to the x2 axis and far from it by the value of x1.

Accordingly, all the points lying on the vertical axis x2 or on any vertical line

parallel to it on the right side satisfies the inequality x1 ≥ 0 as shown in Fig. 2.1.

Similarly, the inequality x2 ≥ 0 is represented in the right part of Fig. 2.1.

Figure 2.1: Inequalities representation of example 1

Example 2: 4x1 + 2x2 ≤ 60; this inequality consists of two parts:

- 4x1 + 2x2 = 60 and this represented by the straight line connecting the two points

(x1 = 0, x2 = 30) and (x1 = 15, x2 = 0).

x1 ≥ 0

x2

x1

x2 ≥ 0

x2

x1

Page 3: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 14 Dr. Emad Elbeltagi

- 4x1 + 2x2 < 60, this represented by infinite number of straight lines parallel to the

line represented by the equation 4x1 + 2x2 = 60 and in the direction of the origin.

Thus the inequality 4x1 + 2x2 ≤ 60 is represented by the line 4x1 + 2x2 = 60 and all

the lines parallel to it to the direction of the origin point as shown below (Fig. 2.2,

the left side). Similarly, the inequality 5x1 + 8x2 ≥ 80 can be represented by the

line 5x1 + 8x2 = 80 and all the lines parallel to it and to the opposite direction of

the origin point as shown in the right part of Fig. 2.2.

Figure 2.2: Graphical Representation of example 2

2.3 Linear Programming: An Introductory Example

A Computers company makes quarterly decisions about their product mix. While their

full product line includes hundreds of products, two products will be considered:

notebook computers and desktop computers. The company would like to know how

many of each product to produce in order to maximizes profit for the quarter.

There are a number of limits on what the computers company can produce. The major

constraints are as follows:

1. Each computer (either notebook or desktop) requires a Processing Chip. Due to

tightness in the market, their supplier has allocated only 10,000 chips.

2. Each computer requires memory. Memory comes in 16MB chip sets. A notebook

computer has 16MB memory installed (so needs 1 chip set) while a desktop

computer has 32MB (so requires 2 chip sets). The company received a great deal

on chip sets, so it have a stock of 15,000 chip sets to use over the next quarter.

4x1 + 2x2 ≤ 60

x2

x1 (15, 0)

(0, 30) 5x1 + 8x2 ≥ 80

x2

x1

(0, 10)

(16, 0)

Page 4: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 15 Dr. Emad Elbeltagi

3. Each computer requires assembly time: a notebook computer takes 4 minutes to

assemble versus 3 minutes for a desktop. There are 25,000 minutes of assembly

time available in the next quarter.

Given current market conditions, material cost, and production system, each notebook

computer produced generates LE 750 profit, and each desktop produces LE 1000 profit.

How many of each computer type should the computer company produce in the next

quarter? What is the maximum profit the computer company can make? Linear

programming gives us a mechanism for answering all of these questions quickly and

easily. There are three steps in applying linear programming: modeling, solving, and

interpreting.

2.3.1 Modeling

Modeling a problem using linear programming involves writing it in the language of

linear programming. There are rules about what you can and cannot do within linear

programming. Key to a linear program is the decision variables, objective, and

constraints.

Decision Variables: The decision variables represent unknown decisions to be made.

This is in contrast to problem data, which are values that are either given or can be simply

calculated from what is given. For this problem, the decision variables are the number of

notebooks and the number of desktops to produce. We will represent these unknown

values by x1 and x2 respectively. To make the numbers more manageable, we will let x1

be the number of 1000 notebooks produced (so x1 = 5 means a decision to produce 5000

notebooks) and x2 be the number of 1000 desktops. Note that a value like the quarterly

profit is not (in this model) a decision variable: it is an outcome of decisions x1 and x2.

Objective: Every linear program has an objective. This objective is to be either

minimized or maximized. This objective has to be linear in the decision variables, which

means it must be the sum of constants multiplied by the decision variables. 3x1 - 10x2 is a

linear function. x1 x2 is not a linear function. In this case, our objective is to maximize the

function 750x1 +1000x2.

Page 5: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 16 Dr. Emad Elbeltagi

Constraints: Every linear program also has constraints limiting feasible decisions. Here,

there are four constraints: processing chips, memory sets, assembly time, and non-

negativity. In order to satisfy the limit on the number of chips available, it is necessary to

have x1 + x2 ≤ 10. If this were not the case (say x1 = x2 = 6), the decisions would not be

implementable (12,000 chips would be required, though we only have 10,000). Linear

programming cannot handle arbitrary restrictions: once again, the restrictions have to be

linear. This means that a linear function of the decision variables must be related to a

constant, where related can mean less than or equal to, greater than or equal to, or equal

to. So 3x1 - 2x2 ≥ 10 is a linear constraint, as is - x1 + x3 = 6, while, x1x2 ≤ 10 is not a

linear constraint, nor is x1 + 3x2 < 3. Our constraint for Processing Chips x1 + x2 ≤ 10 is a

linear constraint. The constraint for memory chip sets is x1 + 2x2 ≤ 15, a linear constraint.

Our constraint on assembly time can be written 4x1 + 3x2 ≤ 25, again a linear constraint.

Finally, we do not want to consider decisions like x1 = -5, where production is negative.

We add the linear constraints x1 ≥ 0, x2 ≥ 0 to enforce non-negativity of production.

Final Model: This gives us the complete model of this problem:

Maximize 750 x1 + 1000x2

Subject to: x1 + x2 ≤ 10

x1 + 2x2 ≤ 15

4x1 + 3x2 ≤ 25

x1 ≥ 0; x2 ≥ 0

Formulating a problem as a linear program means going through the above process to

clearly define the decision variables, objective, and constraints.

2.3.2 Standard Form of Linear Programming

The key terms of linear programming model are resources, m, and activities, n, where m

denotes the number of different kinds of resources that can be used and n denotes the

number of activities being considered. From the previous example, the m resources are

the number of ships available, the number of memory chips available, and the assembly

time limit. Typical resources are money, equipment, personnel, etc. Sample activities

include shipping goods, specific products, and investing in particular projects.

Page 6: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 17 Dr. Emad Elbeltagi

Assume: Z= value of overall measure of performance

xj = level of activity j (j=1, 2, ….. , n)

cj = increase in Z that result from each unit increase in activity j

bi = amount of resource i that is available to activity j (i=1, 2,…, m)

aij = amount of resource i consumed by each unit of activity j.

The general form of allocating resources to activities in order to form the general

mathematical model of linear programming is as follows:

Resource Resources usage per unit of activity

1 2 …… n Amount of resource available

1

2

.

m

a11 a12 …… a1n

a21 a22 …… a2n

…. .... …… …

am1 am2 ..….. amn

b1

b2

bm

Contribution to Z c1 c2 ……. cn

So, the general model is to select the values of x1, x2, ….., xn so as to

Maximize Z = c1x1 + c2x2 + …… + cnxn

Subject to a11x1 + a12x2 + …… + a1nxn ≤ b1

a21x1 + a22x2 + …… + a2nxn ≤ b2

.

am1x1 + am2x2 + …… + amnxn ≤ bm and

x1 ≥ 0, x2 ≥ 0, ….. xn ≥ 0 non-negativity constraint

Generally, the function being maximized is called the objective function. The first m

restrictions are called the constraints. The xj≥ 0 restrictions are non-negativity constraints.

2.3.3 Solving the Model Graphically

Models are useful as they allow for a formal definition of a problem and can be useful in

thinking about a problem. For a model with only two variables, it is possible to solve the

problem by drawing the feasible region and determining how the objective is optimized

on that region. That process is illustrated here. The purpose of this exercise is to give you

intuition and understanding of linear programming models and their solution. In any real

application, you would use a computer to solve even two variable problems (Excel's

Solver is outlined in the next section to find solutions for linear programming problems).

Page 7: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 18 Dr. Emad Elbeltagi

Feasible region

Feasible region

We can represent a model with two variables by labeling the axes of a graph with each of

the variables. The entire graph then represents possible decisions. Constraints are

represented by lines on the graph, with the feasible region lying on one side of the line.

Figure 2.3 illustrates this with the constraint x1 + x2 ≤ 10. We can continue this process

and add in all of the constraints. Since every constraint must be satisfied, the resulting

region bounded by all constraints (the shaded region in Fig. 2.4) called the feasible

region and it is defined as the intersection of the feasible region for each constraint.

Figure 2.3: Single constraint representation

Figure 2.4: Feasible region of the introductory example

Page 8: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 19 Dr. Emad Elbeltagi

(Optimum solution)

Note that just graphing the model gives us information we did not have before. It seems

that the Chip constraint (x1 + x2 ≤ 10) plays little role in this model. This constraint is

dominated by other constraints. Now, how the optimal solution could be found? This

could be done by drawing the objective function line on this diagram. This line represents

the points along which the profit is the same. Since our goal is to maximize the profit, we

can push the objective function line out until moving it any further would result in no

feasible point (Fig. 2.5, z represents the profit). Clearly the optimal profit occurs at point

X. For any value of z, all lines will be parallel as shown in Fig. 2.5. The objective

function z = 750x1 + 1000x2 can be written in the following form:

1000x2 = -750x1 + z or x2 = -750/1000x1 + z/1000

or x2 = -3/4x1 + z/1000

The last equation called the slop-intercept form of the objective function, demonstrate

that the slope of the line is -3/4 (since each unit increase in x2 changes x1 by -3/4), where

the intercept of the line with the x2 axis is z/1000 (since x2 = z/1000 when x1= 0). That

fact that the slope is fixed at -3/4 means that all lines constructed in this way are parallel.

The variable values at point X represent the intersection point of the two constraints: x1 +

2x2 ≤ 15 and 4x1 + 3x2 ≤ 25.

Figure 2.5: Finding optimal solution

Page 9: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 20 Dr. Emad Elbeltagi

By solving the previous two constraints equations, the values of x1 and x2 can be easily

determined: the solution here is x1 = 1 and x2 = 7. The optimal decision is to produce

1,000 notebooks and 7,000 desktops, for a profit of LE 7,750,000.

2.3.4 Terminology of the Model Solution

The final answer for the problem is always called solution, however in linear

programming, any values for the decision variables (x1, x2, …… ) that satisfies all

constraints are called a solution. So the following definitions are adopted: A feasible

solution is a solution for which all the constraints are satisfied. An infeasible solution is

a solution for which at least one constraint is violated.

In the previous example, the points (2, 3) and (1, 6) are feasible solutions, while the

points (4, 6) and (-1, 3) are infeasible solutions. The feasible region is the collection of

all feasible solutions. In the example, the feasible region is the entire shaded area as

shown in Fig. 2.6. It is possible for the problem to have no feasible solutions. This would

have happened in the example if it was required to have a net profit of at least LE 10,000

per quarter. This constraint 750x1 + 1000x2 ≥ 10000 would eliminate the entire feasible

region, so no mix of products would be able to produce this profit as shown in Fig. 2.7.

Figure 2.6: Solution terminology

Feasible

region

(0, 10)

(15, 0)

(0, 8.3)

(0, 7.5)

(6.25, 0) (10, 0)

(1, 7)

optimum

Inactive

constraint

Active

constraint

Active

constraint

Page 10: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 21 Dr. Emad Elbeltagi

Maximize 750 x1 + 1000 x2

Subject to: x1 + x2 ≤ 10

x1 + 2x2 ≤ 15

4x1 + 3x2 ≤ 25

750x1 + 1000x2 ≥ 10000

x1 ≥ 0; x2 ≥ 0

Figure 2.7: No feasible solution

An optimal solution is a feasible solution that has the most favorable value of the

objective function. This value is the largest value if the objective function is to be

maximized and the smallest value if the objective function is to be minimized. Most

problems will have just one optimal solution. However, it is possible to have more than

one optimal solution. Also, it is possible that a problem has no optimal solution; this

happens if the problem has no feasible region or the constraints do not prevent improving

the value of the objective function.

A corner-point feasible (CPF) solution is a solution that lies at a corner of the feasible

region. As shown in Figure 2.6, a linear programming problem with feasible solution

750x1 + 1000x2 ≥ 10000

Page 11: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 22 Dr. Emad Elbeltagi

must contain a bounded feasible region. The bonded region always has CPF [(0, 0); (6.25,

0); (1, 7); (0, 7.5)] and solutions with at least one optimal solution; (1, 7). Thus, if a

problem has exactly one optimal solution, it must be a CPF solution. If the problem has

multiple optimal solutions, at least two must be CPF solutions.

An active constraint is the constraint that share in forming the feasible region, while an

in-active constraint is the constraint that doesn’t share in forming the feasible region. In

the previous example, the following constraints are represents the set of active

constraints: x1 + 2 x2 ≤ 15; 4x1 + 3x2 ≤ 25; x1 ≥ 0 and x2 ≥ 0, while the x1 + x2 ≤ 10 is an

in-active constraint (these are shown in Fig. 2.6).

2.3.5 Solving Using Solver Program

Rather than the somewhat tedious and error-prone graphical method (which is limited to

two variables), special computer programs can be used to find solutions to linear

programming models. The most widespread program is Solver, included in all recent

versions of the Excel spreadsheet program. Solver, while not a state of the art code is a

reasonably robust, easy-to-use tool for linear programming. Solver uses standard

spreadsheets together with an interface to define variables, objective, and constraints to

define a linear program. Excel Solver add-in optimizes linear and integer problems using

the simplex and branch and bound methods. It searches for the proper values of model

variables that minimize or maximize a target cell (objective function), under a set of user-

specified constraints. The following is a brief outline and hints for using solver:

- Start with entering the data into spreadsheet in some reasonably way.

- Create the model in a separate part of the worksheet. Each variable is described in

one cell. Solver will eventually put the optimal values in each cell.

- The objective is represented by a single cell. The formula that represents the

objective function will be entered in a linear form. The problem modeling of the

previous example in a spreadsheet is shown in Fig. 2.8.

- We then have a cell to represent the left hand side of each constraint (again a

linear function) and another cell to represent the right hand side (a constant).

Page 12: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 23 Dr. Emad Elbeltagi

Figure 2.8: Problem modeling in Excel

- We then select Solver under the Data menu (Excel 2007). This gives a form to

define the linear program. If solver is not available in your Excel program, you

may add it using “Excel Options” then “Add-Ins”.

- In the “Set Target Cell" box, select the objective cell and then choose “Max” for

maximization or “Min” for minimization option buttons or you may set the

objective to a specific value by choosing “value of” option button (Fig. 2.9).

- In the “By Changing Cells", put in the range containing the variable cells.

- Next, add the constraints by pressing the “Add" button. The dialog box for adding

constraints appears (Fig. 2.10) and it has three parts for the left hand side, the type

of constraint, and the right hand side. Put the cell references for a constraint in the

form, choose the right type, and press “Add". Continue until all constraints are

added including the non-negativity; press “OK" after final constraint (Fig. 2.9).

Figure 2.9: Solver interface and setting

Changeable cells

(variables)

Target cell

(objective)

Page 13: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 24 Dr. Emad Elbeltagi

Figure 2.10: Adding constraints interface

- Push the options button and toggle the “Assume Linear Model" in the resulting

dialog box. This tells Excel to call a linear rather than a nonlinear programming

routine so as to solve the problem more efficiently (Fig. 2.9).

- Push the Solve button. In the resulting dialog box, select “Answer" and

“Sensitivity". This will put the answer and sensitivity analysis in two new sheets.

Ask Excel to “Keep Solver values", and your worksheet will be updated with

optimal values are in variable cells. The complete solution of the problem along

with the sensitivity analysis report is shown in Fig. 2.11.

Figure 2.11: Final solver report of the computer company problem

Page 14: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 25 Dr. Emad Elbeltagi

2.4 Second Example: Market Allocations

A marketing company is planning a one week advertising campaign for their new knife.

The ads have been designed and produced and now they wish to determine how much

money to spend in each advertising outlet. They have hundreds of possible outlets to

choose from. Let’s consider two outlets: Prime-time TV, and newsmagazines. The

problem of optimally spending advertising money can be formulated in many ways. For

instance, given a fixed budget, the goal might be to maximize the number of target

customers reached (customer with a reasonable chance of purchasing the product). An

alternative approach, which we adopt here, is to define targets for reaching each market

segment and to minimize the money spent to reach those targets. For this product, the

target segments are teenage boys, women (ages 40-49), and retired men. Each minute of

primetime TV and page of newsmagazine advertisement reaches the following number of

people (in millions):

Outlet Boys Women Men Cost

TV 5 1 3 600

Magazine 2 6 3 500

Target 24 18 24

Again, the marketing company is willing to know how many units of each outlet to

purchase to meet the goals.

2.4.1 Modeling

The process of modeling using linear programming is fairly consistent: define the

decision variables, objective, and constraints.

Decision Variables: In this case, they are the number of units of each outlet to purchase.

Let x1 be the number of TV spots, and x2 the number of magazine pages.

Objective: Our objective is to minimize the amount we spend: 600x1 + 500x2.

Page 15: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 26 Dr. Emad Elbeltagi

Constraints: We have one constraint for each market segment: we must be certain that we

reach sufficient people of each segment. For boys, this corresponds to the constraint: 5x1

+ 2 x2 ≥ 24. Similar constraints for the other segments give us the full formulation as:

Minimize 600x1 + 500x2

Subject to 5x1 + 2x2 ≥ 24

x1 + 6x2 ≥ 18

3x1 + 3x2 ≥ 24

x1 ≥ 0; x2 ≥ 0

2.4.2 Solving the Model Graphically

Since this model has only two variables, we can solve the problem in two ways:

graphically and using SOLVER. We start by solving this graphically. The first step is to

graph the feasible region, as given in Fig. 2.12. The next step is to plot the objective

function line on the diagram: lines representing points that have the same cost. We mark

the optimal point with an X (Fig. 2.13). X is the intersection of the two constraints: 5x1 +

2x2 = 24 and 3x1 + 3x2 = 24. Solving these to equations together, the optimal solution is

determined to be as follows: x1 = 2.67 and x2 = 5.33

Figure 2.12: Marketing example

Page 16: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 27 Dr. Emad Elbeltagi

Figure 2.13: Marketing example showing the optimum solution

2.4.3 Solving Using Solver Program

The problem formulation on Excel is shown in Fig. 2.14, while the Solver setting is

shown in Fig. 2.15. The complete report of the problem solution is shown in Fig. 2.16.

Figure 2.14: Problem modeling in Excel

Figure 2.15: Solver setting

Page 17: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 28 Dr. Emad Elbeltagi

Figure 2.16: Final solver report of the marketing problem

2.5 Types of Linear Programming Solutions

Whenever a linear programming model is formulated and solved, the result will be one of

four characteristic solution types: 1) unique optimal solution, 2) alternate optimal

solutions, 3) no-feasible solution, and 4) unbounded solutions. The following example

illustrates these different situations.

Illustrative example

A small company produces construction materials for the commercial and residential

construction industry. The company produces two products: a universal concrete patching

product (CON) and a decorative brick mortar (MORT). The company can sell the CON

for a profit of LE 140/ton and the MORT for a profit of LE 160/ton. Each ton of the CON

requires 2 m3 of the red clay and each ton produced of the MORT requires 4 m

3. A

maximum of 28 m3 of the red clay could be available every week. The machine used to

blend these products can work only a maximum of 50 hours per week. This machine

blends a ton of either product at a time, and the blending process requires 5 hours to

complete. Each material must be stored in a separate curing vat, thus limiting the overall

production volume of each product. The curing vats for CON and MORT have capacities

of 8 and 6 tons, respectively. What is optimal production strategy for the company given

this information?

Page 18: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 29 Dr. Emad Elbeltagi

Model formulation

First we have to decide on decision variables. Let us label the two materials (CON and

MORT) 1, and 2, and let x1 represents the number of tons of CON produced each week

and x2 represents the number of tons of MORT produced each week. Our objective is to

maximize the profit of these materials, which can be written as:

Max total weekly profit, Z = 140x1 + 160x2

We have constraints for the red clay material, the blending time, and for the curing vat

capacity. This gives the following formulation:

Subject to: 2x1 + 4x2 ≤ 28

5x1 + 5x2 ≤ 50

x1 ≤ 8

x2 ≤ 6

x1, x2 ≥ 0

2.5.1 Problems Having Unique Optima

The above illustrative example is solved graphically by plotting the feasible region in the

decision space as shown in Fig. 2.17 and then plotting the objective function on the same

graph. Then, shifting the objective function line in the direction of improvement until it

last intersected the feasible region (Fig. 2.17). In this case, the intersection between the

feasible region and the set points satisfying the equation: 1480 = 140x1 + 160x2, which

consisted of a single point x1 = 6 and x2 = 4. This point is the only point on this line that

satisfies all constraint equations simultaneously. Consequently, the optimal solution to

the linear program is unique one; the problem is said to have unique optimal solution.

2.5.2 Problems Having Alternate Optima

As shown above, the slope of the objective function is determined by the coefficients that

multiply the decision variables. For example, if the coefficient of x2 in the original

objective functions is decreased to the coefficient of x1. The slope of the objective

Page 19: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 30 Dr. Emad Elbeltagi

function line becomes steeper. Suppose the objective function becomes as follows: Z =

140x1 + 140x2

Figure 2.17: Graphical solution of the illustrative example with unique optimal solution

Now, resolve the problem graphically as shown in Fig. 2.18. The intersection of the

objective function line and the feasible region at optimality becomes a line segment (Fig.

2.18) and all points on the line connecting the points (6, 4) and (8, 2) give the same value

of the objective function and satisfy the equation 1400 = 140x1 + 140x2. This problem

thus has an infinite number of optimal solutions, or is said to have alternate optima.

Figure 2.18: Solution of the illustrative example with multi-optimal solutions

Feasible region

x1 ≤ 8

1480 = 140x1 + 160x2

2x1 + 4x2 ≤ 28

5x1 + 5x2 ≤ 50

x2 ≤ 6

(6, 4) Unique optimal

solution

1400 = 140x1 + 140x2

(6, 4)

(8, 2)

Line segment of alternate optima

Feasible region

Page 20: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 31 Dr. Emad Elbeltagi

2.5.3 Problems Having No Feasible Solution

It is possible that there are no feasible solution for a given problem formulation. This may

occur when constraints conflict with one another. Or it may occur due to errors in

entering problem formulation to a solver. Thus means that there is no specific solution

that satisfies all constraints together. Assume the following set of constraints:

5x1 + 5x2 ≤ 50

x1 ≥ 8

x2 ≥ 6

Figure 2.19 shows three constraints plotted in decision space in such a way that there is

no feasible region formed; the problem is said to be infeasible.

Figure 2.19: Graphical solution showing no-feasible region

2.5.4 Problems that are Unbounded

The infeasible solution results from problems that are over constrained. In the current

case, we may encounter a situation where the problem is under constrained. Consider the

following set of constraints:

5x1 + 5x2 ≥ 50

x1 ≤ 8

x1 ≥ 6

Page 21: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 32 Dr. Emad Elbeltagi

In Fig. 2.20, the feasible region is shaded and bounded by three constraints. The objective

function line and its direction of improvement are also shown. It is clearly shown that for

any feasible solution in this decision space, there is always another one that gives a better

value of the objective function such that the objective function for this problem could be

moved upwards and to the right without limit. Such a problem is said to be unbounded.

Figure 2.20: Unbounded feasible region

2.6 Limitations of Linear Programming Modeling

Hidden in our models of these problems are a number of assumptions. The usefulness of

a model is directly related to how close reality matches up with these assumptions. The

first assumption is due to the linear form of our functions. Since the objective is linear,

the contribution to the objective of any decision variable is proportional to the value of

the decision variable. Producing twice as much of a product produces twice as much

profit; buying twice as many pages of ads costs twice as much. This is the

Proportionality Assumption.

Furthermore, the contribution of a variable to the objective is independent of the values

of the other variables. One notebook computer is worth LE750, independent of how

many desktop computers we produce. This is the Additivity Assumption. Similarly, since

each constraint is linear, the contribution of each variable to the left hand side of each

constraint is proportional to the value of the variable and independent of the values of any

other variable.

Unbounded feasible region 5x1 + 5x2 ≥ 50

x1 ≥ 6

x1 ≤ 8

Objective function line

Page 22: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 33 Dr. Emad Elbeltagi

These assumptions are quite restrictive. We will see, however, that clever modeling can

handle situations that may appear to violate these assumptions. The next assumption is

the Divisibility Assumption: it is possible to take any fraction of any variable. Rethinking

the Marketing example, what does it mean to purchase 2.67 television ads? It may be that

the divisibility assumption is violated in this example. Or, it may be that the units are

such that 2.67 “ads" actually corresponds to 2666.7 minutes of ads, in which case we can

“round off" our solution to 2667 minutes with little doubt that we are getting an optimal

or nearly optimal solution.

The final assumption is the Certainty Assumption: linear programming allows for no

uncertainty about the numbers. An ad will reach the given number of people; the number

of assembly hours we give will certainly be available. It is very rare that a problem will

meet all of the assumptions exactly. That does not negate the usefulness of a model. A

model can still give useful managerial insight even if reality differs slightly from the

rigorous requirements of the model. For instance, the knowledge that our chip inventory

is more than sufficient holds in our first model even if the proportionality assumptions are

not satisfied completely.

2.7 Linear Programming Models

Linear programming models are found in almost every field of business. The next sub-

sections show a number of problems and how to model them by the appropriate choice of

decision variables, objective, and constraints.

2.7.1 Diet Problem

Problem Definition

What is the perfect diet? An ideal diet would meet or exceed basic nutritional

requirements, be inexpensive, have variety, and be “pleasing to the palate". How can we

find such a diet? Suppose the available foods are as follows:

Page 23: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 34 Dr. Emad Elbeltagi

Food Serving

Size

Energy

(kcal)

Protein

(g)

Calcium

(mg)

Price

(cents/serving)

Limit

(servings/day)

Oatmeal 28 g 110 4 2 3 4

Chicken 100 g 205 32 12 24 3

Eggs 2 Large 160 13 54 13 2

Whole

Milk 237 cc 160 8 285 9 8

Cherry

Pie 170 g 420 4 22 20 2

Beans 260 g 260 14 80 19 2

After consulting with nutritionists, we decree that a satisfactory diet has at least 2000 kcal

of energy, 55 g of protein, and 800 mg of calcium. While some of us would be happy to

live on 10 servings of beans, we have decided to impose variety by having a limit on the

number of servings/day for each of our six foods. What is the least cost satisfactory diet?

Problem Modeling

First we decide on decision variables. Let us label the foods 1, 2, … 6, and let xi represent

the number of servings of food i in the diet. Our objective is to minimize cost, which can

be written as: 3x1 + 24x2 + 13x3 + 9x4 + 20x5 + 19x6. We have constraints for energy,

protein, calcium, and for each serving/day limit. This gives the formulation:

Minimize: 3x1 + 24x2 + 13x3 + 9x4 + 20x5 + 19x6

Subject to: 110x1 + 205x2 + 160x3 + 160x4 + 420x5 + 260x6 ≥ 2000

4x1 + 32x2 + 13x3 + 8x4 + 4x5 + 14x6 ≥ 55

2x1 + 12x2 + 54x3 + 285x4 + 22x5 + 80x6 ≥ 800

x1 ≤ 4

x2 ≤ 3

x3 ≤ 2

x4 ≤ 8

x5 ≤ 2

x6 ≤ 2

xi ≥ 0 (for all i)

Page 24: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 35 Dr. Emad Elbeltagi

2.7.2 Workforce Planning

Problem Definition

Consider a restaurant that is open seven days a week. Based on past experience, the

number of workers needed on a particular day is given as follows:

Day Mon Tue Wed Thu Fri Sat Sun

Number 14 13 15 16 19 18 11

Every worker works five consecutive days, and then takes two days off, repeating this

pattern. How can we minimize the number of workers that staff the restaurant?

Model

A first attempt at this problem is to let xi be the number of people working on day i. Note

that such a variable definition does not match up with what we need. Some workers will

work both Monday and Tuesday, some only one day, some neither of those days. Instead,

let the days be numbered 1 through 7 and let xi be the number of workers who begin their

five day shift on day i. Our objective is clearly minimize: x1 + x2 + x3 + x4 + x5 + x6 + x7

Consider the constraint for Monday's staffing is 14. Who works on Mondays? Clearly

those who start their shift on Monday (x1). Those who start on Tuesday (x2) do not work

on Monday, nor do those who start on Wednesday (x3). Those who start on Thursday (x4)

do work on Monday, as do those who start on Friday, Saturday, and Sunday. This gives

the constraint: x1 + x4 + x5 + x6 + x7 ≥ 14. Similar arguments give a total formulation of:

Minimize x1 + x2 + x3 + x4 + x5 + x6 + x7

Subject to x1 + x4 + x5 + x6 + x7 ≥ 14

x1 + x2 + x5 + x6 + x7 ≥ 13

x1 + x2 + x3 + x6 + x7 ≥ 15

x1 + x2 + x3 + x4 + x7 ≥ 16

x1 + x2 + x3 + x4 + x5 ≥ 19

x2 + x3 + x4 + x5 + x6 ≥ 18

x3 + x4 + x5 + x6 + x7 ≥ 11

xi ≥ 0 (for all i)

Page 25: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 36 Dr. Emad Elbeltagi

2.7.3 Financial Portfolio

Problem Definition

The optimality of a portfolio depends heavily on the model used for defining risk and

other aspects of financial instruments. Here is a particularly simple model that is

amenable to linear programming techniques. Consider a mortgage team with LE

100,000,000 to finance various investments. There are five categories of loans, each with

an associated return and risk (1-10; 1 best):

Loan/investment Return (%) Risk

First Mortgages 9 3

Second Mortgages 12 6

Personal Loans 15 8

Commercial Loans 8 2

Government Securities 6 1

Any non-invested money goes into a savings account with no risk and 3% return. The

goal for the mortgage team is to allocate the money to the categories so as to:

Maximize the average return per dollar.

Have an average risk of no more than 5 (risks taken over the invested money

not over the saved money).

Invest at least 20% in commercial loans.

The amount in second mortgages and personal loans combined should be no

higher than the amount in first mortgages.

Model

Let the investments be numbered 1…..5, and let xi be the amount invested in investment

i. Let x6 be the amount in the savings account.

The objective is to maximize 9x1 + 12x2 + 15x3 + 8x4 + 6x5 + 3x6

Subject to x1 + x2 + x3 + x4 + x5 + x6 = 100,000, 000.

Page 26: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 37 Dr. Emad Elbeltagi

Now, let's look at the average risk. Since we want to take the average over only the

invested amount, a direct translation of this constraint is:

3x1 + 6x2 + 8x3 + 2x4 + x5 / (x1 + x2 + x3 + x4 + x5) ≤ 5

This constraint is simplified to get the equivalent linear constraint:

-2x1 + x2 + 3x3 – 3x4 – 4x5 ≤ 0

Similarly we need x4 ≥ 0.2 (x1 + x2 + x3 + x4 + x5)

Or -0.2x1 – 0.2x2 – 0.2x3 + 0.8x4 – 0.2x5 ≥ 0

The final constraint is x2 + x3 - x1 ≤ 0

Together with non-negativity, this gives the entire formulation.

2.8 Solved Examples

2.8.1 Example 1

A city public works department is planning for a new water supply project. Water

from a nearby aquifer is available in adequate supply, but its hardness level is too

high unless it is blended with a lower hardness source. The total-kilograms of

hardness per million cubic meters are limited to 1200 in the final blended supply.

Water from a distant stream is of sufficient quality, but the cost to pump it is quite

high. The city is planning to get the water from three sources: the current supply;

the aquifer; and the distant stream. The costs to get water (LE) per million cubic (m

m3) meters and the hardness in kilogram per m m

3 are given below.

Source 1 Source 2 Source 3

Cost (LE/m m3) 500 1000 2000

Supply limit (m m3) 25 120 100

Hardness (Kg/ m m3) 200 2300 700

A total of 150 million cubic meter of water is needed per day by the end of ten

years. Formulate a mathematical model to determine the least-cost strategy for

supplying water while ensuring that the water supply remains of acceptable quality.

Solution

Page 27: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 38 Dr. Emad Elbeltagi

Let the variables be as follows:

x1 : millions of cubic meters of water per day to be drawn from source 1

x2 : millions of cubic meters of water per day to be drawn from source 2

x3 : millions of cubic meters of water per day to be drawn from source 3

The objective is to minimize the cost of waste supply, c,

Min c = 500x1 + 1000x2 + 2000x3

The constraints are:

x1 + x2 + x3 ≥ 150 (required amount of water)

200x1 + 2300x2 + 700x3 ≤ 1200 × 150 (hardness constraint)

x1 ≤ 25 (supply constraint)

x2 ≤ 120 (supply constraint)

x3 ≤ 100 (supply constraint)

x1, x2, x3 ≥ 0

2.8.2 Example 2

You have been hired to plan a new subdivision development. You are trying to

evaluate two options: 200 m2 or 240 m

2 homes. Each 200 m

2 home will cost LE

6,000 and make profit of LE 15,000. Also, each 240 m2 home will cost LE 9,000

and make profit of LE 18,000. The available fund for the new subdivision

development is LE 450,000. Also, at least one-third of the total number of houses

should be of the 240 m2 type. Define the decision variables and formulate a linear

program model to maximize the profit. Solve using the graphical method.

Solution

The variables are the number of 200-m2 and 240-m

2 homes to be built.

x1 = number of 200-m2 homes.

x2 = number of 240-m2 homes.

Cost of 200-m2 home = LE 6,000

Cost of 240-m2 home = LE 9,000

Profit produced from each 200-m2 home = LE 15,000

Page 28: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 39 Dr. Emad Elbeltagi

Profit produced from each 240-m2 home = LE 18,000

Maximum fund available for construction = LE 500,000

One-third of the hoses should be from the 240-m2 type.

Maximize 15000x1 + 18000x2

Subject to 6000x1 + 9000x2 ≤ 450000

x2 ≥ 0.33(x1 + x2) or -0.33x1 + 0.67x2 ≥ 0

x1, x2 ≥ 0

As shown in the following figure, the number of 200-m2 homes is 43 homes, while the

number of 240-m2 home is 21 homes, which satisfies a maximum profit of LE 1,029,399.

2.8.3 Example 3

Resolve example 2.8.2 using the Solver program of Excel.

Solution

First, set the model

in Excel spreadsheet

program as follow:

The solution is shown in the following figure.

-0.33x1 + 0.67x2 ≥ 0

6000x1 + 9000x2 ≤ 450000

Feasible region

Optimum solution

(43.13, 21.24)

15000x1 + 18000x2 = 1029399

Page 29: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 40 Dr. Emad Elbeltagi

2.8.4 Example 4

You have been hired to plan a new subdivision development. A manufacturing firm

produces widgets and distributes them to five wholesalers at a fixed delivered price of

LE 2.50 per unit. Sales forecasts indicate that monthly deliveries will be 2700, 2700,

9000, 4500 and 3600 widgets to wholesalers 1-5 respectively. The monthly

production capacities are 4500, 9000 and 11,250 at plants 1, 2 and 3, respectively.

The direct costs of producing each widget are LE 2 at plant 1, LE 1 at plant 2 and LE

1.80 at plant 3. The transport cost of shipping a widget from a plant to a wholesaler is

given below.

Wholesaler 1 2 3 4 5

Plant 1 0.05 0.07 0.11 0.15 0.16

Plant 2 0.08 0.06 0.10 0.12 0.15

Plant 3 0.10 0.09 0.09 0.10 0.16

Formulate a linear Programming model for this production and distribution problem.

Solution

Cost of production of widgets from plant 1 = LE 2/unit

Cost of production of widgets from plant 2 = LE 1/unit

Cost of production of widgets from plant 3 = LE 1.8/unit

Monthly production capacity from plant 1 = 4500 units

Monthly production capacity from plant 2 = 9000 units

Monthly production capacity from plant 3 = 11250 units

Monthly delivery to wholesaler 1 = 2700 units

Page 30: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 41 Dr. Emad Elbeltagi

Monthly delivery to wholesaler 2 = 2700 units

Monthly delivery to wholesaler 3 = 9000 units

Monthly delivery to wholesaler 4 = 4500 units

Monthly delivery to wholesaler 5 = 3600 units

Assume xij = number of units shipped from plant i to wholesaler j

cij = cost of shipping a unit from plant i to wholesaler j

pi = production cost of a unit at plant i

Let the variables be as follows:

The variables are to determine the number of units to be shipped from each

production plant (the three plants) to each wholesaler (the five wholesalers); xij

The objective is to determine the number of units produced and shipped from plant i

to wholesaler j so that the cost of producing and shipping are minimized, cost

Min cost = (p1+c11)x11 + (p1+c12)x12 + (p1+c13)x13 + (p1+c14)x14 + (p1+c15)x15 +

(p2+c21) x21 +…………………

or min cost = ∑∑( pi + cij)xij, i=1, 2, 3 and j=1, 2, 3, 4, 5

The constraints are:

∑ xi1 ≥ 2700, i=1, 2, 3 (amount to wholesaler 1)

∑ xi2 ≥ 2700, i=1, 2, 3 (amount to wholesaler 2)

∑ xi3 ≥ 9000, i=1, 2, 3 (amount to wholesaler 3)

∑ xi4 ≥ 4500, i=1, 2, 3 (amount to wholesaler 4)

∑ xi5 ≥ 3600, i=1, 2, 3 (amount to wholesaler 5)

∑ x1j ≤ 4500, j=1, 2, 3, 4, 5 (Production limit of plant 1)

∑ x2j ≤ 9000, j=1, 2, 3, 4, 5 (Production limit of plant 2)

∑ x3j ≤ 11250, j=1, 2, 3, 4, 5 (Production limit of plant 3)

x1j ≥ 0

2.8.5 Example 5

Page 31: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 42 Dr. Emad Elbeltagi

An aggregate mix of sand and gravel must contain no less than 20% no more than

30% of gravel. The in situ soil contains 40% gravel and 60% sand. Pure sand may be

purchased and shipped to site at LE 5/m3. A total mix of at least 1000 m3 is required.

There is no charge for using in situ material. The objective is to minimize the cost.

- Draw the feasible region.

- Determine the optimum solution by the graphical method.

- Label the active and inactive constraints.

Solution

Total quantity of material needed = 1000 m3

Minimum quantity of gravel in the mix = 0.20 x 1000 = 200 m3

Maximum quantity of gravel in the mix = 0.30 x 1000 = 300 m3

Let the variables be as follows:

x1 : Quantity of material from in situ

x2 : Quantity of material from outside

The objective is to minimize the cost, z,

Min z = 5x2

The constraints are:

x1 + x2 ≥ 1000

0.4x1 ≥ 200

0.4x1 ≤ 300

x1, x2 ≥ 0

2.8.6 Example 6

Optimum solution:

- x1 = 750

- x2 = 250

- Amount of gravel = 300 m3 from in situ

- Amount of sand = 700 m3; 450 m

3 from

in situ and 250 m3 from outside.

0

200

400

600

800

1000

1200

1400

0 200 400 600 800 1000 1200

(750, 250)

(500, 500)

x1

x2

Page 32: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 43 Dr. Emad Elbeltagi

solve the following problem using the graphical method. Compute the value of the

objective function and decision variables at optimality, and indicate which statement

best describes the solution: 1) this linear program has a unique optimnal solution, 2)

this linear program has alternate optima, 3) this linear program is infeasible, or 4) this

linear program is unbounded.

Minimize Z = 8x1 + 4x2

Subject to 2x1 – 2x2 ≤ 2

4x1 - 3x2 ≥ -6

4x1 + 2x2 ≥ 8

4x1 ≥ 4

4x2 ≥ 6

x1, x2 ≥ 0

Solution

The graphical solution of Example 6 shows that it has alternate optimal solutions which

lie on the line segment between points B (1, 2) and C (1.25, 1.5) with the objective

function equals 16 (optimal solution). It is noted that in this problem, if the objective

function is to be maximized, then the problem in this case is said to be unbounded as the

objective function line will move upward with no constraint to limit its movement.

Page 33: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 44 Dr. Emad Elbeltagi

2.9 Exercises

1. A plant produces two types of refrigerators, A and B. There are two production

lines, one dedicated to producing refrigerators of Type A, the other to producing

refrigerators of Type B. The capacity of the production line for A is 60 units per

day; the capacity of the production line for B is 50 units per day. A requires 20

minutes of labor whereas B requires 40 minutes of labor. Presently, there is a

maximum of 40 hours of labor per day which can be assigned to either production

line. Profit contributions are LE 20 per Type A produced and LE 30 per Type B

produced. What should the daily production be? Solve graphically and by Solver.

2. A building contractor produces two types of houses: detached and semidetached.

The customer is offered several choices of design and layout for each type. The

proportion of each type of design sold in the past is shown in the following table.

Design detached semidetached

Type A

Type B

Type C

0.1

0.4

0.5

0.33

0.67

The profit on a detached house and semidetached house is LE 1000 and LE 800

respectively. The builder has the capacity to build 400 houses per year. However,

an estate of housing is not allowed to contain more than 75% of the total housing

as detached. Furthermore, because of the limited supply of bricks available for

type B design, a 200-house limit with this design is imposed. Develop a

mathematical model for this problem to determine how many detached and

semidetached houses should be constructed in order to maximize profit.

3. A concrete manufacturer is concerned about how many units of two types of

concrete elements to produce during the next time period to maximize profit.

Each element of type “A” generates a profit of LE 60, while each element of type

“B” produces a profit of LE 40. Two and three units of raw materials are needed

to produce one concrete element of type A and B, respectively. Also, four and two

units of time are required to produce one concrete element of type A and B

Page 34: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 45 Dr. Emad Elbeltagi

respectively. If 100 units of raw materials and 120 units of time are available,

formulate a linear programming model for this problem to determine how many

units of each type of concrete elements should be produced to maximize profit.

4. A contractor may purchase material from two different sand and gravel pits. The

unit cost of material including delivery from pits 1 and 2 is LE 50 and LE 70 per

cubic meter, respectively, the contractor requires at least 100 cubic meter of mix.

The mix must contain a minimum of 30% sand. Pit 1 contains 25% and pit 2

contains 50% sand. If the objective is to minimize the cost of material, define the

decision variables and formulate a mathematical model.

- Draw the feasible region

- Determine the optimum solution by the graphical method

- Label the active and inactive constraints

- Use Solver to model and solve this problem

5. As the director of waste management, you are trying to plan next year’s

operations for the disposal of solid waste. You have three options for disposal:

Option Disposal cost (LE/ton)

Local county-owned landfill

Incineration

Contract landfill

6

10

9

There are 300,000 people living in the county with an average of 2.75 kg per

capita per day of solid waste. Several constraints are applied to the problem:

- The total budget for solid waste disposal is LE 3,000,000.

- At least LE 300,000 in disposal income is needed to maintain the local landfill.

- At least LE 75,000 in disposal income is needed to maintain the incinerator.

- The capacity of the incinerator is 50 ton/day (assume 250 working days).

- You don’t want to place in excess of 50% of the waste in the local landfill.

Formulate a linear program model to produce an optimal plan for solid waste

management.

Page 35: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 46 Dr. Emad Elbeltagi

6. It is required to decide how many tons of pure steel and how many tons of scrap

metal to use in manufacturing an alloy. Pure steel costs LE 300 per ton and scrap

LE 600 per ton (larger because the impurities must be skimmed off). The

customer wants at least 5 tons but will accept a larger order and material loss in

melting and casting is negligible. You have 4 tons of steel and 7 tons of scrap to

work with, and the weight ratio of scrap to pure cannot exceed 7/8 in the alloy.

You are allocated 18 hours melting and casting time in the mill; pure steel

requires 3 hrs per ton and scrap 2 hrs per ton. Write a linear programming model

for the problem assuming that the objective is to minimize the total steel and scrap

costs. Then, solve graphically for the amount of pure steel and scrap metal to use.

7. Egypt National Bank is open Monday-Friday from 9 am to 5 pm. From past

experience, the bank knows that it needs the following number of tellers.

Time Period 9 - 10 10 - 11 11 - noon noon - 1 1 - 2 2 - 3 3 - 4 4 - 5

Tellers Required 4 3 4 6 5 6 8 8

The bank hires two types of tellers. Full-time tellers work 9-5 five days a week,

except for 1 hour off for lunch, either between noon and 1 pm or between 1 pm

and 2 pm. Full-time tellers are paid LE 25/hour (this includes payment for lunch

hour). The bank may also hire up to 3 part-time tellers. Each part-time teller must

work exactly 4 consecutive hours each day. A part-time teller is paid LE 20/hour.

Formulate a linear program to meet the teller requirements at minimum cost.

8. A manufacturer produces two types of timber frame housing packages (type 1 and

2). The operations are highly mechanized and the estimated average time required

from each machine for the manufacturing of each package is given below:

Package Machines

A B C

Type 1 10 10 40

Type 2 30 60 20

Page 36: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 47 Dr. Emad Elbeltagi

In a given period there are 600 hours of machine A time available, 850 hours of

machine B available, and 800 hours of machine C. The expected profit for the

production of each unit package is LE 2000 for type 1 and LE 1900 for type 2.

Formulate a linear program model that maximizes the profit and determine the

number of house type produces.

9. A Corporation produces three types of sprinkler heads for irrigation applications.

The company currently has orders for 600 two-inch heads, 500 three-inch heads,

and 800 four-inch heads. Sprinkler heads are made from a copper alloy using a

mold injection process. The company has four different models of molds available

for use. The first mold, x1, produces 15 two-inch heads per pound of alloy; the

second, x2, produces 20 three-inch heads per pound; the third, x3, produces 14

three-inch heads and 40 four-inch heads per pound; and the fourth, x4, produces

10 two-inch heads and 20 four-inch heads per pound. The production manager

wants to determine the optimal production method to minimize the amount of

copper used to meet demand. Formulate the problem as a linear programming

model.

10. For the following constraint set find:

x1 + x2 ≤ 3 (1)

1 ≤ x2 ≤ 2 (2)

x1 ≥ 0 (3)

a. The feasible region on a graph for the constraint set.

b. Label the extreme points.

c. If the less than or equal to constraint of Eq. (1) is changed to a strict equality,

show the feasible region and label the extreme points.

11. Pharma produces two chemicals: A and B. These chemicals are produced via two

manufacturing processes. Process 1 requires 2 hours of labor and 1 lb. of raw

material to produce 2 oz. of A and 1 oz. of B. Process 2 requires 3 hours of labor

and 2 lb. of raw material to produce 3 oz. of A and 2 oz. of B. Sixty hours of labor

and 40 lb. of raw material are available. Chemical A sells for LE 16 per oz. and B

Page 37: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 48 Dr. Emad Elbeltagi

sells for LE 14 per oz. Formulate a linear program that maximizes Pharma's

revenue and solve graphically to find the amount of process 1 and process 2 to be

produced. Hint: Define the amounts of Process 1 and Process 2 used, as your

decision variables.

12. There are two suppliers of pipes with their information as shown below in the

table:

Source Unit cost (LE/m) Supply limit(m)

1

2

100

125

100

unlimited

At least 900 meters of pipe is required. The goal is to minimize the total cost of

pipe.

a. Find the optimum solution.

b. Formulate a mathematical model with the supply of pipe from source No. 2

limited to 700 meters.

c. Does a solution to part b exist? Use the graph to prove your answer.

13. Use the graphical method to solve the following problem;

Minimize z = 15x1 + 45x2

Subject to 2x1 + 3x2 ≥ 24 (1)

x1 ≥ 2x2 (2)

x1 ≥ 5 (3)

and x1 ≥ 0, x2 ≥ 0

It is required to draw the feasible region, and determine the minimum value of z

graphically and the corresponding values of x1 and x2.

14. Solve the following problem using the graphical method. Compute the value of

the objective function and decision variables at optimality, and indicate which

statement best describes the solution: 1) this linear program has a unique optimnal

solution, 2) this linear program has alternate optima, 3) this linear program is

infeasible, or 4) this linear program is unbounded.

Page 38: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 49 Dr. Emad Elbeltagi

Minimize z = - 4x1 - 6x2

Subject to - 4x1 – 5x2 ≤ - 10

- x1 - 4x2 ≥ - 12

- x1 ≥ - 4

x2 ≥ 1

x1, x2 ≥ 0

15. Solve the following problem using the graphical method. Compute the value of

the objective function and decision variables at optimality, and indicate which

statement best describes the solution: 1) this linear program has a unique optimnal

solution, 2) this linear program has alternate optima, 3) this linear program is

infeasible, or 4) this linear program is unbounded.

Minimize z = 10x1 + 4x2

Subject to 5x1 – 6x2 ≤ 30

5x1 +2x2 ≥ 30

x1 ≥ 5

x2 ≥ 2.5

x1, x2 ≥ 0

16. Solve the following problem using the graphical method. Compute the value of

the objective function and decision variables at optimality, and indicate which

statement best describes the solution: 1) this linear program has a unique optimnal

solution, 2) this linear program has alternate optima, 3) this linear program is

infeasible, or 4) this linear program is unbounded.

Maximize z = 24x1 + 20x2

Subject to x1 - x2 ≥ -4

3x1 - 2x2 ≤ 6

x1 + x2 ≥ 5

6x1 + 5x2 ≤ 10

x2 ≤ 6

x1, x2 ≥ 0

Page 39: CHAPTER 2 MODELING WITH LINEAR PROGRAMMINGosp.mans.edu.eg/ELBELTAGI/CB312 Ch2.pdf · CHAPTER 2 MODELING WITH LINEAR PROGRAMMING ... In linear programming modeling, ... Solver is outlined

Operations Research 50 Dr. Emad Elbeltagi

17. A company manufactures two products (A and B) and the profit per unit sold is

LE 3 and LE 5 respectively. Each product has to be assembled on a particular

machine, each unit of product “A” taking 12 minutes of assembly time and each

unit of product “B” takes 25 minutes of assembly time. The company estimates

that the machine used for assembly has an effective working week of only 30

hours. Solve the following problem using the graphical method to determine how

much of each product to produce. Note that, as per the market requirements, every

five units of product A produced at least two units of product B must be produced.

If the company has been offered the chance to hire an extra machine, thereby

doubling the effective assembly time available; what is the maximum amount you

would be prepared to pay (per week) for the hire of this machine and why?

18. Use the graphical method to solve the following problem;

Minimize 4a + 5b + c

Subject to a + b ≥ 11

a - b ≤ 5

c - a - b = 0

7a ≥ 35 - 12b

a ≥ 0; b ≥ 0; c ≥ 0