problem solving & decision making support

175
Memo No (963) An Introduction to Problem Solving & Decision Making using Computer Software (Selected Real World Problems) ﺣﻞ ﺍﻟﻤﺸﺎﻛﻞ) ﺑﺤﻮﺙ ﺍﻟﻌﻤﻠﻴﺎﺕ( ﻭﺩﻋﻢ ﺃﺗﺨﺎﺫ ﺍﻟﻘﺮﺍﺭ ﺑﺄﺳﺘﺨﺪﺍﻡ ﺍﻟﺤﺎﺳﺐTraining Material Dr. Abdalla ElDaoushy February, 2010

Upload: prof-dr-abdalla-eldaoushy

Post on 27-Apr-2015

1.510 views

Category:

Documents


6 download

DESCRIPTION

Problem Solving & Decision Making Support using WinQSB Software

TRANSCRIPT

Page 1: Problem Solving & Decision Making Support

Memo No (963)

An Introduction to Problem Solving & Decision Making

using Computer Software (Selected Real World Problems)

ودعم أتخاذ القرار )بحوث العمليات(حل المشاكل

بأستخدام الحاسب

Training Material

Dr. Abdalla ElDaoushy February, 2010

Page 2: Problem Solving & Decision Making Support

ii

Contents

Section I Page

Introduction . . . . . . . . . I-1 Classification of Problems in Operations Research . . . I-1

Sequencing Problems . . . . . . I-2 Allocation Problems . . . . . . I-8 Routing Problems . . . . . . . I-10 Replacement Problems . . . . . . I-11 Inventory Problem . . . . . . . I-11 Queuing Problems . . . . . . I-11 Competitive Problems . . . . . . I-12 Search Problems . . . . . . . I-12

Section II Mathematical Modeling in Operations Research . . . II-1 Linear Programming Models (LP). . . . . . II-2 Formulation of Linear Programming Models . . . . II-3 Some Examples of LP Models . . . . . . II-4

Diet (Nutrition) Problem . . . . II-4 Television Problem . . . . . II-7 Product Mix Problem . . . . . II-8 Truck Production Problem . . . . II-11 Crop Farm Organization Problem . . . II-13 Machine Scheduling Problem . . . II-16 Petroleum Refining Problem . . . . II-18

Graphical Solution of a LP Models . . . . . II-26 Classification and Properties of Solutions (the way to the Simplex Method) . II-41

Extreme-Point Solutions & Basic Feasible Solutions II-44 An Optimal Solution . . . . . II-54

The Simplex Method . . . . . . . II-58 Integer LP Models --- Examples. . . . . . II-71 Non-LP Models --- Examples . . . . . . II-73 Quadratic Programming Models --- Examples . . . II-74 Integer Quadratic Programming Models --- Examples . . II-75 Goal Programming . . . . . . . . II-76

Page 3: Problem Solving & Decision Making Support

iii

Section III

Network Modeling . . . . . . . . III-1 Manufacturing and Transportation . . . . III-1

The Transportation Problem . . . . . III-2 The Assignment Problem . . . . . III-11 The Minimal Spanning Tree Problem & the Pipeline Networks III-17 Pipeline Networks . . . . . . III-31 Traveling SalesPerson Problem . . . . . III-36

Section IV Dynamic Programming . . . . . . . IV-1 Stagecoach Problem . . . . . . IV-2 Knapsack Problem . . . . . . . IV-10 Production and Inventory Scheduling . . . . IV-18 References . . . . . . . . . IV-20

Section V (Part II)

PERT/CPM (Projects Planning, Managing, and Controlling Using Computer) Needs for Network Analysis . . . . . . V-1 Gantt Charts . . . . . . . . . V-6 PERT/CPM . . . . . . . . . V-10 Project Network . . . . . . . . V-13 Activity loops . . . . . . . . V-14 Project Time analysis . . . . . . . V-18 Critical Path(s) Determination . . . . . . V-23 Workshop . . . . . . . . . V-48 Project Time Crashing . . . . . . . V-66 Project Time Crashing by Linear Programming . . . V-76 References . . . . . . . . . V_90

Page 4: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 1 ElDaoushy

Introduction

Any problem that requires a positive decision to be made can be classified as an Operations Research (OR), Decision Modeling, Problem Solving in Business type problem.

Section I

Classification of Problems in Decision Modeling [3]

Although there is no single classification of problems that are candidates for solution by methods of Decision Modeling (Operations Research), most problems fall into one of the following categories:

1. Sequencing [Machine Scheduling Problem]

2. Allocation [Assignment Problem]

3. Routing [Traveling Salesman Problem]

4. Replacement [Optimal Time to Replace Equipment]

5. Inventory [The Optimum Level of Inventory]

6. Queuing [waiting for a service] في المستشفيات يورش الصيانة، المرض

7. Competitive [Game theory]

8. Search [searching for information that is necessary to make a decision]

Mathematical Models have been structured for each of these categories, and methods for solving the models are available in many cases.

Page 5: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 2 ElDaoushy

Sequencing Problems (Machine Scheduling Problem): Sequencing Problems involve placing items in a certain sequence or order for service. For example, in a job shop, N jobs (requiring different amount of time on different machines) must each be processed on M machines in the same order with no passing between machines. How should the jobs be ordered (scheduled) for processing to minimize the total time (maximize the total profit) to process all of the jobs on all of the machines? The solution is quite simple for the two-machine problem, but more difficult for the general M-machine problem. Example: Job-Shop Problem [3]

10 jobs must be processed through 2 machines each day with no passing (momentary) allowed between machines. That is, a job is placed on machine 1 first and as soon as it is processed it is placed on machine 2 if it is empty; otherwise, it is placed in a waiting line from which jobs are taken and placed on machine 2 on a 1st-come 1st-served basis. Each job requires the amount of time on the two machines as given in the following table:

Job Sequence

Machine 1 Machine 2

1 20 4 2 10 12 3 3 5 4 10 8 5 5 6 6 2 12 7 8 4 8 7 10 9 3 6 10 4 1

Have a look on “Job-Shop” Problem on the Internet………

Page 6: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 3 ElDaoushy

The problem is to determine the sequence in which the jobs should be processed through the two machines in order to minimize the time between the start of the first job on machine 1 and the finish of the last job on machine 2. The following table illustrates the actual flow of jobs through the machines using the current sequence: 1-2-3-4-5-6-7-8-9-10 Job Seq.

Machine 1 Machine 2 Idle time on machine 2

الوقت الضائع Time in

Time out

Time in

Time out

1 0 20 20 24 20 2 20 30 30 42 6 (i.e., 30-24) 3 30 33 42 47 0 4 33 43 47 55 0 5 43 48 55 61 0 6 48 50 61 73 0 7 50 68 73 77 0 8 58 65 77 87 0 9 65 68 87 93 0 10 68 72 93 94 0

From the above table, we see that the idle time on machine 1 is just the time between the finish of job 10 on machine 2 and the finish of job 10 on machine 1 which is 94 – 72 = 22. The idle time on machine 2 is given by: Idle time on machine 2 = time 1st job starts on machine 2 + ∑ (time kth job starts on machine 2) – time (k-1)st job finished on machine 2 = 20 + 6 + 0 + 0 + . . . + 0 = 26

Page 7: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 4 ElDaoushy

We might ask the question, “Is there a sequence which would reduce the total processing time through the two machines?” It can be shown that the procedure of successively placing the job with the smallest processing time as close to the beginning of the sequence as possible if the processing time is on machine 1 and as close to the end of the sequence as possible if it is on machine 2 will yield an optimal sequence if jobs are deleted from consideration after they are assigned a position in the sequence. 1. When all processing times are considered for both machines in the

present example, we see that job 10 has the smallest processing time on machine 2, so job 10 is placed last in the sequence.

2. After job 10 is deleted from consideration, job 6 has the smallest

processing time which is 2 units of time on machine 1. Thus job 6 is placed at the beginning of the sequence.

3. When job 6 is deleted from consideration we see that jobs 3 and 9

both have the smallest processing time (3 units on machine 1). Either of the two jobs can be processed second behind job 6; the other should be processed third.

4. This process of assigning each job a position in the sequence

continues until all jobs are assigned. 5. The final sequences using the above procedure would be:

1. 6-3-9-5-8-2-4-1-7-10 or 2. 6-9-5-5-8-2-4-1-7-10 or 3. 6-3-9-5-8-2-4-7-1-10 or 4. 6-9-3-5-8-2-4-7-1-10

All 4 sequences are optimal in the sense that the total time to process all jobs on the two machines is a minimum among all possible sequences. Hint: WinQSB (Quantitative Software for Business) returns other sequences beside the above ones! ! !

Page 8: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 5 ElDaoushy

The following table illustrates the flow of the jobs through the machines using the first optimal sequence:

6-3-9-5-8-2-4-1-7-10 Job

Machine 1 Machine 2 Idle time on machine 2 Time

in Time out

Time in

Time out

6 0 2 2 14 2 3 2 5 14 19 0 9 5 8 19 25 0 5 8 13 25 31 0 8 13 20 31 41 0 2 20 30 41 53 0 4 30 40 53 61 0 1 40 60 61 65 0 7 60 68 68 72 3

10 68 72 72 73 0 With this sequence, the total elapsed time to process all 10 jobs through the two machines is reduced from 94 to 73 units, a reduction of 22 percent. Likewise, the idle time on machines 1 and 2 has been reduced from 22 to 1(i.e., 73-72) and from 26 to 5(i.e., 2+3) respectively.

Page 9: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 6 ElDaoushy

Solution Using WinQSB S/W (Job Scheduling): To solve this problem, just enter the data as follows:

Number of Jobs to be Scheduled = 10 Number of Machines or Workers = 2 Maximum Number of Operations per Job = 2 Check the box of “All jobs have the same machine/worker sequence”

Press OK Enter the data from the main table on page I-2. Note that:

o Machine 1 the same as Operation 1 o Machine 2 the same as Operation 2

Press “Solve and Analyze / Solve the Problem”. Choose the Method of Solution (many methods available…….) After solving the problem:

o Press “Result Menu” icon and choose:

“Show Job Sequence” “Show Job Schedule” “Show Gantt Chart For Job” “Show Gantt Chart for Machine” . . . . . .

Input Data Job Number Job Name Operation 1 Operation 2

1 Job 1 20 4 2 Job 2 10 12

3 Job 3 3 5 4 Job 4 10 8 5 Job 5 5 6 6 Job 6 2 12 7 Job 7 8 4 8 Job 8 7 10 9 Job 9 3 6 10 Job 10 4 1

Page 10: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 7 ElDaoushy

Output Result: (“Result Menu” icon/ “Show Job Sequence”) CDS Method:

Job Sequence (6, 3, 9, 5, 8, 2, 4, 1, 7, 10) & 73 units of time

Gupta’s Method:

Job Sequence (3, 9, 5, 6, 8, 2, 1, 4, 7, 10) & 73 units of time

Use All Above Heuristic Method:

Job Sequence (3, 9, 6, 5, 8, 2, 1, 4, 7, 10) & 76 units of time

Ho and Chang’s Method:

Job Sequence (6, 3, 9, 5, 8, 2, 4, 1, 7, 10) & 73 units of time

Notice that:

o All different methods gave the same Min. Time of 73 units spent o Do not forget to use “Results/Show Job Sequence” to obtain the

Job Sequence above……

Page 11: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 8 ElDaoushy

Allocation Problems (Assignment Problem): Allocation Problems involve the allocation of resources to activities in such a way that some measure of effectiveness is optimized. For example, if the measure of effectiveness can be represented as a linear function of several variables subject to a number of linear constraints involving the variables, then the allocation problem is classified as a Linear Programming Problem. Likewise, if the resource is people who can each perform any one of several jobs, possibly in different amounts of time, and the measure of effectiveness is the total time to perform all of the jobs when one and only one person is “allocated” to one and only one job, then the problem is classified as an Assignment Problem. Suppose Person A takes 2 minutes to perform Job 1 and 4 minutes to perform Job 2. Likewise, suppose Person B takes 3 and 2 minutes to perform Jobs 1 and 2, respectively.

Job 1 Job 2 Person A 2 4 Person B 3 2

Which person should be assigned to which job to minimize the total time to perform both jobs? Obviously, by inspection or enumeration, Person A should perform Job 1 and Person B should perform Job 2 for a Total Effectiveness of 4. Suppose further that three people and three jobs are involved with the corresponding times given by:

Job 1 Job 2 Job 3 Person A 2 6 3 Person B 8 4 9 Person C 5 7 8

......... العمال في مصنع نسيج :مثال

2!

Page 12: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 9 ElDaoushy

Which Person should perform which Job? If we enumerate all possible assignments (3! = 3*2=6), we have:

Assignments A:1 A:1 A:2 A:2 A:3 A:3 B:2 B:3 B:1 B:3 B:1 B:2 C:3 C:2 C:3 C:1 C:2 C:1

Total Effectiveness

14 18 22 20 18 12

Thus, the minimum total effectiveness (time) is 12 units and is obtained by assigning Person A to Job 3, Person B to Job 2, and Person C to Job 1. These are trivial problems, but suppose 20 People are available to perform 20 2obs. What is the minimum time to perform all Jobs? There are 20! different assignments to be checked. Obviously, some other means of solution must be used.

3!

Page 13: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 10 ElDaoushy

Routing Problems (Traveling SalesPerson Problem): Routing Problems involve finding the optimal route from an origin to a destination when a number of possible routes are available. The classical traveling salesman problem is an example. A salesman wishes to visit each of N cities once and only once before returning to his home office. In what order should he visit the cities to minimize the total overall distance traveled? This problem arises as a subproblem of the vehicle shipment or delivery problem. Once a set of distinct locations have been assigned to a certain truck route in the delivery problem, in what order should the locations be visited to minimize the total distance traveled? The Traveling Salesperson Problem has a very good application in Telecommunication (http://www.rpi.edu/~mitchj/math1900/lp/node5.html John E Mitchell, 2000-04-11) Telecommunications Applications:

Call Routing: Many telephone calls from New York to Los Angeles, from Houston to Atlanta, etc. How should these calls be routed through the telephone network?

Internet Traffic & Network Design: There is currently a great deal of construction of new networks for carrying Internet Traffic. If we need to build extra capacity, which links should we concentrate on? Should we build new Switching Stations?

Page 14: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 11 ElDaoushy

Replacement Problems (Optimum Time to Replace Equipment):

Replacement Problems occur when one must decide the optimal time to replace equipment that get worse immediately. When should an automobile be replaced with a new one? This is a problem faced by most of us today. Of course, we each have our own measure of effectiveness, so there would not be a single optimal answer for everyone even if each automobile gave exactly the same service. Much depends on the purpose of the car, how fast we drive, etc. Another type of replacement problem involves equipment that works perfectly until it fails, such as computer component. What is the optimal replacement policy for this type of equipment?

Inventory Problem (Optimal Level of Inventory): The problem of deciding how much of a certain product to hold in inventory is one of real concern. If a customer requests a certain quantity of the product but it is not available, this could mean a lost sale. On the other hand, if an excess of the product is received in inventory, the money costs associated with inventory may be unacceptable. Hence the Inventory Problem is to determine the level of inventory that will optimize some measure of effectiveness.

Queuing Problems (Waiting for Service): Any problem that involves waiting for a service is classified as a queuing or waiting-line problem.

Page 15: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) I - 12 ElDaoushy

Competitive Problems (Games & Strategies): Competitive Problems arise when two or more people are competing for a valuable resource. Quite often a competitive problem involves request for a contract to perform a service or to obtain some type of privilege. A number of different types of request procedures are used, but in each case, competition is involved. Formal models of realistic problems in this area are scarce; however, the underlying concepts of the decision-making process are worthy of some study.

Search (Information) Problems: Search Problems differ from the other types of problems we have mentioned in that they all involve searching for information that is necessary to make a decision. Some examples are:

o Searching the ocean for enemy ships,

o Auditing books for errors,

o Exploring for valuable natural resources, such as oil, copper, or coal, or

o Retrieving information from computer storage.

In each case, the objective is to minimize the costs associated with collecting and analyzing data to reduce decision errors and to minimize the costs associated with the decision errors themselves.

Page 16: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 1 ElDaoushy

Section II

Mathematical Modeling in Operations Research (OR)

Suppose we want an optimal solution of a given problem. To get at the solution, it is usually more meaningful and convenient to write out the problem in mathematical terms. This mathematical representation of the problem is called a mathematical model of the problem.

Many problems can be represented by a number of different models, but one model is usually more appropriate than others. A number of models with appropriate methods of solutions have become well known. For example, Linear Programming Models, Dynamic Programming Models, Inventory Models, and Queuing Models have solutions readily available. The objective of any OR Project is to determine the most appropriate Mathematical Model for Problem Solving at hand.

Page 17: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 2 ElDaoushy

Linear Programming Models

Linear Programming (LP) is without a doubt one of the most used methods of operations research. Problems from almost every phase of industry have been formulated successfully as LP models. A lot of applications for the Oil and Gas Industry including the initial extraction of the Crude Oil and Gas from the earth, the Determination of the Refinery Operating Schedules, the Determination of the Optimal Product-Mix when blending(merging) Gasoline, and the Final Phase where the Refined Product is delivered to the Customer. We are going to represent some problems of practical situations to show how to arrange the collected information in a tabular form and finally to form the corresponding Mathematical Model. Other applications include the use of LP to Optimize the Mixing of Livestock (farm Animals) Feed, the Transporting of Goods from a number of Plants to a number of Warehouses, the Utilization of Wood in a Forest (Saw Mill for ex), the Production Schedule in many Manufacturing Industries, the Flight Schedule of Airlines, the Assignment of Jobs to People, etc. The list goes on and on. In each case, LP Model involves a linear function of several Variables to be optimized (maximized or minimized) subject to a set of Linear Constraints and non-negativity restrictions on the Variables. Once a problem has been put into LP Model, a procedure (called Simplex Method) can be used to obtain an Optimal Solution. The only real problem is to formulate the given problem as a LP Model.

Page 18: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 3 ElDaoushy

Formulation of Linear Programming Models The general form of each LP model will be as follows: Determine xj for all values of j = 1, 2, . . . .,n which: n

Optimize Z = ∑ cj xj j=1

n

Subject to: ∑ aij xj (*) bi for all values of i =1,.., m j=1

& xj >= 0 where cj is a known “cost/profit” coefficient of xj xj is an unknown variable to be determined, aij is a known constant, bi is a known constant, and (*) means >, >=, <, <=, or =. or, in details: Optimize Z = c1 X1 + c2 X2 + c3 X3 + . . . + cn Xn

s.to:

a11 X1 + a12 X2 + a13 X3 + . . . + a1n Xn (*) b1

a21 X1 + a22 X2 + a23 X3 + . . . + a2n Xn (*) b2

a31 X1 + a32 X2 + a33 X3 + . . . + a3n Xn (*) b3 . . .

Am1 X1 + am2 X2 + am3 X3 + . . . + amn Xn (*) bm & X j >= 0 for all values of j

Page 19: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 4 ElDaoushy

Some Examples of LP Models: Diet (Nutrition) Problem [3, page 69]

• In this time of expensive food prices, every homemaker is faced with the difficult task of providing the family with a well-balanced diet while staying within a realistic budget. Of course, nutrition is only one factor to consider in planning a weekly menu. Suppose for a moment that the homemaker considers the following 6 vegetables to put on this week’s menu to minimize the cost while meeting all nutrient requirements. We assume that vegetables will provide only a fraction of the established minimum daily requirements of each nutrient. The following table summarizes the factors involved.

In addition, cabbage cannot be repeated more than twice during the week, and each other vegetables cannot be repeated more than 4 times during the week. A total number of 14 repetitions are required during the week. How many times should each vegetable be repeated during the next week in order to minimize cost while satisfying the nutrient and taste requirements?

Units of Nutrient per Unit of Weight Cost/ unit of weight

Vegetable Vitamin Iron Phosphorus A C Niacin

Green Beans افاصولي

0.45 10 415 8 0.3 5

Carrots جزر

0.45 28 9065 3 0.35 5

Broccoli 1.05 50 2550 53 0.6 8 Cabbage

كرنب0.4 25 75 27 0.15 2

Beets بنجر

0.5 22 25 5 0.25 6

Potatoes 0.5 75 235 8 0.8 3 Min Weekly Requirements

6 mg 325 mg 17,500 usp 245 mg 5.0 mg

Hint: Repeating implicitly represents Weight……

Page 20: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 5 ElDaoushy

Let X1 = number of times to repeat Green Beans,

X2 = number of times to repeat Carrots, X3 = number of times to repeat Broccoli, X4 = number of times to repeat Cabbage, X5 = number of times to repeat Beets, and X6 = number of times to repeat Potatoes.

To solve this problem, Minimize Z = 5X1 + 5X2 + 8X3 + 2X4 + 6X5 + 3X6

Subject to 0.45X1 + 0.45X2 + 1.05X3 + 0.40X4 + 0.50X5 + 0.50X6 >= 6 10.00X1 + 28.00X2 + 50.00X3 + 25.00X4 + 22.00X5 + 75.00X6 >= 325 415.00X1 + 9065.00X2 + 2550.00X3 + 75.00X4 + 25.00X5 + 235.00X6 >= 17,500 8.00X1 + 3.00X2 + 53.00X3 + 27.00X4 + 5.00X5 + 8.00X6 >= 245 0.30X1 + 0.35X2 + 0.60X3 + 0.15X4 + 0.25X5 + 0.80X6 >= 5 X1 <= 4 X2 <= 4 X3 <= 4 X4 <= 2 X5 <= 4 X6 <= 4 X1 + X2 + X3 + X4 + X5 + X6 = 14 & all Xj >= 0. ; j = 1, 2, 3, 4, 5, 6

12 Constraints

Page 21: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 6 ElDaoushy

Solution Using WinQSB S/W (Linear and Integer Programming):

X1 = 4 X2 = 1.7 X3 = 2.3 real number; must be integer….. X4 = 2 X5 = 0 X6 = 4

& Z = 62.9 Since the values are not all integers, the variables must be restricted to integer values and the problem can be resolved as follows ( by double-clicking on the “Variable Type” in the input data table of the WinQSB) : X1 = 4 X2 = 2 X3 = 4 X4 = 0 !!!! Decision Maker Opinion*

X5 = 4 X6 = 0 !!!! & Z = 86

• You can use the “LowerBound” and “UpperBound” in the input data table of the WinQSB to restrict the values of X4 and X6 above.

• A lot of scenarios are possible……………………………

Page 22: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 7 ElDaoushy

Television Problem [3, page 71]

A Television Manufacture is concerned about how many units of 3 types of Television Sets should be produced during the next time period to maximize profit. Based on past demands, a minimum of 200, 250, and 100 units of types I, II, and III respectively are required. In addition, the Manufacture has a maximum available of 1000 units of time and 2000 unit of raw material during the next time period. The following table gives the essential data. Note that 1.5 units of raw materials and 1.2 units of time are required to produce one Television Set of type II.

Type Raw

Material Time Min. required

no of units Profit

I 1.0 2.0 200 10 II 1.5 1.2 250 14 III 4.0 1.0 100 12 Available 2000 1000

Max. Z = 10X1 +14X2 + 12X3

s.to X1 + 1.5X2 + 4X3 <= 2000 . . .raw materials 2X1 + 1.2X2 + X3 <= 1000 . . .time X1 >= 200 X2 >= 250 X3 >= 100 & all Xj >= 0. Solution Using WinQSB S/W (Linear Programming):

X1 = 200 X2 = 250 X3 = 300

& Z = 9,100

Page 23: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 8 ElDaoushy

Product Mix Problem [1, page 10]

Assume that a Manufacture produces different Products each of which should pass through a number of processes with maximum capacities. The problem is to determine the quantities to be produced from each product in order to maximize the total profit. As an illustration, consider the following example: A furniture company produces 4 models of desks A, B, C, and D. Each desk is first constructed in the carpentry shop, next in the painting shop, and finally in the finishing shop. Suppose that no more than 6000 man hours labor are available in the carpentry shop, no more than 4000 man hours labor are available in the painting shop, and no more than 5000 man hours labor are available in the finishing shop. The man-hour’s labor required for one desk in the 3 shops is given as follows: For one desk of model A : 2, 1, 2 man-hours respectively, For one desk of model B : 3, 2, 2 man-hours respectively, For one desk of model C : 4, 2, 3 man-hours respectively, For one desk of model D : 4, 3, 3 man-hours respectively, The profit from the sale of one desk of model A is 1.2 pounds The profit from the sale of one desk of model B is 2.0 pounds The profit from the sale of one desk of model C is 1.8 pounds The profit from the sale of one desk of model D is 4.0 pounds The above information can be arranged in the following table:

Model Shop

A X1

B X2

C X3

D X4

Capacities

Carpentry 2 3 4 4 6000 Painting 1 2 2 3 4000 Finishing 2 2 3 3 5000 Profit/Unit 1.2 2.0 1.8 4.0

Page 24: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 9 ElDaoushy

Assuming that raw materials and supplies are available and all desks produced can be sold, the furniture company wants to determine the quantities to make of each model of desks that will maximize the total profit. To formulate the LP model to this problem, let:

X1 be the number of desks to be produced from model A X2 be the number of desks to be produced from model B X3 be the number of desks to be produced from model C X4 be the number of desks to be produced from model D

Then, Maximize Z = 1.2 X1 + 2.0 X2 + 1.8 X3 + 4.0 X4 s.to 2.0 X1 + 3.0 X2 + 4.0 X3 + 4.0 X4 <= 6000 X1 + 2.0 X2 + 2.0 X3 + 3.0 X4 <= 4000 2.0 X1 + 2.0 X2 + 3.0 X3 + 3.0 X4 <= 5000 & all Xj >= 0 for all values of j = 1, .., 4 In general, n

Maximize Z = ∑ cj Xj j=1

s.to n

∑ aij Xj <= bi for all values of i =1, . . ., m

j=1

& Xj >= 0.

Page 25: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 10 ElDaoushy

Solution Using WinQSB S/W (Linear and Integer Programming)):

X1 = 0 X2 = 0 Decision Making Problem ! . ! . ! . . X3 = 0 X4 = 1,333.333 Must be integer number ! ! !

& Z = 5,333.334 Hint:

If this is not a desirable solution, add more constraints (or use the “LowerBound” and “UpperBound” beside the “Variable Type” in the WinQSB so that all of desks must be produced but in a different numbers from each type . . .

Page 26: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 11 ElDaoushy

Truck Production Problem [3, page 72]

A Truck Manufacture is capable of producing 5 types of Trucks during a given month. The number of Trucks of each type produced is restricted by the capacity of the various Departments as follows:

1. The Metal Stamping Department cannot handle more than the

equivalent of 10,000 Trucks of all types. The relationship between the types of Trucks for Metal Stamping is given in the following table.

2. The Engine Assembly Department cannot handle more than the

equivalent of 15,000 Trucks of all types. The relationship between the types of Trucks for Engine Assembly is given in the following table.

3. The restrictions on the number of Trucks of each type that can be handled

by the Final Assembly Department are given in the following table.

Type

Final Assembly Constraint

Ratio to type I (Metal Stamping)

Ratio to type I (Engine Assembly)

Profit

I 7500 1.0 1.0 $350 II 5000 1.4 1.6 450 III 1000 2.0 3.0 500 IV 9000 0.8 1.0 300 V 3000 2.2 2.6 400

10,000 15,000

Page 27: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 12 ElDaoushy

If we let Xi be the number of trucks of type i (i = 1, 2, 3, 4, 5) produced during the next month, the LP model can be written as: Max Z = 350X1 + 450X2 + 500X3 + 300X4 + 400X5

s.to

X1 + 1.4X2 + 2.0X3 + 0.8X4 + 2.2X5 <= 10,000 …Stamping X1 + 1.6X2 + 3.0X3 + X4 + 2.6X5 <= 15,000

…Engine Assembly X1 <= 7500 X2 <= 5000 X3 <= 1000 X4 <= 9000 X5 <= 3000 &

all Xi >= 0.

Solution Using WinQSB S/W (Linear Programming):

X1 = 2,800 X2 = 0 X3 = 0 Decision Making Problem* ! . ! , ! . X4 = 9,000 X5 = 0

& Z = 3,680,000.

* Use “LowerBound” & “UpperBound” to restrict the values of zero for X’s; for example, let X2 > 500, X3 > 700, and X5 > 300 and see the result….

Page 28: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 13 ElDaoushy

Crop Farm Organization Problem [1, page 15] [Sondos Project, Sudan]

A certain Farm Organization operates 3 farms 1, 2, and 3 of comparable productivity. The output of each farm is limited by the usable area in feddans and by the amount of water available for irrigation. Area of farm 1 is 40 feddans & water available is 150 feddans-inch. Area of farm 2 is 60 feddans & water available is 180 feddans-inch. Area of farm 3 is 30 feddans & water available is 100 feddans-inch. The Organization is considering 3 crops A, B, and C for planting which differ in their expected profit/feddan and in their consumption of water. For Crop A: the maximum area devoted to this crop is 70 feddans,

Its water consumption is 2 feddan-inch per feddan, and Its profit is 400,000 SD.

For Crop B: the maximum area devoted to this crop is 80 feddans,

Its water consumption is 3feddan-inch per feddan, and Its profit is 300,000 SD.

For Crop C: the maximum area devoted to this crop is 30 feddans, Its water consumption is 1feddan-inch per feddan, and Its profit is 100,000 SD.

Any combination of the Crops may be grown at any of the Farms.

Page 29: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 14 ElDaoushy

The Question is: How much of each Crop should be planted at the respective Farms in order to Maximize the Total Profit?

The above information can be summarized in the following tables:

Crop Farm

A

B

C

Usable Area of each Farm

1 X1A X1B X1C 40 2 X2A X2B X2C 60 3 X3A X3B X3C 30

Max. Area devoted to each Crop

70 80 30

Water Consumption

2 3 1

Crop \ Farm

A

B

C

Water Available in feddan-inch

1 X1A X1B X1C 150 2 X2A X2B X2C 180 3 X3A X3B X3C 100

Profit/Feddan 400,000 300,000 100,000 To formulate the LP model, let: i = 1, 2, 3 denotes the Farms, j = A, B, C denotes the Crops, and Xij = the number of feddans at the ith Farm devoted to the jth Crop.

Page 30: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 15 ElDaoushy

Now, Max Z = 400000*(X1A + X2A + X3A) + 300000*(X1B + X2B + X3B) + 100000*(X1C + X2C + X3C)

. . . from the 2nd table. s.to: X1A + X1B+ X1C <= 40 X2A + X2B+ X2C <= 60 . . . from 1st table X3A + X3B+ X3C <= 30 X1A + X2A+ X3A <= 70 X1B + X2B+ X3B <= 80 . . . from 1st table 9 Variable & 9 Constraints X1C + X2C+ X3C <= 30 2X1A + 3X1B+ X1C <= 150 2X2A + 3X2B+ X2C <= 180 . . . from 2nd table 2X3A +3 X3B+ X3C <= 100 & Xij >= 0; i = 1, 2, 3 j = A, B, C. Solution Using WinQSB S/W (Linear and Integer Programming--- 9 Variables & 9 Constraints): * You can use “Copy/Paste” when entering data…..

X1A = 0 X1B = 40

X2A = 40 X2B = 20 X3A = 30 X3B = 0 X1C = 0 X2C = 0 Decision Making Problem! . ! , ! . X3C = 0 & Z = 46,000,000.00 (Alternate Solutions exists…Results/Obtain Alternate Optimal) Hint: There is a bug in the program especially when you by mistake write alphabets in

the R.H.S. of the table….taken as zeros…

Page 31: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 16 ElDaoushy

Machine Scheduling Problem* [3, page 73] as a LP Problem

A Plant has 4 Machines, each capable of producing 3 types of a Product. The profits per hour when producing the 3 types on the respective Machines are given in the following table:

Profit Table

The production rates per hour of the 4 Machines when producing the 3 types of the Product are given in the following table:

Production rates, Demand, and Available time

Product Type

Machine Demand 1 2 3 4

1 8 2 4 9 700 2 7 6 6 3 500 3 4 8 5 2 400

Available Time

90 75 90 85

The demand for the 3 types during the next month is expected to be 700, 500, and 400 units of types 1, 2, and 3 respectively. The maximum available hours to produce the 3 types during the next production period on the 4 machines are 90, 75, 90, and 85 hours respectively.

*Hint: This problem can be formulated and solved as a Machine Scheduling

Problem. See later . . .

Product Type

Machine 1 2 3 4

1 5 6 4 3 2 5 4 5 4 3 6 7 2 8

Page 32: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 17 ElDaoushy

If we let Xij be the number of hours Machine j should be scheduled to produce Type i for all i and j, the LP Model can be written as:

Max: Z = 5X11 + 6X12 + 4X13 + 3X14

+ 5X21 + 4X22 + 5X23 + 4X24

+ 6X31 + 7X32 + 2X33 + 8X34 s.to: 8X11 + 2X12 + 4X13 + 9X14 = 700

7X21 + 6X22 + 6X23 + 3X24 = 500 …demand constraints 4X31 + 8X32+ 5X33 + 2X34 = 400

X11 + X21 + X31 <= 90

X12 + X22 + X32 <= 75 …hour constraints X13 + X23+ X33 <= 90 X14 + X24+ X34 <= 85

& all Xij >= 0. Solution Using WinQSB S/W (Linear and Integer Programming):

X11 = 70.1190 X12 = 56.1905 X13 = 6.6667 X14 = 0 X21 = 0 X22 = 0 X23 = 83.3333 X24 = 0 X31 = 19.8810 X32 = 18.8095 X33 = 0 X34 = 85.0000

&

Z = 2,062.0240 You can solve this problem as an Integer LP Problem. . .

Page 33: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 18 ElDaoushy

Petroleum Refining Problem [6]

The general purpose of discussion here is to show how one industry (Petroleum Refining) depends upon the Mathematical Programming Techniques rather upon the Traditional Methods of Planning alone for such Economic Planning.

The use of LP, combined with the Sources of Information, hold out the promise of greater forecasting reliability than is otherwise attainable.

Here, a LP Model, as one of the series of Process Analysis that are being developed for the USA Economy is considered [6]

The Model here considers the possibility of substitutions between Alternative Production Processes. The Model provides a more satisfactory allowance for both the substitutability and the complementarity’s effects between the Alternatives.

The success here depends on the progress in the Formulation of the Problem, the Collection of Suitable Data, the Computation Facilities for a Large scale Problem, and the Testing of the Output Results. Anyhow, in this Model, one of the Basic Questions that have been asked is: Using the Refining Equipment and the Raw- and Intermediate-Materials available in USA on January 1st, 1953 --- What Product-Mix Alternatives were possible as between the output of JP-Jet Fuel and the output of other Refinery Products, and how would these Alternatives be affected by a reduction in the Available Capacity of the Refining Equipment?

For this reason, the Model must contain details upon the Manufacture of the Jp-4 Jet Fuel and the other End-Items.

Page 34: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 19 ElDaoushy

Model’s Assumptions

• The Model neglects the fact that the Transportation Resources may be limited, and it neglects the implications (suggestions) of New Investments and of the Inventory Accumulation.

• It was assumed that the reference date for all the calculations is January

1st, 1953. • Both the Equipment Capacities and the Crude Oil Availabilities are taken

to be a datum at the overall maximum rates estimated for January 1st, 1953 --- since the domestic Crude Oil Availability on this date was 7.465 millions of barrels/calendar day --- slightly in excess of the Crude Oil charging capacity of 7.285 millions of barrels. Even ignoring the Possibility of Imports, there would have been enough Domestic Crude Oil to use up the Crude Charging Facilities available within USA.

• All End-Items Specifications are set at the average levels prevailing on

this date. • Of the Petroleum Refinery Inputs other than the Crude Oil, most of the

Items are taken to be available at the average rate prevailing between July 1st, 1952 and June 30, 1953. All other inputs (labor, electric power, and sulpheric acid) are considered to be non-limited and are excluded from the Investigation.

• Just 25 categories of Crude Oil are considered --- despite the fact that

there are over 300 distinct fields within USA. • Refining Equipment Types are distinguished by general categories not by

particular ones.

Page 35: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 20 ElDaoushy

The Model Statement Using the Refining Equipment and Raw- and Intermediate-Materials available in USA in January 1st, 1953 and knowing that the Resource Availability to the Industry will be known, and the Demand for Products established, or capable of being predicted with reasonable accuracy, then: Maximize the Objective Function f(X) ,the Product-Mix, subject to producing a specified quantities of Jp-4 Jet fuel, where the Production Requirements for the Jet-fuel is varied by means of the corresponding parameter Qi (see later), under the following and prevailing constraints: 1. The Equipment Capacity Constraints:

They contain 10 inequalities which ensure that no program will call more Refining Equipment of any type than is available within USA Economy.

2. The Raw- and Intermediate-Materials:

They contain 29 inequalities which ensure that no program will exceed the net initial availabilities of Crude Oil and other Intermediate Materials.

3. The Refinery Gases and Straight-Run Streams Constraints:

They contain 18 equations 4. The Covered Streams Constraints:

They contain 22 equations 5. The End-Item Requirements Constraints:

They contain 17 equations 6. The Gasoline and Jet-Fuel Specifications Constraints:

They contain 9 inequalities which constraints all the Gasoline and Jet-Fuel Blends to fall within acceptable specification limits.

Page 36: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 21 ElDaoushy

The Model’s Formulation

By suitable formulation, all the relationships can be expressed in a Linear Form. For a Single Refinery, 100-200 linear equations are generally necessary to deal with the processing and blending relationships and for meeting the quantity and quality requirements of the Products.

Now, the Model can be represented as follows:

Maximize Z = ∑ Cj Xj

j=1 s.to: n

∑ Aij Xj <= Qi for all values of i =1, . . ., m

j=1

& Xj >= 0.

where

Xj : represents the Product-Mix Variables. There are 205 different Variables in the Model. They can be grouped into the following 11 groups: 1. Atmospheric Crude Distillation (refinement), 2. Gas Conversion, 3. Naphtha Reforming, 4. Cracking, 5. Heavy Ends Processing, 6. Heat Production, 7. Capacity Shifting, 8. Aviation Gasoline Blending, 9. Motor Gasoline Blending, 10. Jp-4 Jet Fuel Blending, and 11. Fuel Oil Blending.

Page 37: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 22 ElDaoushy

Cj : represents the coefficients of the objective function. They represent the level of the output of one unit of the product-mix items which, expect for the Jet fuel, are proportional to the actual 1952-53 output of these

items. For example, per one barrel of standard product-mix, there are 0.13567 barrel of premium (finest) grade motor gasoline, and 0.31350 barrel of regular, etc. These proportions are identical with the 1952-53 measures of premium (finest) and regular grade gasoline to the total volumetric output of all refinery products other than the Jp-4 Jet fuel.

Aij : the main matrix in this Model. This matrix can be divided into 11 sub- matrices so that the whole matrix consists of 105 * 205 elements.

Qi : the constants on the right-hand-side which represent the net initial availabilities at each process of the Crude Oil Refining Industry.

Page 38: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 23 ElDaoushy

Within this Model, there are numerous possibilities for varying the Product-Mix. The key points of choices are to be made according to the three main stages in the Refining Process: 1. The Primary Crude Distillation (refinement), 2. The conversion of straight-run streams into Blending Stocks, 3. The Blending of the End-Items.

At the primary distillation stage, there is a choice of how much of each type of Crude is to be used. Once this selection is performed, the quantities of each type of straight-run material (Gases, Naphtha, Gas Oil’s and Residuum) become determined. At the conversion step (cracking, refining, alkylation’s, etc), there are choices as to how much of the straight-run materials will be send directly to blending, how much to the individual types of conversion units, and how much of the converted materials sent in turn of other units. At the blending stage, there is a considerable freedom in the selection of components for any particular end-item. In addition to these options, there are choices as to the mode of operation of individual units --- variations in the recycle ratios for cracking and in the severity for reforming operations. No allowance is made for the possibilities of manufacturing the pressure or space velocity on individual units. The production requirement for jet-fuel is varied by means of the corresponding parameter Qi . Also, the only revisions required for changing the product-mix would be in the coefficient matrix Aij .

Page 39: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 24 ElDaoushy

Comments:

It is clear that it is no easy task to construct a Mathematical Model. The Formulation of the Problem, the Collection of Data, and the Numerical Analysis are examples of cumbersome.

LP, as one of the Mathematical Programming Models, provides a tool for dealing with such problems. LP allows both the possibility that a single item may be processed by more than one process, and the possibility that a single process may produce more than one item. But this is not to say that LP represents the best of all possible methods for computing numerical answers to optimization problems.

Anyhow, the implementation of Mathematical Programming Models in general is not a routine mechanical procedure. Without close association between the Model-Constructor, the Data-Collector, and the Numerical Analyst, there is little hope for success. خاصة، المشكلة المطروحة

The Model here represents no more than a modest attempt to demonstrate the feasibility of constructing a Mathematical Programming Model for an Industry or a single Sector of the National Economy.

By the way, we will state here the experience observed over the last 40 years in Egypt which assures the relying of the country upon the Mathematical Programming Models in its economic planning: In the Institute of the National Planning, Cairo, a study [5] on the Crude Oil was conducted 1n 1960 in order to find the optimum exporting of both Crude Oil and Final Products. The problem was formulated as an LP Model with about 60 rows and 200 columns. It was solved for both Optimality Criteria.

Page 40: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 25 ElDaoushy

Another study for the Petroleum Products were conducted in 1971 with the cooperation of the Egyptian General Petroleum Corporation and the Ministry of Transport. It was required to decide on the overall plan of Transshipping Petroleum Products from 3 Refineries to over 200 Consumption Centers through 20 major Distribution Centers scattered all over the Country. Four Modes of Transport were available, capacities on each route and cost of transport by each mode were known. The Capacities of the Refineries and Distribution Centers were to be observed in formulating the Model. The problem is a capacitated, multimode Transshipment Problem. It was formulated as a LP Model with over 160 rows and 450 columns. Preliminary results of implementation indicated that about $1.5 million savings and considerable changes were introduced in the logistics system of Petroleum Transportation; as a result some spare capacity was directed to service other Sectors of the Economy [5].

Page 41: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 26 ElDaoushy

Graphical Solution of LP Models [1]

We know that a Linear Programming Model consists of three parts:

(i) An objective function (linear) to be maximized or minimized. (ii) A system of linear constraints in the form of inequalities of the

type ≤ , ≥ , = , or a mixture of these types. (iii) Non-negativity constraints of the from Xj ≥ 0.

Hence to solve a LP problem by a graphical method, we need to represent each of the above three parts on the same graph. This can be easily shown in a two-dimensional space. To do this, let us take a simple linear pro-gramming problem involving only two variables (i.e. two unknowns).

Example 1:

Determine the value of X1, X2 that maximize the objective function

f(X) = 3X1 + 5X2

s.to:

X1 ≤ 4

X2 ≤ 6

3X1 + 2X2 ≤ 18

& X1 ≥ 0, X2 ≥ 0

Let us start with the non-negativity constraints

Take X1 > 0

This represents the area to the right of X2–axis as shown in Fig.(1). All the points (X1, X2) lying in the shaded area and on the X2–axis satisfy the constraint X1 > 0.

0

X2

X1 Fig.(1)

Page 42: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 27 ElDaoushy

Take X2 > 0

Similarly all the points (X1, X2) lying in the shaded area and on X1–axis in Fig.(2) satisfy the constraint X2 >0 .

Now if we take the two constraints X1 > 0, X2 > 0 together we get the shaded area as in Fig.(3). All the points lying in this area, on the X1–axis, on the X2–axis satisfy the above two non-negativity constraints.

Next let us consider the structural con-straints:

Take X1 ≤ 4

This represents the area to the left of the straight line X1 = 4 as shown in Fig.(4). All the points (X1, X2) lying in the shaded area and on the straight line X1 = 4 satisfy the constraint X1 ≤ 4.

Take X2 ≤ 6

Similarly all the points (X1, X2) lying in the shaded area and on the straight line X2 = 6 in Fig.(5) satisfy the constraint X2 ≤ 6

0

X2

X1 Fig.(2)

0

X2

X1 Fig.(3)

0

X2

X1

Fig.(4)

0

X2

X1 fig. (5)

0

X2

X1 Fig.(5)

Page 43: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 28 ElDaoushy

Take 3X1 + 2X2 ≤ 18.

The straight line 3X1 + 2X2 = 18 divide the plane into two parts. The inequality 3X1 + 2X2 < 18 represents that part con-taining the origin as shown in Fig.(6) 0F

*. All the points (X1, X2) on the straight line 3X1 + 2X2 = 18 satisfy the above constraint.

If we add the structural constraints and the non-negativity constraints in one graph we get the shaded polygon o a b c d Fig.(7). All points lying inside this poly-gon and on the boundary side satisfy the structural and non-negativity constraints.

In other words these points satisfy:

X1 ≤ 4 X2 ≤ 6

3X1 + 2X2 ≤ 18

& X1 ≥ 0 , X2 ≥ 0 .

All such points form what we call the set of feasible solution for the giv-en example. This set contains an infinite number of solutions.

The points: o ≡ (X1 = 0, X2=0) , a ≡ (X1 = 4, X2=0)

b ≡ (X1 = 4, X2=3), c ≡ ( X1 = 2, X2=6)

d ≡ (X1 = 0, X2=6)

are the corners of the polygon o a b c d and are called the extreme-point solutions.

* ( The other part of the plane is represented by 3X1 + 2X2 > 18 )

Fig.(7) X1

X2

d c

b

a o

0

X2

X1

Fig.(6)

Page 44: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 29 ElDaoushy

Finally, let us consider the objective function

The question is: which particular solution(s) will maximize the objec-tive function:

f(X) = 3X1 + 5X2 ?

To answer this question by the graphical method, it is clear that the ob-jective function (not an equation) cannot be drawn on a graph. But, fortu-nately what we need is not the graphical representation of the function but the direction of change in its values as it moves passing through the feas-ible solutions. Hence, the question becomes:

" How is the objective function going to move? "

The answer to this question depends on the following rule:

The perpendicular distance from the origin to

f(X) = c1 X1 + c2 X2

is proportional to the value of the function f(X) by a factor k. The value of k depends on the coefficients C1 and C2 and therefore is a constant for any given function.

f(X) = 3X1 + 5X2 represents a family of parallel straight lines. To find the direction of this function, let us assume arbitrarily that f(X) = 0. Then, f(X) = 3X1 + 5X2 = 0 can be represented graphically by a straight line passing through the origin say fg as in Fig.(8).

X2

g

f

Fig.(8)

X1

X2 d c

b

a o

Page 45: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 30 ElDaoushy

According to the above rules, as the line fg is shifted to the upper right parallel to itself, the value of the function increases. Thus the straight line fg is moved parallel to itself until it breaks away from the polygon. The last point of contact between the line and the polygon gives the maxi-mum value of the function and therefore it represents the optimal solu-tion .

In Fig.(8), the optimal solution is represented by the extreme point

c = (X1 =2, X2 = 6). Substituting in the objective function we get its maximum value:

f(X) = 3X1 + 5X2 = 3 (2) + 5 (6) = 36 .

We can summarize the main concept introduced here in the following definitions:

(1) The set of feasible solution for a system of structural and non-negativity constraints is the solutions that satisfy all these con-straints.

(2) The extreme-point solution is the point of intersection of any two constraints that satisfies the remaining constraints (in the case of two dimensions).

(3) The optimal solution is an extreme-point solution which max-imizes or minimizes the objective function.

Page 46: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 31 ElDaoushy

Example 2: Determine the value of X1, X2 that minimizes the objective function

f(X) = 3X1 – X2 s.to X1 + X2 ≥ 3 X1 – X2 ≤ 1 X2 ≤ 2

& X1 ≥ 0, X2 ≥ 0

The non-negativity constraints X1 ≥ 0, X2 ≥ 0 identify the positive qua-drant of the plane.

The structural constraints and the non-negativity constraints are represented by the area inside the triangle abc and all the points lying on its boundaries are shown in Fig.(9) . This is the set of feasible solutions. The extreme-point solutions are represented by the points:

a ≡ ( X1 = 1, X2 = 2)

b ≡ ( X1 = 2, X2 = 1)

c ≡ ( X1 = 3, X2 = 2)

X2

f

b

a

o

c g a

Fig.(9) X1

Page 47: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 32 ElDaoushy

If we assume arbitrarily that f(X) = 0, then 3X1 – X2 = 0 is represented graphically by the straight line fg passing through the origin.

Let fg move to the right parallel to itself, then the first point of contact between fg and the triangle abc will give the minimum value of the ob-jective function and therefore represent the optimum solution. This point is a ≡ (X1 = 1, X2 = 2) and the corresponding value of the objective function is:

f(X) = 3X1 – X2 = 3*1 – 2 = 1

which is the minimum possible value of f(X)

Remark: If in example 2, the problem is to maximize f(X) instead of minimizing it, then fg will move to the right parallel to itself and the last point of the contact between fg and the triangle abc will represent the op-timal solution. This point is:

c ≡ (X1 = 3, X2 = 3) and the corresponding value of the objective func-tion is:

f(X) = 3*3 – 2 = 7

which is the maximum value of f(X)

Page 48: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 33 ElDaoushy

Example 3:

Determine the value of X1 , X2 that maximizes:

f(X) = 4X1 – 2X2 s.to -X1 + X2 ≥ -6

X1 – 4X2 ≤ 2 X1 – 2X2 ≥ -4

& X1 ≥ 0 , X2 ≥ 0

In this example we find that some of the constraints on the right hand side of the structural constraints are negative. To follow the same proce-dure as in the above example, both sides of the constraints should be mul-tiplied by -1 and the inequality should be changed from ≤ to ≥ and from ≥ to ≤. For example the structural constraints:

- X1 + X2 ≥ -6 and X1 – 2X2 ≥ -4 become:

X1 – X2 ≤ 6 and - X1 + X2 ≤ 4

Thus the problem can be rewritten as: Determine X1, X2 that maximize:

f(X) = 4X1 – 2X2 s.to

X1 – X2 ≤ 6 X1 – 4X2 ≤ 2 -X1 + 2X2 ≤ 4

& X1 ≥ 4 , X2 ≥ 0

The set of feasible solutions is represented by the polygon oabcd and the direction of the objective function is represented by fg as shown in Fig.(10).

Page 49: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 34 ElDaoushy

Fig.(10)

If fg is shifted parallel to itself, the last point of contact with the polygon oabcd is the point c. Thus the optimal solution is X1 = 16, X2 = 10 and the corresponding value of the objective function f(X) = 4*16-2*10 = 44

X1 a o

f

b d

X2

g

c

Page 50: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 35 ElDaoushy

Example 4: Determine X1 and X2 that maximize the objective function

f(x) = 3X1 + 2X2

s.to X1 ≤ 4 X2 ≤ 6 3X1 + 2X2 ≤ 18

& X1 ≥ 0 X2 ≥ 0

In this example the polygon oabcd represents the set of feasible solutions and the objective function has the same slope as third structural con-straint. Then fg will be parallel to bc. Hence, on shifting fg parallel to it-self, it will coincide with bc. Consequently any point on the boundary line bc will be an optimal solution with the same maximum value for the objective function. In such case we have multiple solutions. In other words the optimal solutions are :

b = (X1 = 4 , X2 = 3) ,

c = (X1 = 2 , X2 = 6) ,

and any point lying on bc between b & c. The value of the objective function will be 18 at all these points.

Note: In usual two-dimension linear programming problems, the set of feasible solutions takes the form of a polygon as shown in the previous examples. However, in some cases this set may take other forms. This will be shown in the following examples.

a

g

o

c

f X1

X2

b

d

Fig.(11)

Page 51: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 36 ElDaoushy

Example 5: Determine X1 and X2 that minimize:

f(X) = 2X1 + X2

s.to

3X1 + 2X2 ≤ 12

X1 + X2 = 5

& X1 ≥ 0, X2 ≥ 0.

The set of feasible solutions in this example will be all the points lying on the segment ce and the extreme-point solutions are represented by the points c & e.

If fg – the direction of the objective function – is shifted parallel to itself, it will first meet ce at the point c.

Thus the point c ≡ (X1 = 0, X2 = 5) gives the optimal solution and the value of the objective function at this point is f(X) = 2*0 + 5 = 5

e

c

g

f o X1

Fig.(12)

b

X2

f a d

Page 52: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 37 ElDaoushy

Example 6:

Determine X1 and X2 that maximize:

f(X) = 6X1 + 4X2

s.to

X1 + 2X2 = 8

2X1 + X2 = 10

X1 = 4

& X1 ≥ 0, X2 ≥ 0.

The point a ≡ (X 1 = 4, X2 = 2) is the only point which satisfies all the structural and non negativity constraints. It is the only feasible solution. Thus it is the optimal solution, and the value of the objective function at this point is

f(X) = 6*4 + 4*2 = 32 (unique solution)

a

X2

g

o f Fig.(13) X1

Page 53: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 38 ElDaoushy

Example 7:

Determine X1 and X2 that minimize:

f(X) = X1 + 4X2

s.to

X1 + X2 ≥ 4

X1 - 2X2 ≤ 2

2X1 - X2 ≥ 4

& X1 ≥ 0, X2 ≥ 0.

If fg – the direction of the objective function – is shifted parallel to itself, it will first touch the shaded area at point b ≡ (X1 = 10/3 , X2 = 2/3). Thus the optimal solution is (X1 = 10/3 , X2 = 2/3 ) and the value of the objec-tive function at this point is:

f(X) = 10/3 + 4 *2/3 = 6

Note:

If in this example, the problem is to maximize f(X) instead of minimizing, the last point where fg touches the shaded area does not exist and thus the solution is unbounded.

X1

a b

g o

f

X2

Fig.(14)

Page 54: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 39 ElDaoushy

Example 8: A toy manufacturer makes two types of plastic model boats A & B. Each of these types must pass through two processes I & II. One boat of type A needs 2 hrs. in process I & 2 hrs. in process II. One boat of type B needs 1 hr. in process I and 3hrs. in process II. The working hours in process I cannot exceed 20 hrs. and in process II cannot exceed 30 hrs. If the profit per unit of type A is 10 and that of type B is 20, find the optim-al mix product using the graphical method.

The above information can be arranged in the following table :

Models

Process A B

Available hours

I 2 1 20 II 2 3 30

Profit / Unit 10 20

Let X1 denote the amount to be produced of type A

X2 denote the amount to be produced of type B

Then the problem becomes: To determine X1 and X2 that maximize:

f(X) = 10X1 + 20X2 s.to

2X1 + X2 ≤ 20

2X1 + 3X2 ≤ 30

& X1 ≥ 0, X2 ≥ 0.

o

c

a

b

g

f

X2

X1

Fig.(15)

Page 55: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 40 ElDaoushy

The optimal solution is X1 = 7.5

X2 = 5.0

and the corresponding value of the objective function is

f(X) = 10*7.5 + 20*5.0 = 175

Notice that the variables must be of integer values. Solve this problem with variables of integer values.

Remark:

The graphical method for solving linear programming problem is limited to the cases where there are three or less variables. However the solution by the graphical method gives an intuitive sight into the fact that the Linear Programming Problems usually have:

(i) An infinite number of solutions that satisfy the structural and non-negativity constraints. They form a polygon which is called the set of feasible solutions.

(ii) Among the feasible solutions there is a finite number of solutions which are the points of intersection of any two constraints satis-fying the rest of the constraints. These are called extreme-point solutions.

(iii) Of these extreme-point solutions, the particular solution(s) that optimizes (maximizes or minimizes) the objective function is called the optimal solution(s)

Page 56: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 41 ElDaoushy

Classification and Properties of Solutions (the way to the Simplex Method) [1] From the examples given in the last section, we have seen that a LP prob-lem consists of two parts:

(i) Finding the solutions that satisfy the constraints, and

(ii) Selecting from these solutions the one (or more) that optimizes the objective function.

Also, we noticed that the optimal solution is always one of the extreme-point solutions. Thus, we need to distinguish between the three types of solutions that arise in a LP problem namely:

(a) Feasible solutions,

(b) Extreme-point solutions (or basic feasible solutions), and

(c) Optimal solutions.

In the following sections we are going to discuss each type in some detail.

Feasible Solutions

A feasible solution is defined as the values of the decision variables that satisfy both the structural and non-negativity constraints. Mathematically, it is the values of Xj that satisfy the structural constraints:

ij

n

jij bxa ≤∑

=1 ; i = 1,2,......,m

and the non-negativity constraints Xj ≥ 0 ; j = 1,2,........,n.

These feasible solutions are infinite in number.

The most significant property of these solutions is that they from a con-vex set. In other words, the structural and the non-negativity constraints form a convex polygon.

Page 57: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 42 ElDaoushy

Consider as an example, the following constraints: X1 ≤ 4 X2 ≤ 6

3X1 + 2X2 ≤ 18

and X1 ≥ 0, X2 ≥ 0.

These are represented graphically by the polygon oabcd in Fig.(1) . If we take any two points inside this poly-gon as g, h, then the line segment gh lies entirely inside the polygon. In other words any point lying on the segment gh will lie inside the poly-gon. Thus oabcd is a convex poly-gon.

g

As an example of a non-convex polygon is the star- shaped area in Fig.(2). If we choose any two points inside it g & h, it is not necessary that the line segment gh will lie totally inside the area.

Now the above property can be restated as follows:

"For a given LP problem, if two points g,h (as in Fig.(1) ) represent two feasible solutions, then any convex combination of them will also represent a feasible solution”

X2 d

a

h

o X1 Fig.(1)

c

g

h

Fig(2)

b

Page 58: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 43 ElDaoushy

It can be easily shown that this property is satisfied in the two-dimensional case (where we have X1 and X2 only). It can be provided easily in the general case where there are n variables and m constraints. We will write the structural and the non-negativity constraints in a matrix form as follows

A X ≤ P0

& X ≥ 0

where

a11 a12 ... a1n X1 b1 0

a21 a22 ... a2n X2 b2 0

A= . . ... . , X = . , P0 = . , O = .

. . ... . . . .

. . ... . . . . am1 am2 ... amn Xn bm 0

For more details, refer to [1]

Page 59: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 44 ElDaoushy

Extreme-Point Solutions & Basic Feasible Solutions

(a) Extreme-point Solutions

Definition An extreme-point of a convex set is a point of the set which cannot be expressed as a convex combination of another two points in the set.

To determine the extreme-point solutions there are two approaches:

The First Approach

Let us consider again the constraints X1 ≤ 4 X2 ≤ 6

X1 + 2X2 ≤ 18

& X1 ≥ 0, X2 ≥ 0.

The corner points of the polygon oabcd are clearly the extreme-points of the convex set represented by the shaded area. None of the points o, a, b, c, d, lie on the line segments join-ing two other points in the set. There-fore none of them can be expressed as a convex combination of any other two points in the set.

These points are actually the intersection of two adjacent sides of the po-lygon. For example the point "o" is the intersection of the two lines X1 = 0, X2 = 0 which are the limiting forms (equality parts) of the in-equalities X1 ≥ 0 , X2 ≥ 0 . Also the point "a" is the intersection of the two lines X2 = 0 and x1 = 4.

Thus, it can be suggested that the extreme-points of the convex (defined by linear inequalities) are the intersections of pairs of lines in a two-

X2

f

b

e o a X1

Fig.(3)

c

g

d

Page 60: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 45 ElDaoushy

dimensional space and the intersection of sets of three planes in a three-dimensional space and so on.

It should be noticed that the converse is not true, i.e. the points of the in-tersection of two adjacent sides (in a two-dimensional space) is not ne-cessary an extreme-points, because it may not satisfy all the other con-straints. For instance, the points g, f, and e in our example (Fig.(3)) are not extreme points.

Consequently, the procedure for determining the extreme-points (taking the simple case of two variables) can be summarized as fol-lows:

1- Write all constraints in an equality form (by ignoring the inequality sign).

2- Solve simultaneously two equations at a time in all combinations.

3- Check each solution to see whether it satisfies the original set of con-straints. If it does, then it is an extreme-point solution, otherwise, it is not.

This approach can be generalized and applied to a LP problem with n va-riables & m structural constraints, where the total number of constraints, including the non-negativity constraints, is m + n. An extreme-point solu-tion in this case is the solution of each n simultaneous constraints taken as equations, if this solution satisfies all other constraints.

Therefore, we need to check every solution against all the constraints not used in reaching this solution.

Page 61: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 46 ElDaoushy

The 2nd Approach In this approach, we think of a procedure where we get the solution and automatically check whether all the constraints are satisfied. This can be done by converting the structural constraints into equations instead of neglecting the inequality sign. Any constraint of type ≤ can be con-verted into an equation by adding to its left hand side a non-negative quantity.

As an illustration take the same problem where the constraints are: X1 ≤ 4 (1) X2 ≤ 6 (2)

3X1 + 2X2 ≤ 18 (3)

& X1 ≥ 0, X2 ≥ 0. (4)

The structural constraints can be converted into equations by adding to their left hand sides the quantities X3, X4, X5 (called the slack variables) respectively. Thus these constraints become:

X1 + X3 = 4 (5) X2 + X4 = 6 (6)

3X1 + 2X2 + X5 = 18 (7)

Each of the quantities X3, X4, X5 being positive implies that the left hand side of each constraint is less than the right hand side. Each of these quantities being zero means that the left hand side of each con-straint is equal to the right hand side. But, each quantity being nega-tive implies that the left hand side is greater than the right hand side which contradicts the original form of the constraints. In other words, this last case indicates the violation of the constraints. Conse-quently the quantities X3, X4 and X5 should be non-negative,

That is: X3 ≥ 0, X4 ≥ 0 and X5 ≥ 0 .

Page 62: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 47 ElDaoushy

Accordingly, we come to the following two important remarks:

(i) Any violation of a structural constraint will happen if the asso-ciated slack variable has a negative value.

(ii) The use of any structural constraint to determine an extreme-point solution should be associated with the fact that its corres-ponding slack variable is zero.

As an illustration:

Consider the above two constraints: X1 ≤ 4 (1) X2 ≤ 6 (2)

These two constraints are converted to equations (5), (6) by adding the slack variables X3 , X4. According to the second remark take X3 = 0,

X4 = 0 and then substitute in (5), (6), (7) above, we get:

X1 = 4, X2 = 6, X5 = -6

The solution is: X3 = 0, X4 = 0

& X1 = 4, X2 = 6, X5 = -6

But X5 being negative indicates the violation of the third constraints 3X1 + 2X2 ≤ 18. Therefore this solution is not an extreme-point solution.

Also, consider the above two constraints:

X1 ≤ 4 (1)

3X1 + 2X2 ≤ 18 (3)

These two constraints are converted to the equations (5) & (7) by adding the slack variables X3, X5. Take X3 = 0, X5 = 0 and then substitute in (5) , (6) (7), we get

X1 = 4, X2 = 3, X4 = 3.

The solution is X3 = 0, X5 = 0

& X1 = 4, X2 = 3, X4 = 3

Page 63: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 48 ElDaoushy

None of these values is negative, therefore this solution is an extreme-point solution.

Consider

X1 ≥ 0

X2 ≥ 0

Take X1=0, X2=0 and substitute in (5), (6), (7) we have X3=4, X4 =6, X5 =18.

The solution is: X1 = 0, X2 = 0 & X3 = 4, X4 = 6, X5 = 18 which is an extreme-point solution

Page 64: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 49 ElDaoushy

Repeating this for all the possible cases we find that:

X1 = 0, X2 = 0 X2 = 0 , X3 = 0

o ≡ a ≡ X3 = 4, X4 = 6 , X5 = 16 X1 = 4 , X4 = 6 , X5 = 6 X3 = 0, X5 = 0 X4 = 0 , X5 = 0

b ≡ c ≡ X3 = 4, X2 = 3 , X4 = 3 X1 = 2 , X2 = 6 , X3 = 2 X1 = 0, X4 = 0

d ≡ X2 = 6, X3 = 4, X5 = 6

are the extreme-point solutions.

In general, consider the following system of m constrains in n variable

a11X1 + a12X2 + ... + a1nXn ≤ b1

a21X1 + a22X2 + ... + a2nXn ≤ b2

. . ... . .

. . ... . .

. . ... . .

am1X1 + am2X2 + ... + amnXn ≤ bm

& Xj ≥ 0 , j = 1,2 , ...,n

Page 65: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 50 ElDaoushy

These constraints can be converted into equations by adding the slack va-riables

Xn+1 , Xn+2 , ... ¸ Xn+m

as follows: a11X1 + a12X2 + ... + a1nXn + Xn+1 = b1 a21X1 + a22X2 + ... + a2nXn + Xn+2 = b2 . . ... . . . . . ... . . . am1X1 + am2X2 + ... + amnXn + . . + Xn+m = bm & Xj ≥ 0 , j = 1,2 , ...,n , n+1 , ... , n+m An extreme-point solution is simply the result of solving a simultane-ous of m equations in m variables.

Page 66: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 51 ElDaoushy

(b) A Basic Feasible Solution First of ll, what is a basic solution? Given m linearly independent equations in n variables where n > m, then a basic solution is that one obtained by setting (n-m) variables equal to zero and then solving for the remaining m variables. In other words, if:

a11X1 + a12X2 + ... + a1nXn ≤ b1 a21X1 + a22X2 + ... + a2nXn ≤ b2 . . ... . . . . ... . . . . ... . . am1X1 + am2X2 + ... + amnXn ≤ bm then, a basic solution (X1, X2 , ... , Xn ) to these equation is any solution which satisfies: (i) No more than m variables are non-zeros (i.e. at least n-m va-

riables are zeros) (ii) The solution in terms of non-zero variables is unique (since n-m

variables are zeros, then we are left with m variables in m equa-tions)

The m variables are referred to as basic variables (the dependent varia-ble) while the n-m variables are referred to as non-basic variables (or the independent variables). Now, a basic feasible solution is a basic solution which is also feasible i.e. where all the m variables are non-negative ( ≥ 0 ). Also, we recall from the procedure of the second approach for determin-ing the extreme-point solution that it is consistent with the definition of the basic feasible solution. Thus a basic feasible solution is an extreme-point solution.

Page 67: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 52 ElDaoushy

As an illustration, take the same problem where the constraints are X1 ≤ 4 X2 ≤ 6

3X1 + 2X2 ≤ 18

& X1 ≥ 0, X2 ≥ 0. The structural constraints are converted to equations by adding the slack variables X3, X4 and X5 as given by (5) , (6) and (7) before.

Consider X1 ≥ 0, X2 ≥ 0.

Let X1 = 0, X2 = 0 and substitute in (5), (6) and (7) on previous pages, we get X3 = 4 , X4 = 6, X5 = 18. In this solution: X1, X2 are the non-basic or the independent variables & X3, X4, X5 are the basic or de-pendent variables. This is a basic feasible solution and is represented by the point "o" Fig.(3).

Similarly, if we let X3 = 0, X2 = 0 and substitute in (5) , (6) and (7). We get: X1 = 4, X4 = 6, X5 = 6.

In this solution:

X2 & X3 are the non-basic variables.

X1, X4, and X5 are the basic variables.

This is a basic feasible solution and is represented by the point "a" Fig.(3). But, if we let X5 =0, X1 = 0 and substitute in (5) , (6) and (7) , we get:

X2 = 9, X3 = 4, X4 = -3.

In this solution:

X1 and X5 are the non-basic variables

X2 , X3 and X4 are the basic variables

This is also a basic solution and is represented by the point "g" Fig(3). But it is not feasible since X4 is negative.

Page 68: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 53 ElDaoushy

In the same way, we can show that each of the points "e" and "f" represents a basic solution which is not feasible while each of the points "b", "c" represents a basic solution.

Thus the basic feasible solutions are:

Non-basic Variables Basic Variables

o X1 = 0 , X2 = 0 X3 = 4 , X4 = 6, X5 = 18

a X2 = 0 , X3 = 0 X1 = 4 , X4 = 6, X5 = 6

b X3 = 0 , X5 = 0 X1 = 4 , X2 = 3, X4 = 3

c X4 = 0 , X5 = 0 X1 = 2 , X2 = 6, X3 = 2

d X1 = 0 , X4 = 0 X2 = 6 , X3 = 4, X5 = 6

Page 69: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 54 ElDaoushy

Remarks:

(1) The solution where the slack variables are selected as basic va-riables is called an initial basic feasible solution.

In our example this is represented by the origin "o".

(2) When we try to get one basic feasible solution from another, one of the basic variables becomes non-basic.

For example going from "o" to "a", the non-basic variable X1 becomes basic and X3 becomes non-basic.

An Optimal Solution

An optimal solution is a basic feasible solution that also op-timizes the value of the linear objective function. Mathemat-ically, an optimal solution is a set of values of the unknowns denoted by the n-component column vector X which satisfies AX ≤ P0 and X ≥ 0 and at the same time optimizes the value of the objective function f(X) = CX .

Page 70: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 55 ElDaoushy

Example 1:

Suppose it is required to determine X1 and X2 that maximize

f(X) = 3X1 + 5X2

s.to: X1 ≤ 4 X2 ≤ 6

3X1 + 2X2 ≤ 18

& X1 ≥ 0, X2 ≥ 0.

Note That:

o ≡ ( X1 = 0, X2 = 0),

a ≡ ( X1 = 4, X2 = 0),

b ≡ ( X1 = 4, X2 = 3),

c ≡ ( X1 = 2, X2 = 6), and

d ≡ ( X1 = 0, X2 = 6),

are found to be the basic feasible solutions. If we substitute each solu-tion in the above objective function we find that

At "o", f(x) = 3 (0) + 5 (0) = 0.

At "a", f(x) = 3 (4) + 5 (0) = 12.

At "b", f(x) = 3 (4) + 5 (3) = 27.

At "c", f(x) = 3 (2) + 5 (6) = 36.

At "d", f(x) = 3 (0) + 5 (6) = 30.

Thus at the point c, the objective function attains its maximum value. The optimal solution is:

X1 =2, X2 = 6 & f(X) = 36

which agrees with the result of the graphical method (mentioned before).

Page 71: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 56 ElDaoushy

Example 2:

Find X1 and X2 that maximize the objective function:

f(X) = 5X1 - 2X2

s.to: 3X1 - 2X2 ≤ 12 X1 - 5X2 ≤ 6

-X1 + 2X2 ≤ 18

& X1 ≥ 0, X2 ≥ 0.

To determine the basic feasible solutions (or the extreme-point solutions), convert the structural constraints into equations by adding the slack va-riables X3, X4 and X5 .

These constraints become:

3X1 - 2X2 + X3 = 12 X1 - 5X2 +X4 = 6

-X1 + 2X2 +X5 = 18

Then following the second approach, the basic feasible solutions are:

(X1 = 0 , X2 = 0 )

(X1 = 2 , X2 = 0 )

(X1 = 56/13 , X2 = 6/13 )

(X1 = 8, X2 = 6 )

(X1 = 2 , X2 = 2 )

Substituting in the objective function, the corresponding values are 0, 10, 134/13, 28, -4.

Thus the optimal solution is:

X1 = 8, X2 = 6 & f(X) = 28

Page 72: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 57 ElDaoushy

Now, we can summarize the above discussion as follow :

1- Any linear programming problem has an infinite number of solu-tions due to the property that its set of feasible solutions is convex.

2- This number of feasible solutions is reduced to a finite number of basic feasible solutions. Each basic feasible solution consists of :

Non-basic variables which are the independent or zero va-riables, and

Basic variables which are the dependent or the non-zero

variables.

Going from one basic feasible solution to another, one of the non-basic variables becomes basic and one of the basic variables be-comes non-basic.

3- Among these basic feasible solutions, the one which optimizes the objective function is the optimal solution. We may have more than one optimal solution.

Comment:

Even, the number of basic feasible solution is finite, it may be so large that it would be unpractical to calculate all of them. Dantzing succeeded in developing an outstanding technique called "Simplex" method.

This simplex method makes it unnecessary to cover all the basic feas-ible solutions, because it always leads to a better basic feasible solu-tion until the optimal solution is obtained. This method will be dis-cussed in the next section.

Page 73: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 58 ElDaoushy

The Simplex Method

Briefly, the simplex method is an iterative procedure that can be used to solve any LP model.

The general form of a LP model

Optimize Z = ∑ cj xj

j=1 s.to n

∑ aij xj (>=,=,<= ) bi ; bi >= 0 for all values of i =1, . . , m

j=1

& all xj >= 0.

It can be converted to the equivalent LP model:

Optimize Z = ∑ cj xj j=1

s.to n

∑ aij xj = bi for all values of i =1, . . ., m

j=1

& all xj >= 0.

which includes:

o slack variables that have been added to the left side of each <= constraint,

o surplus variables that have been subtracted from the left

side of each >= constraint, and o artificial variables that have been added to the left side of

each of each = constraint.

Page 74: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 59 ElDaoushy

The equivalent model necessarily assumes us that each equation contains a variable with a coefficient of 1 in that equation and a coefficient of zero in each of the other equations. If the original constraint was a <= constraint, the slack variable in the corresponding equation will satisfy the condition just stated. Likewise, the artificial (surplus) variables added to the >= constraints and equalities satisfy the condition for each of the remaining equations in the equivalent model. These slack and artificial variables are the basic variables in the initial basic feasible solution of the equivalent problem. The solution to the LP model starts with an initial basic feasible solution using slack and artificial variables. Then it moves to a new better basic feasible solution by means of replacing one of the basic variables with a non-basic variable. This non-basic variable is called the entering variable and is selected according to its potential contribution to the improvement of the objective function. The basic variable to be replaced is called the leaving variable and is selected according to a rule which ensures the continued feasibility of the new solution. Once the better basic feasible solution is established, it forms a starting point for repeating the same process to determine a still better basic feasible solution. This process will stop when one of the following three cases is reached: 1. A finite optimal solution is found, 2. An infinite optimal solution is positively identified, or 3. The problem has no feasible solution.

Page 75: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 60 ElDaoushy

Computer S/W Packages:

• We are going to use the WinQSB S/W package in our training course. This package includes 19 different programs to be used in solving most of the OR models.

• The different programs are:

1. Linear and Integer Programming. 2. Quadratic Programming. 3. Non-Linear Programming. 4. Network Modeling. 5. Dynamic Programming. 6. PERT-CPM. [Primavera Project Planner (P3) will be used instead…] 7. Acceptance Sampling. 8. Aggregate Planning. 9. Decision Analysis. 10. Facility Location and Layout. 11. Forecasting. 12. Goal Programming. 13. Inventory Theory and System. 14. Job Scheduling. 15. Markov Process. 16. Material Requirements Planning. 17. Quality Control Chart. 18. Queuing Analysis. 19. Queuing System Simulation.

• Moreover most of these programs can solve a variety of OR

problems. For example, “Network Modeling” program includes the solution of the following problems:

1. Network Flow. 2. Transportation Problems. 3. Assignment Problems. 4. Shortest Path Problems. 5. Maximal Flow Problems. 6. Minimal Spanning Tree Problems. 7. Traveling Salesman Problems.

Page 76: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 61 ElDaoushy

Computer S/W to Solve LP Models:

• WinQSB (Linear and Integer Programming)

Solve the following Problems which discussed earlier using WinSQB S/W:

Diet (Nutrition) Problem (page II-5) Television Problem (page II-7) Product Mix Problem (page II-9) Truck Production Problem (page II-12) Crop Farm Organization Problem (page II-15) Machine Scheduling Problem (page II-17)

Page 77: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 62 ElDaoushy

3.9 [7] Solve by Simplex Method Max. Z = X1 + 2X2 + 3X3 + 4X4

s.to

X1 + 2X2 + X3 + X4 = 3 X1 - X2 + 2X3 + X4 = 4 X1 + X2 - X3 - X4 = -1 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 1, X2 = 0, X3 = 1, X4 = 1, and Z = 8 Hint: The 3rd constraint can be entered as it is, or converted to the following

one: -X1 - X2 + X3 + X4 = 1

Page 78: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 63 ElDaoushy

3.14 [7] Solve by Simplex Method The Red Tomato Company operates two plants for canning their tomatoes and three warehouses for storing the finished products until they are purchased by sellers. The company wants to arrange its shipments from the plants to the warehouses so that the requirements of the warehouses are met and so that the shipping costs are kept at a minimum. The schedule below represents the shipping cost from plant to warehouse:

Warehouse A B C Plant I $.25 $.17 $.18 Plant II $.25 $.18 $.14

Each week, plant I can produce up to 850 cases and plant II can produce up to 650 cases of tomatoes. Also, each week warehouse A requires 300 cases, warehouse B, 400 cases, and warehouse C, 500 cases. If the number of cases shipped from Plant I to warehouse A,B, and C are represented by X1, X2, X3; and if the number of cases shipped from Plant II to warehouse A,B, and C are represented by X2, X3, X4, the above data can be represented by the table:

Warehouse Supply A B C

Plant I X1 X2 X3 850 Plant II X4 X5 X6 650 Total Demand

300 400 500

Page 79: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 64 ElDaoushy

Solution Using WinQSB S/W (Linear and Integer Programming): The problem can be stated as follows: Min. Z = .25X1 + .17X2 + .18X3 + .25X4 + .18X5 + .14X6

s.to: X1 + X2 + X3 <= 850 X4 + X5 + X6 <= 650 X1 + X4 = 300 X2 + X5 = 400 X3 + X6 = 500 & Xj >= 0 Multiple Solutions exist . . .

(comes from “Results/Obtain Alternate Optimal”) . . . .

X1 300 150 300 . . . . X2 400 400 400 . . . . X3 0 0 0 . . . . X4 0 150 0 . . . . X5 0 0 0 X6 500 500 500 . . . . Z 213 213 213 213

Hint:

This Problem can also be formulated and solved as a Transportation Problem even though ∑S > ∑D. See Later. . . .

Page 80: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 65 ElDaoushy

3.15 [7] Solve by Simplex Method Max. Z = 3X1 + X2 + 9X3 - 9X4

s.to

X1 + X2 + X3 - 5X4 = 4 X1 - X2 + 3X3 + X4 = 0 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): Unbound Solution. . . . Hint: Change the Objective Function to “Minimize” from “Edit/Objective

Function Criterion”, the solution becomes: X1 = 2, X2 = 2, X3 = 0, X4 = 0, and Z = 8 (Alternate Solution Exists….)

Page 81: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 66 ElDaoushy

3.17 [7] Solve by Simplex Method Assume that a small company produces two types of paint (paint X1 and paint X2). Paint X1 produces a net profit of $6 per hundred gallons and paint X2 gives $8 per hundred gallons. The amount of paint of either type produced is limited by both raw material availability and labor hours. Assume that both paints use the same scarce raw material ,however, paint X1 requires one hour of labor and only one unit of the raw material per hundred gallons produced while paint X2 requires 4 hours of labor and one unit of the raw material per hundred gallons produced. Finally, there are 20 units of raw material and 40 hours of labor available each week. The problem is then: Max. Z = 6X1 + 8X2 . . . the profit objective s.to

X1 + X2 <= 20 . . . . material constraint X1 + 4X2 < = 40 . . . . labor constraint & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 13.3333, ! ! ! Decision Maker . . . . X2 = 6.6666, and Z = 133.333

Page 82: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 67 ElDaoushy

3.18 [7] Solve by Simplex Method Max. Z = 3X1 + X2 + 3X3 s.to

2X1 + X2 + X3 <= 2 X1 - 2X2 + 3X3 <= 5 2X1 +2X2 + X3 < = 6 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 0.0, X2 = 0.2, X3 = 1.8, and Z = 5.6.

Page 83: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 68 ElDaoushy

3.20 [7] Solve by Simplex Method Max. Z = 3X1 + 2X2 + 5X3 s.to

X1 + 2X2 + X3 <= 430 3X1 + 2X3 <= 460 X1 + 4X2 < = 420 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 0, X2 = 100, X3 = 230, and Z = 1350.

Page 84: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 69 ElDaoushy

3.21 [7] Solve by Simplex Method Min. Z = - X3 - X4 - X5 + 11 s.to

X1 + X3 - X4 +2X5 = 2 X2 - X3 + 2X4 - X5 = 1 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): Hint: Solve without the constant 11 found in the objective function and add it

to the result of Z after the solution has been obtained. Also, you can X6 to the Objective Function with coefficient 11 and to the Constraints with zero coefficients……

X1 = 0, X2 = 0, X3 = 5, X4 = 3, X5 = 0, and Z = -8 Therefore, the final value of the objective function is: Z = -8 + 11 = 3.

Page 85: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 70 ElDaoushy

3.30 [7] Solve by Simplex Method In order to manufacture three products X, Y, and Z, assumes that three resources must be utilized, namely: time on machine I and II, and specialized labor. Within a production period, at most 48 units of time are available on machine I, at most 120 units of time on machine II, and exactly 80 units of special man-time. The production of 1 unit of product X requires 3 units of time on machine I, 3 units of time on machine II, and 2 units of special man-time; The production of 1 unit of product Y requires 1 unit of time on machine I, 4 units of time on machine II, and 4 units of special man-time; The production of 1 unit of product Z requires 2 units of time on machine I, 3 units of time on machine II, and 1 unit of special man-time. Let X1 denotes units of product X, X2 denotes units of product Y, and X3 denotes units of product Z. Then, the problem becomes: Max. Z = 5X1 + 6X2 + 14X3 s.to

3X1 + X2 + 2X3 <= 48 time. . . 3X1 4X2 + 3X3 <= 120 time. . . 2X1 + 4X2 + X3 < = 80 Labor. . . & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 0, ! ! ! X2 = 0, ! ! ! Decision Maker . . . . X3 = 24, and Z = 336. Hint: if you change the sign of the 3rd constraint to =, the result will be: X1 = 0, X2 = 16, X3 = 16, and Z = 320.

Page 86: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 71 ElDaoushy

Integer LP Problems --- Examples 6.48 [7] Solve by Integer LP Problem Max. Z = 3X1 + 13X2 s.to

2X1 + 9X2 <= 40 11X1 - 8X2 <= 4 & Xj >= 0 and integer. Solution Using WinQSB S/W (Linear and Integer Programming): Hint:

For Integer LP Problems, just choose the radio-box named “Nonnegative integer” in the “LP-ILP Problem Specification – Default Variable Type” window.

Decision Solution

Variable Value X1 2.0000 X2 4.0000 Objective Function(Max) = 58.0000 Left Hand Right Hand Constraint Side Direction Side C1 40.0000 <= 40.0000 C2 -10.0000 <= 4.0000

Page 87: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 72 ElDaoushy

6.10 [7] Solve by Integer LP Problem Max. Z = 6X1 + 3X2 + X3 + 2X4

s.to

X1 + X2 + X3 + X4 <= 8 2X1 + X2 +3X3 <= 12 5X2 + X3 + 3X4 <= 6 X1 <= 1 X2 <= 1 X3 <= 4 X4 <= 2 & Xj >= 0 and integer Solution Using WinQSB S/W (Linear and Integer Programming): Decision Solution Variable Value 1 X1 1.0000 2 X2 0.0000 3 X3 3.0000 4 X4 1.0000 Objective Function (Max.) = 11.0000 Left Hand Right Hand Constraint Side Direction Side 1 C1 5.0000 <= 8.0000 2 C2 1.0000 <= 12.0000 3 C3 6.0000 <= 6.0000 4 C4 1.0000 <= 1.0000 5 C5 0.0000 <= 1.0000 6 C6 3.0000 <= 4.0000 7 C7 1.0000 <= 2.0000

Page 88: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 73 ElDaoushy

Non-Linear Programming (WinQSB–NonLinear Programming) 1. Max Z = -X1

2 + 2X1X2 + X22 –e(-x

1-x

2)

s.to: X1

2 + X22 = 4

X1 + X2 < 1 X1 >= -5 X1 <= 5 X2 >= -5 X2 <= 5 Hint: use the exponential function exp() to represent the item appeared in the

of. Use the “Lower & Upper bounds” of X1 & X2 instead of the last 4 constraints.

[Solution: X1 = -0.8068, X2 = 1.8295, & Z = -0.6127] 2. Min Z = X1

2 + 2X1X2 + 2X22 + X3

2 – X2 X3 + X1 + 3 X2 – X3 s.to: X1 >= 0 X1 <= 100 X2 >= 0 X2 <= 200 X3 >= 0 X3 <= 300 Hint: Use the power square symbol shown in the example of the WinQSB to

represent items appeared in the of. Use the “Lower & Upper bounds” of X1, X2, and X3 instead of the 6 constraints.

[Solution: X1 = 0, X2 = 0, X3 = 0.4982, & Z = -0.2500] 3. Min Z = 2(Workforce – 1000)2 + 500*Workforce – 460,000 s.to: Workforce >= 10 Workforce <= 10,000 Hint: Use the “Lower & Upper bounds” of Workforce instead of the 2

constraints. [Solution: Workforce = 874.8337 & Z = 928,750.1000]

Page 89: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 74 ElDaoushy

Quadratic Programming (WinQSB-Quadratic Programming) 1. Max. Z = a + 3b – 4c – 2a2 + 2ab – 2b2 – c2 s.to: a + b <= 150 3a + 2b – c = 210 5a – 2b + 4c = 315 & a, b, c >= 0

This problem can be illustrated using the option: “Spreadsheet Matrix Form” as follows:

Variable a b c Direction R.H.S Maximize 1 3 -4 a* -2 2 b* -2 c* -1 Constraint 1 1 1 <= 150 Constraint 2 3 2 -1 = 210 Constraint 3 5 -2 4 = 315

[Solution: a= 56.81, b = 31.54, c = 23.51, & Z = -5,355.86] 2. Max. Z = 3.2G1 + 5G2 + 5G3 – G1

2 – 2G22 – 5G3

2 s.to: 4G1 + 2.5G2 + 3G3 = 50 3.6G1 + 7G2 – 2.5G3 = 86.9 & G1, G2, G3 >= 0

Variable G1 G2 G3 Direction R.H.S Maximize 3.2 5 5 G1* -1 G2* -2 G3* -5 Constraint 1 4 2.5 3 = 50 Constraint 2 3.6 7 -2.5 = 86.9

[Solution: G1= 8.56, G2 = 8.01, G3 = 0, & Z = -134.21] Hint: The above problems can be solved as Non-Linear Programming

Problems……

Page 90: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 75 ElDaoushy

Integer Quadratic Programming (WinQSB-Quadratic Programming – NonNegative Integer) Max. Z = 3.2G1 + 5G2 + 5G3 – G1

2 – 2G22 – 5G3

2 s.to: 4G1 + 2.5G2 + 3G3 >= 50 3.6G1 + 7G2 – 2.5G3 = 86.9 & G1, G2, G3 >= 0 & Integer. This problem can be illustrated using the option: “Spreadsheet Matrix Form” as follows:

Variable G1 G2 G3 Direction R.H.S Maximize 3.2 5 5 G1* -1 G2* -2 G3* -5 Constraint 1 4 2.5 3 >= 50 Constraint 2 3.6 7 -2.5 = 86.9 Variable Type Integer Integer integer

[Solution: G1= 19, G2 = 3, G3 = 1, & Z = -303.20]

Page 91: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 76 ElDaoushy

Goal Programming (GP) [2,7] Goal Programming (GP) Model is a variation or extension of the LP

Model which allow Decision-Makers to handle problems involving multiple goals or objectives.

In reality, many Decision-Makers face situations having multiple, and sometimes conflicting goals or objectives.

GP provides an alternative solution Technique for handling Multi-

Criteria Decision Making within the general LP framework. GP seeks a satisfactory solution to problems with more than one

objective or goal. With GP Model, while all goals are considered, it is understood that

some goals may be achieved only at the expense of other (lower ranked goals --- see later).

GP Problems differ from LP Problems because the Objective

Function always seeks to minimize the undesirable deviations from the specified goals. Thus, GP offers the advantage of not having to meet goals exactly, i.e., it allows deviations from targets or goals, thus introducing flexibility into the Decision-Making Process.

GP is therefore especially appropriate for Business Firms seeking to

attain satisfactory levels in multiple goals simultaneously, for instance, Contribution to Profit, Labor Relations, Environmental Protection, and Social Responsibility.

GP is useful for Government Agencies and nonprofit-Organizations

facing a variety of Social Objectives. The solution usually occurs when the deviations from the stated goals

have been minimized.

Page 92: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 77 ElDaoushy

It should be recognized that in GP, the Decision Maker is looking for a satisfactory solution given target goals and constraints, rather than a truly optimal solution.

Consider the following Example: Let us look back at the company which makes 2 products (Tables &

Chairs) that must be processed through Assembly & Finishing Departments.

Assembly Department had only 60 hours available.

Finishing Department had 48 hours available.

Manufacturing of one Table required 4 hours in Assembly Department and 2 hours in Finishing Department.

Manufacturing of one Chair required 2 hours in Assembly Department and 4 hours in Finishing Department.

The Profit is $8/table & $6/chair. What was the best possible combination of producing Tables & Chairs to maximize the Company Profit?

The problem can be stated again as a general LP Model as follows: Maximize Z = 8T + 6C s.to: 4T + 2C <= 60 2T + 4C <= 48 & T, C >= 0. For which the solution was: T = 12, C = 6 & Z = 132. Hint: Solve it 1st as a LP Problem…..

Page 93: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 78 ElDaoushy

Now, suppose that this company has these goals: 1. Maximize Profit in dollars. 2. Maximize Production of Tables in units. 3. Maximize Production of Chairs in units.

In this case, the three goals can not be added because dollars and units do not add; in addition, deviating from the optimal solution of 12 Tables and 6 Chairs will reduce Profit from the $132 optimum; thus we see that goals 2 and 3 conflict with goal 1.

Setting Targets and Putting Priorities on Goals: GP asks Management to set some estimated targets for each of their goals and to put priorities on them --- that is, to rank them in order of importance. Managers who want to use GP only have to say which goal they consider more important than another; they do not have to say how much more important they consider it.

What Goal Programming Does? When the above information is supplied by Management, GP tries to minimize the deviations from the targets that were set. It begins with the most important goal and keeps on until the achievement of a less important goal would cause management to fail to achieve a more important one.

Page 94: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 79 ElDaoushy

Goal Programming (GP): Single Goal Model With only a single-goal (say profit), we could just as easily solve the problem using LP, but a single-goal model is a good starting point for understanding GP. Suppose that the company sets its profit goal at $140 (it was $132 as an optimal LP). This goal may be satisfied or not. Moreover, If we let: Du equal the amount by which the goal is underachieved (the amount

below the goal of $140). Do equal the amount by which the goal is overachieved (the amount

above the goal of $140).

For this reason, both a slack variable and a surplus variable are needed. (for Slack & Surplus Variable, refer to page II – 58…………………….) Thus, our Goal becomes:

$8T + $6C + Du – Do = $140

where

Du represents the amount below the goal, and Do represent the amount above the goal.

At this point, the new equation is used to define the new variables. Hence it enters the Problem as a constraint not a Goal (Objective Function).

Page 95: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 80 ElDaoushy

The Problem now, is to define an Objective Function. It is clear that underachievement (amount below the goal) is the first concern of the Company which must be minimized, so we can state the problem (GP Problem) as follows: Minimize Du --- minimize underachievement of the profit target s.to $8T + $6C + Du – Do = $140

--- profit obtained ($8T+$6C) + any underachievement – any overachievement must = the Target.

4T + 2C <= 60 --- assembly constraint 2T + 4C <= 48 --- finishing constraint (4 Variables: T, C, Du, and Do & 3 Constraints)

This problem would be ready for solution by the Simplex Method. So, Solving by WinQSB, we have: T = 12, C = 6, Du = 8.00, Do = 0.00 &

G1 = 8.00.

The actual answer turns out to be 12 Tables and 6 Chairs (the same as in the LP solution), but the value of the objective function is $8 (the amount by which we underachieved our $140 goal). Of course, we knew that $132 was the maximum profit earnable with these constraints, so missing $140 by $8 was expected. Notice in this formulation that only Du is in the objective function.

Page 96: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 81 ElDaoushy

Goal Programming (GP): Equally Ranked Multiple Goals:

Suppose the Company states two equally ranked goals: The 1st Goal is to reach a Profit Goal of $100, and The 2nd Goal is to produce to meet a Table’s Goal of 10.

Since these goals are equally ranked, a $1 deviation from the Profit Target is just as important (in the GP Model) as a deviation of 1Table.

For this formulation, let us use the following notation:

Dup = amount by which the Profit goal is underachieved. -- profit Dop = amount by which the Profit goal is overachieved. -- profit Dut = amount by which the Tables goal is underachieved. -- tables Dot = amount by which the Tables goal is overachieved. -- tables Thus, the Objective Function and Constraints for the Problem with

Multiple Equality Ranked Goals becomes: Minimize: Dup + Dut . . . One Objective representing multiple goals..

s.to: $8T + $6C + Dup – Dop = $100 --- profit goal T + Dut – Dot = 10 --- tables goal 4T + 2C <= 60 --- assembly constraint 2T + 4C <= 48 --- finishing constraint & all variables >= 0. (6 variables: T, C, Dup, Dop, Dut,Dot & 4 constraints)

Page 97: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 82 ElDaoushy

By solving this Problem, we notice that our goal of 10 Tables was achieved and bettered by 12 ½ -10 = 2 ½. 2 ½ appears in the final solution as Dot (overachievement of Tables). Our Profit of $100 was reached (both Dup and Dop are zero because they are not in the final solution and so profit is exactly $100). Notice that Alternate Optimal Solutions are possible. Goal Decision Solution

1 G1 T 12.50 2 G1 C 0 3 G1 Dup 0 4 G1 Dut 0 5 G1 Dop 0 6 G1 Dot 2.50

G1 Goal Value (Min.) = 0 (Alternate Solution Exists!!)

Notice that it is possible to use None-negative Integer option with the S/W…

Notice also that, Using Integer Variables for T & C, the solution will be: T = 13 C = 0

D up = 0 Dop = 4 D ut = 0 Dot = 3

& G1 = 0

Page 98: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 83 ElDaoushy

Example 2: (www.econ.surrey.ac.uk/people/rpierse/files/cop5.pdf) Consider the following Linear Programming Problem: Maximize Profits subject to a Labor and Storage Constraint

Max 2X1 + 3X2

s.to: X1 + X2 ≤ 100 (Labor constraint) (1). 4X1 + X2 ≤ 200 (Storage constraint) (2).

The solution to the problem is:

X1=0, X2=100 & Z (Profits) = 300.

The Storage Constraint is not binding (required) so Storage is under used by 100 (from 2nd constraint).

Now, a Goal Programming Problem: Suppose instead that the Firm wants to achieve 3 Objectives: X1 + X2 = 100 (Use all available Labor) (1)

4X1 + X2 = 200 (Use all Storage) (2)

2X1 + 3X2 = 110 (instead of 300) (Achieve reasonable Profits) (3)

These three Goals may be either over- or under- achieved.

Page 99: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 84 ElDaoushy

We introduce Deviation Variables to represent the over- or under-achievement of the Goals:

DLu represents the amount of under-achievement of goal (1) -- Labor DLo represents the amount of over-achievement of goal (1) DSu represents the amount of under-achievement of goal (2) --- Storage DSo represents the amount of over-achievement of goal (2) DPu represents the amount of under-achievement of goal (3) -- Profit DPo represents the amount of over-achievement of goal (3)

Note that for any Goal K:

if the Goal is exactly achieved, then: DKo = 0 & DKu = 0 if the Goal is over-achieved, then: DKo > 0 & DKu = 0 if the Goal is under-achieved, then: DKo = 0 & DKu > 0 and in all cases, all Deviation Variables ≥ 0

Adding pairs of deviation variables to the goals transforms them into a set of constraints:

X1 + X2 + DLu – DLo = 100 (1′)

4X1 + X2 + DSu – DSo = 200 (2′)

2X1 + 3X2 + DPu – DPo = 110 (3′) The objective of the goal programming is to minimize deviations from the goals given by:

Min DLu + DLo + DSu + DSo + DPu+ DPo

This problem has now been transformed into a standard Linear Programming problem which can be solved as usual. 8 Variables: X1 , X2, Dlu , Dlo , Dsu , Dso , Dpu , Dpo & the above 3 Constraints

Page 100: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 85 ElDaoushy

The solution to the problem (using the Simplex Method) is:

X1 = 49; X2 = 4; DLu = 47 & Z (deviation from goals) = 47

Note that Profits are 110 but Labor is under-used. See the following output from Computer Software…. Computer Software Input/Output: Example Page 3: Goals = 1; Variables = 8; Constraints = 3

X1 X2 Dlu Dlo Dsu Dso Dpu Dpo Direction R.H.S. Min:G1 1 1 1 1 1 1 s.to: C1 1 1 1 -1 = 100 C2 4 1 1 -1 = 200 C3 2 3 1 -1 = 110 LB 0 0 0 0 0 0 0 0 UB M M M M M M M M VT C C C C C C C C Solution: Combined Report for Example Page 3 1 G1 X1 49.00 0 0 0 -3.00 3.67 2 G1 X2 4.00 0 0 0 -1.75 3.25 3 G1 Dlu 47.00 1.00 47.00 0 -1.00 3.33 4 G1 Dlo 0 1.00 0 2.00 -1.00 M 5 G1 Dsu 0 1.00 0 1.10 -0.10 M 6 G1 Dso 0 1.00 0 0.90 0.10 M 7 G1 Dpu 0 1.00 0 1.30 -0.30 M 8 G1 Dpo 0 1.00 0 0.70 0.30 M

G1 Goal Value (Min.) = 47.00

Page 101: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 86 ElDaoushy

Weighting of Goals: The Objective Function:

Min DLu + DLo + DSu + DSo + DPu + DPo implies that all deviations are given equal weight. (It also implies that achieving profits above the target is penalized (restricted) in the same way as underachieving the goal which is silly.) Goals can be weighted by using different coefficients on the deviations in the Objective Function. For example, to modify the Goals so that:

(1) Avoiding under-utilization of Labor is twice as important as all other Objectives

(2) Achieving excess Profits is not penalized (restricted). The resulting Objective Function would become: Min 2 DLu + 1 DLo+ 1 DSu + 1 DSo + 1 DPu + 0 DPo

and the solution to this (weighted) Goal Programming problem is:

X1 = 33.3 ; X2 = 66.7 ; DPo= 156.7 & Z = 0 .

All the Goals are now achieved with Profits = 266.7[2X1 +3X2] instead of 300.

Page 102: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II -87 ElDaoushy

Computer Software Input/Output: GP: Weighting of Goals

X1 X2 Dlu Dlo Dsu Dso Dpu Dpo Dir. R.H.S.

Min:G1 2 1 1 1 1 0 C1 1 1 1 -1 = 100 C2 4 1 1 -1 = 200 C3 2 3 1 -1 = 110 LB 0 0 0 0 0 0 0 0 UB M M M M M M M M VT C C C C C C C C Hint: Leave the cells of no value as empty cells Solution: 1 G1 X1 33.33 2 G1 X2 66.67 3 G1 Dlu 0 4 G1 Dlo 0 5 G1 Dsu 0 6 G1 Dso 0 7 G1 Dpu 0 8 G1 Dpo 156.67 G1 Goal Value (Min.) = 0

Page 103: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II -88 ElDaoushy

Prioritizing Goals: Suppose that the achievement of one (or more) of the Goals is considered to be of principal importance. Then, achievement of this Goal(s) should be attained before all other Goals are considered. More generally, Goals can be organized in groups of different priorities. Goals of priority K are only considered when all Goals of higher priority have been achieved. Note that this is different from weighting of Goals and cannot be transformed into a standard Linear Programming Problem. However, it can be solved by a straightforward Modification of the Simplex Algorithm. Modified Simplex Algorithm: Step 1: Minimize deviation of all priority 1 Goals Step 2: Minimize deviation of all priority 2 Goals subject to 1 Step 3: Minimize deviation of all priority 3 Goals subject to 1 & 2 The Algorithm stops when Goals of a certain priority cannot be achieved. Example: Suppose the priorities are 1: Storage; 2: Labor; 3 Profits. Then the sequence of problems to be solved is: Priority 1: Min DSu + DSo Priority 2: Min DLu + DLo (s. t. DSu = DSo = 0) Priority 3: Min DPu + DPo (s. t. DSu = DSo = DLu = DLo = 0)

[DSu = DSo = 0 already considered in Priority 2] [3 Goals, 8 Variables, and 7 Constraints --- See the Model on next page] Solution is: X1 = 33.3; X2 = 66.7; DPo = 156.7; Profits = 266.7 (110+156.7); Priority 1 and 2 Goals are achieved. Excess Profits are 156.7. Note that Goal Weighting and Prioritizing of Goals can be combined.

Page 104: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II -89 ElDaoushy

Computer Software Input/Output: GP: Prioritizing Goals: 3 Number of Variables: 8 Number of Constraints: 7

X1 X2 Dsu Dso Dlu Dlo Dpu Dpo Dir. R.H.S. Min:G1 1 1 Min:G2 1 1 Min:G3 1 1 C1 1 1 1 -1 = 100 C2 4 1 1 -1 = 200 C3 2 3 1 -1 = 110 C4 1 = 0 C5 1 = 0 C6 1 = 0 C7 1 = 0 Lower Bound: … 0 … Upper Bound: … M … Variable Type: … Continuous - Solution: 1 G1 X1 33.33 2 G1 X2 66.67 3 G1 Dsu 0 4 G1 Dso 0 5 G1 Dlu 0 6 G1 Dlo 0 7 G1 Dpu 0 8 G1 Dpo 156.67 9 G2 X1 33.33 10 G2 X2 66.67 11 G2 Dsu 0 12 G2 Dso 0 13 G2 Dlu 0 14 G2 Dlo 0 15 G2 Dpu 0 16 G2 Dpo 156.67 17 G3 X1 33.33 18 G3 X2 66.67 19 G3 Dsu 0 20 G3 Dso 0 21 G3 Dlu 0 22 G3 Dlo 0 23 G3 Dpu 0 24 G3 Dpo 156.67 G1 Goal Value (Min.) = 0 G2 Goal Value (Min.) = 0 G3 Goal Value (Min.) = 156.67

Page 105: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) II -90 ElDaoushy

Another Example: Multiple Objective Functions . . . . Minimize G1 = 3B + 2C, Maximize G2 = 10A + 9B + 8C s.to:

A + B >= 30 B + C >= 50 A + B + C <= 80 3A + 2C <= 120 &

all variables are >= 0. Solving this problem yields: A = 16, B = 14, C = 36 & G1 = 114, G2 = 574. Min. c(j) Max. c(j) 1 G1 A 16.00 2 G1 B 14.00 3 G1 C 36.00 4 G2 A 16.00 5 G2 B 14.00 6 G2 C 36.00 G1 Goal Value(Min.)= 114.00 G2 Goal Value(Max.)= 574.00

Page 106: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 1 ElDaoushy

Section III

Network Modeling

Manufacturing and Transportation

An Oil Company (for example) has Oil Fields in Saudi Arabia and Borneo*, Refineries in Japan and Australia, and Customers in the US and New Zealand.

The fields produce different qualities of Oil, which is refined and combined into different grades of gasoline.

What Raw Oil should be shipped to which Refinery? How much of each type of Gasoline should each Refinery produce for Customers at US & New Zealand?

http://www.rpi.edu/~mitchj/math1900/lp/node4.html John E Mitchell 2000-04-11

• Borneo is the 3rd largest Island in the world. This Island is divided between Indonesia, Malaysia, and Brunei.

Page 107: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 2 ElDaoushy

1. The Transportation Problem [3]

Suppose that a manufacture produces certain commodity at a number of different plants and ships the commodity to holding points (or warehouses) for later distribution and finally to the consumers (Transportation with Transshipment). Suppose the commodity is produced at m plants for shipment to n warehouses. The commodity costs a certain amount to ship 1 unit from a given plant to a given warehouse. Each plant has a certain capacity for producing the commodity (Capacity or Supply). Each warehouse requires a certain amount of the commodity (Demand or Requirements).

The Transportation Problem now is to determine the number of units to ship from each plant to each warehouse in a way that the overall shipping cost is minimized while satisfying the given constraints.

S1

S2

Si

Sm

P L A N T S

Capacity/Supply

D2

D1

Dj

Dn

WAREHOUS ES

Demand/Requirements

xij/cij

Page 108: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 3 ElDaoushy

Now, consider: Xij = amount shipped from Plant i to Warehouse j, where i = 1,2, . . .,m; j = 1,2,3,…,n Cij = cost to ship 1 unit from Plant i to Warehouse j, Dj = required number (Demand) of units at Warehouse j, and Si = capacity (Supply) of Plant i.

Then, the problem can be easily formulated as a LP model as follows: m n

Min. Z = ∑ ∑ Cij Xij

i j

s.to n ∑ Xij <= Si for all values of i = 1, 2, . . . , m (1)

j

∑ Xij >= Dj for all values of j = 1, 2, . . ., n (2) i

& all Xij >= 0 If (1) is summed over all i, then: ∑ ∑ Xij <= ∑ Si i j i Likewise, if (2) is summed over all j, then: ∑ ∑ Xij >= ∑ Dj

j i j

Thus, these two relationships produces: ∑ Si >= ∑ Dj

i j

Page 109: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 4 ElDaoushy

Suppose that: ∑ Si = ∑ Dj

i j

Then, the Model becomes: Min. Z = ∑ ∑ Cij Xij

i j

s.to

∑ Xij = Si for all values of i = 1, 2, . . . , m (1) j

∑ Xij = Dj for all values of j = 1, 2, . . ., n (2) i

& all Xij >= 0 where ∑ Si = ∑ Dj

i j

Page 110: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 5 ElDaoushy

Example: Transportation of Automobiles [3]

Suppose an automobile manufacture is faced with the problem of determining the minimum cost policy for supplying dealers with the desired number of automobiles. The relevant data are given in the following table:

Plant

(Source) Dealer (Destination) Plant

Capacity 1 2 3 4 5 1 1.2 1.7 1.6 1.8 2.4 300 2 1.8 1.5 (2.2) 1.2 1.6 400 3 1.5 1.4 1.2 1.5 1.0 100

Dealer Demand

100 50 300 150 200

The value 2.2 represents the cost of shipping one car from plant (source) 2 to dealer (warehouse) 3.

The corresponding LP (Transportation) model is: Min: Z = 1.2X11 + 1.7X12 + . . . + 2.4X15

+ 1.8X21 + 1.5X22 + . . . + 1.6X25 15 Variables

+ 1.5X31 + 1.4X32 + . . . + 1.0X35 s.to 5

∑ X1j = 300 j=1

5

∑ X2j = 400 3 Constraints j=1

5

∑ X3j = 100 j=1

Page 111: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 6 ElDaoushy

and 3 3 3

∑ Xi1 = 100 ∑ Xi2 = 50 ∑ Xi3 = 300 i=1

i=1

i=1

5 Constraints

3 3

∑ Xi4= 150 ∑ Xi5 = 200 i=1

i=1

& all Xij >= 0. Solution Using WinQSB S/W (Linear and Integer Programming – 15 Variables & 8 Constraints):

Plant (Source)

Dealer (Destination) Plant Capacity 1 2 3 4 5

1 100 0 200 0 0 300 2 00 50 0 150 200 400 3 0 0 100 0 0 100

Dealer Demand

100 50 300 150 200 800

& Z = 1,135

Solution: Using WinQSB (Network Modeling/Transportation

Problem) Solution for Minimization (Transportation Problem)

From To Shipment Unit Cost Total Cost Source 1 Destination 1 100 1.20 120.00 Source 1 Destination 3 200 1.60 320 Source 2 Destination 2 50 1.50 75 Source 2 Destination 4 150 1.20 180 Source 2 Destination 5 200 1.60 320 Source 3 Destination 3 100 1.20 120.00

Total Objective Function Value = 1135

Page 112: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 7 ElDaoushy

Computer S/W to Solve Transportation Models

• STORM (Transportation Problems) • WinQSB (Network Modeling - Transportation Problem)

o To Demonstrate the S/W:

Double-click the icon “Shortcut to WinSQB” on the Disktop.

From the “WinSQB” window, double-click the icon “Network Modeling”.

From the “Network Modeling” window, click “Open” icon or “File/Load Problem”.

From the “Load a problem” window, choose the file name: “TRNSPORT.NET”.

The table of the “Transportation Problem” table displays.

Click “Solve and Analyze/Solve the Problem”.

The solution displays showing the Total Objective Function Value which represents the total minimum cost.

The “Shipment” column in the solution table represents the

Xij variables ( i.e., the number of units to be transported from source i to destination j)

o Now, it is the time to solve the previous problem in this section

Page 113: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 8 ElDaoushy

5.21 [7] Solve the Transportation Problem A Car Rental Agency serving seven cities has a surplus of cars in three cities (labeled W1, W2, and W3) and a need for cars in four cities (labeled M1, M2, M3, and M4). The excess of cars in W1, W2, and W3 is 20, 20, and 32 respectively. The needs for cars at M1, M2, M3, and M4 are 16, 20, 20, and 16 respectively. The table of distances between the cities and the circumference conditions (denoted by M) are as follows:

M1 M2 M3 M4 Excess Cars

W1 17 23 20 M 20 W2 23 15 23 20 20 W3 25 M 13 21 32 Needs For Cars

16 20 20 16

The two occurrences of M’s in the cells indicate that it is not possible to transport cars from W1 to M4 or from W3 to M2 because of (for example) road-repair work. Thus, M denotes an extremely large distance. How should the Agency transport its Cars to satisfy the Demands and Minimize the Total Distance driven?

Solution: Using WinQSB (Network Modeling/Transportation Problem)

Solution for Example 5.21 {7}: Minimization (Transportation Problem)

From To Shipment Unit Cost Total Cost 1 W 1 M 1 16 17 272 2 W 1 M 3 4 20 80 3 W 2 M 2 20 15 300 4 W 3 M 3 16 13 208 5 W 3 M 4 16 21 336 Total Objective Function Value = 1196

Page 114: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 9 ElDaoushy

5.2 [7] Solve the Transportation Problem Find an optimal solution for the following Transportation Problem:

Origin (Surplus Area)

Destination (Shortage Area)

Supply

1 2 3 1 $50 $100 $100 110 2 200 300 200 160 3 100 200 300 150

Demand 140 200 80 420 Solution: Using WinQSB (Network Modeling/Transportation

Problem) From To Shipment Unit Cost Total Cost Source 1 Destination 2 110 100 11000 Source 2 Destination 1 80 200 16000 Source 2 Destination 3 80 200 16000 Source 3 Destination 1 60 100 6000 Source 3 Destination 2 90 200 18000 Total Objective Function Value = 67000

Page 115: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 10 ElDaoushy

5.4 [7] Solve the Transportation Problem Find the optimal solution for the Transportation Problem. Negative costs might indicate some sort of bonus, or net profit, realized by the shipping from the corresponding Origins to the corresponding Destinations. Origin

Destination Supply 1 2 3 4 5 6

1 10 4 7 2 3 4 15 2 1 1 13 8 7 6 10 3 2 8 -1 5 1 4 5 4 7 9 2 7 3 2 9 5 3 4 15 7 -2 5 3

Demand 8 7 12 2 3 10 42 Solution: Using WinQSB (Network Modeling/Transportation

Problem) From To Shipment Unit Cost Total Cost Source 1 Destination 2 5 4 20 Source 1 Destination 4 2 2 4 Source 1 Destination 6 8 4 32 Source 2 Destination 1 8 1 8 Source 2 Destination 2 2 1 2 Source 3 Destination 3 5 -1 -5 Source 4 Destination 3 7 2 14 Source 4 Destination 6 2 2 4 Source 5 Destination 5 3 -2 -6 Total Objective Function Value = 73

Page 116: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 11 ElDaoushy

2. The Assignment Problem [3]

Suppose a Company has m Tasks that must be completed and it has at least m Employees each of which can perform any of the m Tasks but possibly in a different amount of time. Which Employee should be assigned to which Task to minimize the overall time that complete all m Tasks, if each Employee is assigned to one and only one Task? This is but one example of the Classical Assignment Problem where Tasks could be any type of Activities, Employees could be any type of Resources, and Time for an Employee to complete a Task could be considered the effectiveness associated with using a given type of Resource on a given Activity. If effectiveness represents a loss such as cost, then the overall effectiveness associated with assigning one and only one type of Resource to each Activity is a Minimization Problem; otherwise, it is a Maximization Problem. The effectiveness for a various Assignments of Resources to Activities is generally put in a tabular form, and it is called the effectiveness matrix.

The corresponding LP Model is: n n Min. Z = ∑ ∑ Cij Xij j=1 i=1 s.to n

∑ Xij = 1 for all values of i j=1

n

∑ Xij = 1 for all values of j i=1

Xij = (Xij)2 i.e. Xij is either 0 or 1 & Xij >= 0

Page 117: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 12 ElDaoushy

Example: The following table represents the effectiveness matrix for a four-Tasks and four-Employees Assignment Problem. The effectiveness of assigning Employee 1 to Task 1 is 5, of assigning Employee 2 to Task 1 is 4, … etc: Employee

Task 1 2 3 4

1 5 8 8 6 2 4 6 5 8 3 6 10 7 4 4 9 9 7 3

Solution Using WinQSB S/W (Linear and Integer Programming):

Employee

Task 1 2 3 4

1 1 2 1 3 1 4 1

Total Objective Function Value = 1*5 + 1*6 + 1*7 + 1*3

= 21 Solution: Using WinQSB (Network Modeling/Assignment

Problem) Solution for Example Page III - 12: Minimization (Assignment Problem)

From To Assignment Unit Cost Total Cost 1 Employee 1 Task 1 1 5 5 2 Employee 2 Task 2 1 6 6 3 Employee 3 Task 3 1 7 7 4 Employee 4 Task 4 1 3 3 Total Objective Function Value = 21

Page 118: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 13 ElDaoushy

Remarks :

Comparing the Assignment Problem with the Transportation Problem, we find that: 1. The Decision Variables Xij = 1 or 0. 2. The amounts of Supply each equals to 1, i.e. Si =1 3. The amounts of Demand each equals to 1, i.e. Dj =1 4. The number of Origins equals the number of Destinations

( i.e. m = n).

Page 119: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 14 ElDaoushy

Computer S/W to Solve Assignment Models

• STORM (Assignment Problems)

• WinQSB (Network Modeling - Assignment Problem)

o To Demonstrate the S/W:

Double-click the icon “Shortcut to WinSQB” on the Disktop.

From the “WinSQB” window, double-click the icon “Network Modeling”.

From the “Network Modeling” window, click “Open” icon or “File/Load Problem”.

From the “Load a problem” window, choose the file name: “ASSIMENT.NET”.

The table of the “Assignment Problem” table displays. Click “Solve and Analyze/Solve the Problem”. The solution displays showing the Total Objective Function

Value and the corresponding assignments.

Hint: • Use “Edit/Node Names” to change the name of each

node in the table. For example, the default names are: o From Assignment 1 To Assignee 1, Assignee 2, . . .

From Assignment 2 To Assignee 1, Assignee 2, . . . etc. . .

o So, you can rename Assignment 1 to Employee 1,

Assignee 1 to Task 1, . . .etc.

o Now, it is the time to solve the previous problem in the section

Page 120: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 15 ElDaoushy

5.40 [7] Solve the Assignment Problem Solve the Assignment Problem for which the cost matrix is:

Jobs Person

1

2

3

4

5

1 5 3 4 7 1 2 2 3 7 6 5 3 4 1 5 2 4 4 6 8 1 2 3 5 4 2 5 7 1

Solution: Using WinQSB (Network Modeling/Assignment

Problem) From To Assignment Unit Cost Total Cost Assignment 1 Assignee 5 1 1 1 Assignment 2 Assignee 1 1 2 2 Assignment 3 Assignee 4 1 2 2 Assignment 4 Assignee 3 1 1 1 Assignment 5 Assignee 2 1 2 2 Total Objective Function Value = 8

Page 121: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 16 ElDaoushy

5.41 [7] Solve the Assignment Problem Find a feasible solution for the Assignment Problem:

Men

Jobs Available 1 2 3 4 5

1 2 9 2 7 1 1 2 6 8 7 6 1 1 3 4 6 5 3 1 1 4 4 2 7 3 1 1 5 5 3 9 5 1 1

Required 1 1 1 1 1 5 Solution: Using WinQSB (Network Modeling/Assignment

Problem) From To Assignment Unit Cost Total Cost Assignment 1 Assignee 3 1 2 2 Assignment 2 Assignee 5 1 1 1 Assignment 3 Assignee 1 1 4 4 Assignment 4 Assignee 4 1 3 3 Assignment 5 Assignee 2 1 3 3 Total Objective Function Value = 13

Page 122: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 17 ElDaoushy

Minimal Spanning Tree Problem & the Pipeline Networks [2]

The Minimal Spanning Tree Problem is concerned with finding a way to reach all the nodes in a network from some particular node (source) in such a way that the total length of all the branches used is minimum.

There are two methods we can use, Prim or Kruskal. The Kruskal Algorithm is better for small hand-computed networks but inefficient for larger networks, so let us use the Prim Method, which works on networks of all sizes.

Suppose we introduce the “Prim Algorithm” with the example of Alan Fine [2], a Land Developer who has just planned a small subdivision of rural homes each quite some distance from the other. Alan is planning the Water System for this development, and at this stage he is not obliged to lay the Water Lines beside the roads. In fact, after he eliminates routes which would cross streams and those which would involve considerable tunneling, the routes open to him for his Water Lines as those shown:

1,100

1,000

800

Fig. 15-23 [2]

600

500

400

900

100

200

300

1. Water Line Taps

ON

4 6

3

5

7 2

700

Page 123: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 18 ElDaoushy

3. The Minimal Spanning Tree Algorithm [2]

This Algorithm operates by joining the nearest unconnected node to nodes that are already connected; of course, for this to happen in the first place, we arbitrarily connect two nodes to begin the process.

Step 1: Construct a Table of Distances between Nodes. Alan made up the

one illustrated:

From Node

To Node 1

2

3

4

5

6

7

1 0 1,100 100 300 600 1,000 400 2 1,100 0 M M M M 900 3 100 M 0 M 500 M M 4 300 M M 0 M 700 M 5 600 M 500 M 0 200 M 6 1,000 M M 700 200 0 800 7 400 900 M M M 800 0

Since some Nodes cannot be connected to others, we show this by entering the letter M in the Table. M here has a very large number (infinity). Step 2 :

Select any Node to begin the Algorithm; indicate that this Node is connected by some appropriate mark (we shall use an X) and delete the column headed by this node. Now look at following table:

Page 124: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 19 ElDaoushy

Connected 1 2 3 4 5 6 7 Step 2: Select node 1 to begin the X 1 algorithm; Indicate with X that 2 it is connected and delete column 1. 3 Step 3: Find the smallest number in 4 the marked row (100) and mark it. 5 6 7

1,100 0 M M M M 900

(100) M 0 M 500 M M

300 M M 0 M 700 M

600 M 500 M 0 200 M

1,000 M M 700 200 0 800

400 900 M M M 800 0

Step 4: Mark row 3 with an X and X 1 delete column 3. 2 Step 3: Find the smallest number in X 3 all the marked rows (300) 4 and mark it. 5 6 7

1,100 0 M M M M 900

(300) M M 0 M 700 M

600 M 500 M 0 200 M

1,000 M M 700 200 0 800

400 900 M M M 800 0

Step 4: Mark row 4 with an X and X 1 delete column 4. 2 Step 3: Find the smallest number in X 3 all the marked rows (400) and X 4 mark it. 5 6 7

1,100 0 M M M M 900

600 M 500 M 0 200 M

1,000 M M 700 200 0 800

(400) 900 M M M 800 0

Step 4: Mark row 7 with an X and X 1 delete column 7. 2 Step 3: Find the smallest number in X 3 all the marked rows (500) and X 4 mark it. 5 6 X 7

1,100 0 M M M M 900

600 M (500) M 0 200 M

1,000 M M 700 200 0 800

Step 4: Mark row 5 with an X and X 1 delete column 5. 2 Step 3: Find the smallest number in X 3 all the marked rows (200) and X 4 mark it. X 5 6 X 7

1,100 0 M M M M 900

1,000 M M 700 (200) 0 800

Step 4: Mark row 6 with an X and X 1 delete column 6. 2 Step 3: Find the smallest number in X 3 all the marked rows (900) and X 4 mark it. X 5 X 6 X 7

1,100 0 M M M M (900)

Step 4: Mark row 2 with an X and X 1 delete column 2. X 2 All the nodes have been X 3 connected; this is the optimum X 4 answer. X 5 X 6 X 7

The Total Minimal Connected Distance = 100+300+400+500+200+900 = 2400 Routes: are 13, 14, 17, 35, 56, 72

Page 125: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 20 ElDaoushy

Step 3 : Find the smallest number in all the rows marked with an X and mark it. The column containing this marked number indicates the new connected node.

Step 4 : Mark the newly connected node with an X and delete the column headed by this node. Step 5 : Repeat steps 3 and 4 until all the nodes have been connected. The following figure shows the optimum answer from the previous table:

In the figure, the closest routes are those that were marked when we finished the final step in the marked values in the previous table; in this case 2400 units of length of Water Line will be required to connect all the Homes in Alan’s Development.

500

400

900

100

200

300

1. Water line taps on

4 6

3

5

7 2

Fig. 15-24 [2]

Page 126: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 21 ElDaoushy

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From Node Connect To Distance/Cost Node7 Node2 900 Node3 Node5 500 Node1 Node3 100 Node5 Node6 200 Node1 Node4 300 Node1 Node7 400 Total Minimal Connected Distance (or Cost) = 2400

Page 127: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 22 ElDaoushy

Computer S/W to Solve Minimal Spanning Tree Models

• WinQSB (Network Modeling)

o To Demonstrate the S/W:

Double-click the icon “Shortcut to WinSQB” on the Disktop.

From the “WinSQB” window, double-click the icon “Network Modeling”.

From the “Network Modeling” window, click “Open” icon or “File/Load Problem”.

From the “Load Problem” window, choose the file name: “SPANTREE.NET”.

If the Minimal Spanning Tree Problem Network displays, click “Format/Switch to Matrix Form”.

Click “Solve and Analyze/Solve the Problem”.

The solution founded displays the connections and distances between nodes and the “Total Minimal Connected Distance (or Cost).

Hint:

• Only insert the actual values of distances. That is

nothing for M values & zero values founded in the cells: Nod1 to Node1, Node2 to Node2, . . .etc

o Now, it is the time to solve the previous problem in the section

Page 128: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 23 ElDaoushy

8.15 [7] Solve the Minimal Spanning Tree Problems Find the shortest spanning tree in the following figure:

B E

D

K

A

F

H

C

G

10 18

27

-10

-2 12

15 20

9

-5 11

22

36

24 37

29

35

4 26

Page 129: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 24 ElDaoushy

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From To

A

B

C

D

E

F

G

H

K

A 10 -10 27 B 10 18 -2 15 C -10 18 36 4 D 27 -2 36 12 35 22 E 15 12 22 29 20 F 4 35 22 11 26 G 22 29 11 37 -5 H 20 37 9 K 26 -5 9

From Node Connect To Distance/Cost A B 10 A C -10 B D -2 D E 12 C F 4 F G 11 K H 9 G K -5

Total Minimal Connected Distance (or Cost) = 29

B E

D

K

A

F

H

C

G

10 18

27

-10

-2 12

15 20

9

-5 11

22

36

24 37

29

35

4 26

Page 130: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 25 ElDaoushy

8.16 [7] Solve the Minimal Spanning Tree Problem The planned locations of computer terminals that are to be installed in a multistory building are given in the following figure. Terminal A is the computer itself and phone cables must be wired along some of the indicated branches in order that there is a connected path from every terminal back to A. The numbers along the arcs represent the costs (in 100s of dollars) of installing the lines between terminals. Since operating costs are very low, the company would like to find the branches that should be installed in order to minimize total installation costs.

A

B

D

E

F

C G

2

5

3

2

8

1 2

5

3

1

6

4

Page 131: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 26 ElDaoushy

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From To

A

B

C

D

E

F

G

A 2 5 3 B 2 2 8 C 5 2 1 2 5 D 3 1 3 E 2 3 1 6 F 8 5 1 4 G 6 4

From Node Connect To Distance/Cost

A B 2 B C 2 C D 1 C E 2 E F 1 F G 4

Total Minimal Connected Distance (or Cost) = 12

A

B

D

E

F

C G

2

5

3

2

8

1

2

5

3

1

6

4

Page 132: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 27 ElDaoushy

8.17[7] Solve the Minimal Spanning Tree Problem The city park management needs to determine under which roads telephone lines should be installed to connect all stations with a minimum total length of lines. Using the data given the figure, find the shortest spanning tree (spanning tree is defined as a connected subgraph of a network G which contains the same nodes as G but contains no loops)

O

A

C

B

E

D

T

2

5

4

2

7

1

4

3

4

1

5

7

Page 133: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 28 ElDaoushy

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From To

O

A

B

C

D

E

T

O 2 5 4 A 2 2 7 B 5 2 1 4 3 C 4 1 4 D 7 4 1 5 E 3 4 1 7 T 5 7

From Node Connect To Distance/Cost O A 2 A B 2 B C 1 E D 1 B E 3 D T 5

Total Minimal Connected Distance(or Cost) = 14

O

A

C

B

E

D

T

2

5

4

2

7

1

4

3

4

1

5

7

Page 134: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 29 ElDaoushy

8.18[7] Solve the Minimal Spanning Tree Problem

Find the shortest spanning tree in the following figure:

The following represents corresponding table:

From To

1

2

3

4

5

6

7

8

1 6 5 14 18 2 6 2 8 3 5 2 11 16 4 14 11 7 15 10 9 5 18 8 16 7 4 17 12 6 15 4 13 7 10 17 3 8 9 12 13 3

1

2

3 6

5

4

7

8

6

14

5

2

9

3 12

10

17 8

18

16 4

15 13 7

11

Page 135: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 30 ElDaoushy

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From Node Connect To Distance/Cost Node3 Node2 2 Node1 Node3 5 Node5 Node4 7 Node2 Node5 8 Node5 Node6 4 Node8 Node7 3 Node4 Node8 9

Total Minimal Connected Distance(or Cost) = 38

1

2

3 6

5

4

7

8

6

14

5

2

9

3 12

10

17 8

18

16 4

15 13 7

11

Page 136: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 31 ElDaoushy

4. Pipeline Networks [4]

Pipeline Networks are an essential and important factor in our Domestic Economy. Its importance arises from the fact that Transportation by Pipes is the modest and cheapest Mode of Transport. Gas & Oil, Establishing of New Cities and their need for Sanitary Drainage, Water, Telephone, Natural Gas, etc are typical Applications of Pipeline Networks. Consider the following Case Study [4]

Enormous Petroleum Oil Storages situated at Suez Gulf and other Offshore Regions are presently undergoing Development. It is assumed that, Crude Oil must be transported through Pipelines (supposing that all the Oils are of the same grade and quality) to Refinery Plants at Suez City. Once the Oil is processed, the processed Oil must be transported through another Pipeline Network to Domestic Markets such as at Mostorod, Cairo, Helwan, Alexandria, and to Exportation Ports (Alexandria).

Our case study has two separate Networks. One for the Crude Oil, and the other for Exporting and Consuming Processed Oil.

For the first Network, the following table represents the distances (in km) between the different Nodes which represent the Crude Oil Wells knowing that the Refinery Plant is at Suez City and:

Node Number Field Name 1 Sedr 2 Asal 3 Balaeim Bahary 4 Balaeim 5 Ras_Ghareb 6 Morgan 7 Karim 8 Shokeir 9 Amal

10 Ghardaka

Page 137: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 32 ElDaoushy

1

2 3 4

5

8 7

6

9

Suez 25

60 150 165

160

210 190

265 240

10

325

Page 138: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 33 ElDaoushy

From \ To

Suez

Node

1

Node

2

Node

3

Node

4

Node

5

Node

6

Node

7

Node

8

Node

9

Node

10 Suez

25 60 150 165 160 210 190 265 240 325

Node1

25 30 115 135 135 175 165 185 210 300

Node2

60 30 85 55 60 150 135 150 175 265

Node3

150 115 85 25 25 60 50 65 100 175

Node4

165 135 55 25 40 25 50 50 75 150

Node5

160 135 60 25 40 50 25 50 85 165

Node6

210 175 150 60 25 50 50 25 30 110

Node7

190 165 135 50 50 25 50 30 75 150

Node8

265 185 150 65 50 50 25 30 40 115

Node9

240 210 175 100 75 85 30 75 40 85

Node10

325 300 265 175 150 165 110 150 115 85

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From Node Connect To Distance/Cost Suez Node1 25 Node1 Node2 30 Node2 Node4 55 Node3 Node5 25 Node4 Node3 25 Node4 Node6 25 Node5 Node7 25 Node6 Node8 25 Node6 Node9 30 Node9 Node10 85

Total Minimal Connected Distance (or Cost) = 350

Page 139: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 34 ElDaoushy

For the second Network, the approximated distance matrix between the different Nodes and the Suez City where the Oil is refined and compressed to these Nodes (Cities) is as follows:

Node Name A Mostorod B Cairo C Helwan D Tanta E Alexandria

From \To

Suez

A

B

C

D

E

Suez 120 125 160 180 290 A 120 15 45 80 180 B 125 15 30 90 185 C 160 45 30 120 210 D 180 80 90 120 105 E 290 180 185 210 105

The Total Minimal Connected Distance (or Cost) = 350

Solution: Using WinQSB (Network Modeling/Minimal Spanning Tree)

From Node Connect To Distance/Cost Suez A 120 A B 15 B C 30 A D 80 D E 105

Total Minimal Connected Distance (or Cost) = 350

Page 140: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 35 ElDaoushy

Computer S/W to Solve Minimal Spanning Tree Models

• WinQSB (Network Modeling)

o To Demonstrate the S/W:

Double-click the icon “Shortcut to WinSQB” on the Disktop.

From the “WinSQB” window, double-click the icon “Network Modeling”.

From the “Network Modeling” window, click “Open” icon or “File/Load Problem”.

From the “Load a problem” window, choose the file name: “SPANTREE.NET”.

If the Minimal Spanning Tree problem network displays, click “Format/Switch to Matrix Form”.

Click “Solve and Analyze/Solve the Problem”. The solution founded displays the connections and distances

between nodes and the “Total Minimal Connected Distance (or Cost).

Hint: • Only insert the actual values of distances. That is

nothing for M values & zero values founded in the cells Nod1 to Node1, Node2 to Node2, . . .etc

o Now, it is the time to solve the previous problem in the section

Page 141: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 36 ElDaoushy

5. Traveling SalesPerson Problem (TSP) [3,8]

Problem Definition: Traveling Salesperson’s problem is considered as a formal Model of many practical Network Optimization Problems. The Problem is defined by a Network with N Nodes (towns) and links (edges, arcs, or roads) between them. The task is to find a Shortest Route from some Starting Town, visiting all of the other Towns and ending in the Starting Town. No Town (with the exception of the Starting one) may appear on the Route twice (Cyclical Route)

Problem Formulation: Let cij = the cost (distance) of travel from Town i to Town j. xij = 1 if the Route uses a link from Town i to Town j. = 0 otherwise. The Total Distance (Cost) of a Route becomes: N N Z = ∑ ∑ cij xij . . . . . . (1) i=1 j=1

In order for each Town on a Route to be visited only once, the

Salesperson must arrive at each Town exactly once, and leave each Town exactly once. This means that:

N ∑ xij = 1 ; i = 1, 2, . . , N . . . . (2)

j=1

leaves each Town exactly once…... N ∑ xij = 1 ; j = 1, 2, . . , N . . . . . (3) i=1

arrives each Town exactly once…...

Page 142: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 37 ElDaoushy

(1), (2), and (3) constitute just an Assignment Problem, but due to the circumstances of the Salesperson’s Problem, this Assignment Problem does not guarantee that the Routes will be connected. Therefore, extra Constraints should be added to govern the disconnection as follows:

ui – uj + N xij <= N-1 ; i = 2, . ., N j = 2, . . , N, and i <> j. where ui represent N-1 auxiliary variables. For more details, refer to reference [3].

A great deal of research effort has been put forth in the past years to solve the general Traveling Salesperson Problem. Algorithms that find the exact optimal solution are still limited to fewer than 100 towns. Algorithms that will find the exact solution for large problems are still very much in need………..

A number of branch-and-bound Algorithms that find the exact Optimal Solution for small-to-moderate-size Traveling Salesperson Problems have appeared in literature during the last years; however, most (if not all) are based on the Eastman Algorithms. Eastman and Little et Al Algorithms form the bases for all the Traveling Salesperson Problems. For more details, refer to reference [3].

Page 143: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 38 ElDaoushy

Applications of Traveling SalesPerson Problem

Much of the work on the TSP is not motivated by direct applications, but rather by the fact that the TSP provides an ideal platform for the study of general methods that can be applied to a wide range of discrete optimization problems. This is not to say, however, that the TSP does not find applications in many fields. Indeed, the numerous direct applications of the TSP bring life to the research area and help to direct future work.

The TSP naturally arises as a subproblem in many transportation and logistics applications, for example the Problem of Arranging School Bus Routes to pick up the Children in a School District. This Bus Application is of important historical significance to the TSP, since it provided motivation for Merrill Flood, one of the pioneers of TSP research in the 1940s. A second TSP application from the 1940s involved the Transportation of Farming Equipment from one Location to Another to test Soil, leading to mathematical studies in Bengal by P. C. Mahalanobis and in Iowa by R. J. Jessen.

More recent Applications involve the Scheduling of Service Calls at Cable Firms, the Delivery of Meals to Homebound Persons, the Scheduling of Stacker Cranes (winchs) in Warehouses, the Routing of Trucks for Parcel Post Pickup, and a Host of Others.

Although Transportation Applications are the most natural setting for the TSP, the simplicity of the Model has led to many interesting Applications in other Areas. A classic example is the Scheduling of a Machine to Drill Holes in a Circuit Board or other Object. In this case the holes to be drilled are the cities, and the cost of travel is the time it takes to move the drill head from one hole to the next. The Technology for Drilling varies from one Industry to Another, but whenever the Travel Time of the Drilling Device is a significant portion of the overall Manufacturing Process then the TSP can play a role in reducing Costs.

Page 144: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 39 ElDaoushy

Other examples from the TSP Literature can be found on the web page "The Traveling Salesman Problem".

To give the reader a sample of some current applications of the TSP, we provide a list of some of the applied (and not-so-applied, but still fun) work that has involved modules from the Concorde TSP library. (Contact: [email protected])

Collecting Coins

An old Application of the TSP is to Schedule the Collection of Coins from Payphones throughout a given Region. A modified version of Concorde's Chained Lin-Kernighan heuristic was used to solve a variety of Coin Collection Problems. The modifications were needed to handle 1-way Streets and other features of City-Travel that make the assumption that the Cost of Travel from x to y is the same as from y to x unrealistic in this scenario. (Contact: [email protected] )

Touring Airports

Concorde is currently being incorporated into the Worldwide Airport Path Finder web site to find Shortest Routes through selections of Airports in the World. The author of the site writes that users of the path-finding tools are equally split between real pilots and those using flight simulators. (Contact: [email protected])

Page 145: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 40 ElDaoushy

USA Trip

The Travel Journey for an executive of a non-profitOrganization was computed using Concorde's TSP Solver. The Trip involved a Chartered Aircraft to visit Cities in the 48 continental States plus Washington, D.C. (Commercial Flights were used to visit Alaska and Hawaii.) It would have been nice if the Problem was the same as that solved in 1954 by Dantzig, Fulkerson, and Johnson, but different Cities were involved in this Application (and somewhat different Travel Costs, since Flight Distances do not agree with Driving Distances). The data for the instance was collected by Peter Winker of Lucent Bell Laboratories.(Contact: [email protected] )

Power Cables

Modules from Concorde were used to locate Cables to Deliver Power to Electronic Devices associated with Fiber Optic Connections to Homes. Some general aspects of this Problem Area are discussed in the paper "Powering the Last Mile: An Alternative to Powering FITL". (Contact: [email protected] )

Page 146: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 41 ElDaoushy

Example 1: Consider the following Traveling Salesperson Problem with the following cost data:

From To

A

B

C

D

A 4 6 10 B 4 7 10 C 6 7 5 D 10 10 5

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic

From Node Connect To Distance/Cost

A B 4 B C 7 C D 5 D A 10

Total Minimal Traveling Distance (or Cost) = 26 ! ! !

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic

From Node Connect To Distance/Cost A C 6 C D 5 D B 10 B A 4

Total Minimal Traveling Distance (or Cost) = 25

Page 147: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 42 ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement

Heuristic

From Node Connect To Distance/Cost 1 A C 6 2 C D 5 3 D B 10 4 B A 4

Total Minimal Traveling Distance (or Cost) = 25

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Brach and Bound Method

From Node Connect To Distance/Cost 1 A C 6 2 C D 5 3 D B 10 4 B A 4

Total Minimal Traveling Distance (or Cost) = 25

Page 148: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 43 ElDaoushy

Example 2: Consider the following Traveling Salesperson Problem with the following cost data:

From To

LA

DEV

HOU

DAL

CMH

NY

LA 100 150 300 500 DEV 100 160 150 300 HOU 150 160 100 260 290 DAL 150 100 240 360 CMH 300 300 260 240 200 NY 500 290 360 200

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic

From Node Connect To Distance/Cost LA DEV 100 DEV DAL 150 DAL HOU 100 HOU CMH 260 CMH NY 200 NY LA 500

Total Minimal Traveling Distance(or Cost) = 1310

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic

From Node Connect To Distance/Cost LA HOU 150 HOU DAL 100 DAL NY 360 NY CMH 200 CMH DEV 300 DEV LA 100

Total Minimal Traveling Distance (or Cost) = 1210

Page 149: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 44 ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement

Heuristic

From Node Connect To Distance/Cost LA HOU 150 HOU DAL 100 DAL NY 360 NY CMH 200 CMH DEV 300 DEV LA 100

Total Minimal Traveling Distance (or Cost) = 1210

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method

From Node Connect To Distance/Cost LA DEV 100 DEV DAL 150 DAL CMH 240 CMH NY 200 NY HOU 290 HOU LA 150

Total Minimal Traveling Distance (or Cost) = 1130

Page 150: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 45 ElDaoushy

6.40 [7] Solve the Traveling SalesPerson Problem Consider the following Traveling Salesperson Problem with the cost data:

To City From City

1

2

3

4

5

1 M 20 4 10 25 2 20 M 5 30 10 3 4 5 M 6 6 4 10 25 6 M 20 5 35 10 6 20 M

Notice that this problem is not a “Symmetric Arc Coefficients – i.e., not “both Ways same Cost”. . . [See later for the same problem with Symmetric Arc Coefficients. . . .] Solve:

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic

From Node Connect To Distance/Profit

1 Node1 Node5 25 2 Node5 Node4 20 3 Node4 Node2 25 4 Node2 Node3 5 5 Node3 Node1 4 Total Maximal Traveling Distance or Profit = 79

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic

From Node Connect To Distance/Profit

1 Node1 Node2 20 2 Node2 Node4 30 3 Node4 Node3 6 4 Node3 Node5 6 5 Node5 Node1 35 Total Maximal Traveling Distance or Profit = 79

Page 151: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 46 ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement

Heuristic

From Node Connect To Distance/Profit 1 Node1 Node2 20 2 Node2 Node4 30 3 Node4 Node3 6 4 Node3 Node5 6 5 Node5 Node1 35 Total Maximal Traveling Distance or Profit = 79

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method

From Node Connect To Distance/Profit 1 Node1 Node2 20 2 Node2 Node4 30 3 Node4 Node3 6 4 Node3 Node5 6 5 Node5 Node1 35 Total Maximal Traveling Distance or Profit = 79

Page 152: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 47 ElDaoushy

The same example ---with “Symmetric Arc Coefficients – i.e., both ways same Cost”

To City From City

1

2

3

4

5

1 M 20 4 10 25 2 20 M 5 30 10 3 4 5 M 6 6 4 10 30 6 M 20 5 25 10 6 20 M

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic

From Node Connect To Distance/Cost

1 Node1 Node3 4 2 Node3 Node2 5 3 Node2 Node5 10 4 Node5 Node4 20 5 Node4 Node1 10 Total Maximal Traveling Distance or Profit = 49

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic

From Node Connect To Distance/Cost 1 Node1 Node4 10 2 Node4 Node5 20 3 Node5 Node2 10 4 Node2 Node3 5 5 Node3 Node1 4 Total Maximal Traveling Distance or Profit = 49

Page 153: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 48 ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement

Heuristic

From Node Connect To Distance/Cost 1 Node1 Node4 10 2 Node4 Node5 20 3 Node5 Node2 10 4 Node2 Node3 5 5 Node3 Node1 4 Total Maximal Traveling Distance or Profit = 49

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method

From Node Connect To Distance/Cost

1 Node1 Node4 10 2 Node4 Node5 20 3 Node5 Node2 10 4 Node2 Node3 5 5 Node3 Node1 4 Total Maximal Traveling Distance or Profit = 49

Page 154: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 49 ElDaoushy

6.41 [7] Solve the Traveling SalesPerson Problem

To A B C D ------------------------------------------- From A - 1 4 5 B 3 - 1 2 C 2 4 - 3 D 5 2 6 - Find the shortest circuit in the above network which meets all nodes.

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic

From Node Connect To Distance/Cost A B 1 B C 1 C D 3 D A 5

Total Minimal Traveling Distance (or Cost) = 10

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic

From Node Connect To Distance/Cost A D 5 D B 2 B C 1 C A 2

Total Minimal Traveling Distance (or Cost) = 10

Page 155: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 50 ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement

Heuristic

From Node Connect To Distance/Cost A D 5 D B 2 B C 1 C A 2

Total Minimal Traveling Distance (or Cost) = 10

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method

From Node Connect To Distance/Cost A D 5 D B 2 B C 1 C A 2

Total Minimal Traveling Distance (or Cost) = 10

Page 156: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 1 ElDaoushy

Section IV

Dynamic Programming [2,3,9]

Dynamic Programming is a Mathematical Technique that is applicable to many types of Problems. It has been used to solve Problems in Areas as Allocation, Replacement, Sequencing, Scheduling, and Inventory. A separate Algorithm is needed for each Type of Problem. Many Problems fall into the general category of Allocation Problems, so a single DP Algorithm could be used to solve Problems as Assigning Men to Jobs. On the other hand, a different Algorithm or Formulation of Equations would be needed to solve Equipment Replacement Problems. The WinQSB S/W concerns with 3 Typical Dynamic Problems:

o Stagecoach,

o Knapsack, and

o Production & Inventory Scheduling.

Stagecoach Problem: Find the Shortest Route from any Node to a Destination. Knapsack (Daypack) Problem: Find the best quantity to carry in a Knapsack to Maximize the Total Return. You may define the Return as a Function of Quantity. Production and Inventory Scheduling: Find the best Production Schedule to Minimize the Production Cost, Inventory Cost, and/or Backorder Cost. You may define the Cost as a Function of Production, Inventory, and/or Backorder.

Page 157: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 2 ElDaoushy

Stagecoach (Shortest-Route) Problem: The Dynamic Programming Approach involves the Optimization of Multistage Decision Processes (Stagecoach Problem). It divides the Problem into a number of sub-Problems or Stages.

The Decision we make at each Stage influences not only the next Stage but also every Stage to the end of the Problem.

DP actually works this Problem Backward:

Dynamic Programming starts with the Last Stage of the Problem and works backward toward the First Stage, making Optimal Decisions at each Stage of the Problem.

Whereas LP has standard ways to formulate the Problems and solve them, there is no such “Standard Approach” in DP. It is, instead, sort of a general way of solving Large and Complex Problems by breaking them down into a series of Smaller Problems which are more easily solved.

It is necessary to know when a Problem might be solved by using DP and how that Solution should be Approached.

Page 158: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 3 ElDaoushy

DP Solution to Shortest-Route (Stagecoach) Problem [2]

Atlanta Transportation Company has been awarded a contract to pick up a number of loads (lots) of woven (natural fiber) material in Atlanta and transport them to St. Louis. The map with the Alternative-Routes between the Origin (Atlanta --- node 1) and the Destination (St. Louis --- node 10) has been shown in the following figure. The arrows (or branches, as they are called) represent highways between the Nodes, each with its mileage indicated:

The Problem is to find the Shortest Route from Atlanta to St. Louis.

1

2 6

4

3

9

8

7

5 10

100

150

300

200 275

175

275 200

175

350

250

200

125

150

100 400

Highway Network

Page 159: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 4 ElDaoushy

Now, look at the following figure, where we have broken the problem into four smaller Problems (Stages) where the input/output Nodes for each Stage are identified.

1

2 6

4

3

9

8

7

5 10

100

150

300

200 275

175

275 200

175

350

250

200

125

150

100 400

Highway Networks with Problem Stages—Stage Inputs and Stage Outputs

Stage 4 Stage 3 Stage 1 Stage 2

Page 160: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 5 ElDaoushy

We begin the Solution with an examination of Stage 1 Problem. Stage 1:

Look at Node 8. There is only one route from Node 8 to St. Louis (Node 10). This is the Shortest-Route (the distance is 150 miles). Look now at Node 9. Here also one Route to Node 10 (the distance is 100 miles). Thus we have found the Optimal-Route from each input Node (8 and 9) to an output Node (10). The solution of Stage 1 is shown on the following partial network:

9

8

10

150

100

Stage 1

St. Louis

100

150

Page 161: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 6 ElDaoushy

Stage 2:

The Node we begin with at any Stage is not important, so let us start with Node 7. Only one output Node for Node 7 (which is Node 8). Therefore the Shortest Distance from Node 7 to St. Louis is 275 miles (125+150).

For Node 6, the Shortest-Distance from Node 6 to St. Louis is 300 miles (200+100). For Node 5; there are two output Nodes for Node 5 (Nodes 8 and 9). Therefore, the choice of an optimal Route between Node 5 and St. Louis is either 500 miles (400+100) or 400 miles (250+150). Route 5-8-10 is the Optimal one.

Note: we have solved Stage 2 Problem by using the output from Stage

1 Problem (the Optimum Distances 100 and 150 miles). We did not have to measure distances all the way from Stage 2 Nodes to St. Louis to find the Shortest Route, only from Stage 2 Nodes to Stage 1 Nodes.

6

9

8

7

5 10

250

200

125

150

100 400

Stage 2

St. Louis

100

150

300

400

275

Page 162: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 7 ElDaoushy

Stage 3:

Start with Node 2. Using the Optimum Answers for Nodes 6 and 5 from Stage 2 (300 and 400 respectively), we evaluate Routes 2-6 and 2-5 and choose 2-6 (300 +300 < 275+400). Looking at Node 4, there are 3 choices. The Optimum-Route is 4-6 (500 < 575 or 550).

For Node 3, the Route 3-5 (600) is the Optimum One.

Note: Again, we have solved Stage 3 Problem by using the outputs

from Stage 2 Problem (the Optimum Distances 300 and 400, and 275 miles). We did not have to measure distances all the way from Stage 3 Nodes to St. Louis to find the Shortest Route, only from Stage 3 Nodes to Stage 2 Nodes.

2 6

4

3

9

8

7

5 10

300

200 275

175

275 200

350

250

200

125

150

100 400

Stage 3

100

150

275

400

300 600

500

600

Page 163: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 8 ElDaoushy

Stage 4:

There is only one input Node in this Stage (Node 1). We have three choices (route 1-2, 1-4, or 1-3). Using the output of Stage 3, we choose route 1-4 (650 < either 700 or 775).

The Shortest Route:

Combining answers from the four Stages to find the Shortest Route. Now let us go through the Network from Stage 4 to Stage 1 and pick the best decision at each Stage. You can see that the Shortest Route between Atlanta and St. Louis is 1-4-6-9-10 with a Total Distance of 650 miles.

1

2 6

4

3

9

8

7

5 10

100

150

300

200 275

175

275 200

175

350

250

200

125

150

100 400

Stage 4

650

600

500

600

300

400

275

100

150

Page 164: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 9 ElDaoushy

Solution Using WinQSB S/W (Dynamic Programming): There are three Types of Problems that can be solved with this S/W:

o Stagecoach (Shortest Route) Problem. o Knapsack Problem. o Production and Inventory Scheduling.

To solve the Stagecoach Problem, it can be summarized in the following table:

From\To Node 1

Node 2

Node 3

Node 4

Node 5

Node 6

Node 7

Node 8

Node 9

Node 10

Node1 100 175 150 Node2 275 300 Node3 200 350 Node4 175 200 275 Node5 250 400 Node6 200 Node7 125 Node8 150 Node9 100 Node10

Solution for Example Page 412 [2]: Stagecoach-Shortest Route Problem From To Distance Cumulative Distance to Stage Input State Output State Distance Node10 1 Node1 Node4 150 150 650 2 Node4 Node6 200 350 500 3 Node6 Node9 200 550 300 4 Node9 Node10 100 650 100 From Node1 to Node10 Min. Distance = 650

Hint:

WinQSB enables you to choose any Start and Destination Nodes in the given map to find the Shortest Route between them.

Page 165: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 10 ElDaoushy

Knapsack (bag) Problem: (http://www.tutor.ms.unimelb.edu.ua/knapsack/knapsack_welcome.html)

If you have never heard about this problem, you might be interested in taking a quick look at the formal definition given below.

The name derives from the following interpretation:

Suppose that you have a knapsack and you wish to fill it up with available items so as to maximize the total value of the items in the knapsack subject to the weight constraint, requiring that the knapsack not to exceed a prescribed total weight.

What Items should be selected?

There are several versions to this Problem related to the Availability of Items. In particular, the 0-1 Version represents a situation where only one item of each type is available or can be selected. The unbounded case, which we consider here, assumes that there are n types of Items and that there are infinitely many Items of each type. The raw input data for this “Version” consists of the following:

The Maximum Allowable Weight, W. The Weight of each item of Type i, wi, i=1,2,...,n. The Value of each Item of Type i, vi , i=1,2,...,n.

Here is the formal picture: Max v1x1 + v2x2 + ... + vnxn s.to: w1x1 + w2x2 + ... + wnxn <= W & x1,...,xn >= 0 & integer

The weights w1,...,wn of the Items as well as the maximum allowable weight of the Knapsack, W, are assumed to be non-negative integers.

Page 166: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 11 ElDaoushy

Recall that, as indicated above, the "Unbounded Version” of the Knapsack Problem allows you to select as many items of each Type as you wish, subject to the Total Volume Constraint.

The Functional Equation of Dynamic Programming is derived by regarding the Total Weight, W, as a parameter. In other words, we define:

f(w):= max { v1x1 + v2x2 + ... + vnxn}, w=0,1,...,W s.to: w1x1 + w2x2 + ... + wnxn <= w & x1,...,xn in {0,1,2,3,...}

Then, clearly (as they say in the books), the following must be true:

f(s) = 0 , s < w*:= min { wi: i=1,2,...,n } f(s) = max { vi + f(s - wi) : i in D(s)} , w* <= s <= W D(s):={i: wi <= s} , s >= w* This is the famous Dynamic Programming Functional Equation for the

Knapsack Problem.

Page 167: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 12 ElDaoushy

Example: Consider the following Problem to be solved by WinQSB: Input Data:

Item Item Units Unit Capacity Return (Stage) Identification Available Required Function

1 A 5 10 8A 2 B 3 6 10B 3 C 4 3 4C 4 D 2 5 7D Knapsack Capacity = 20

Hint: The “Units Available” column is an optional Constraint . . . . . Solution for Knapsack Problem 02-27-2005 Item Decision Return Total Item Capacity Stage Name Quantity Function Return Value Left 1 A 0 8A 0 20 2 B 2 10B 20 8 (20 – 2*6 --- 6 = capacity of each item of B) 3 C 1 4C 4 5 (8 – 1*3) 4 D 1 7D 7 0 (5 – 5) Total Return Value = 31 Hint: This Problem can be stated as an Integer Linear Programming Problem which gives the same result as follows:

Max. z = 8A + 10B + 4C + 7D s.to: 10A + 6B + 3C + 5D = 20 A <= 5 B <= 3 C <= 4 optional part D <= 2 & A, B, C, D >= 0 and Integer

Page 168: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 13 ElDaoushy

6.38 [7] Solve the Knapsack Problem (Dynamic Programming/Knapsack Problem) Consider a set of 5 indivisible items, each having the weight and value units given

below: Item No. Weight Value 1 18 27 2 12 9 3 15 30 4 16 16 5 13 6.5 The problem is to fill a knapsack with these items so as to maximize its total value

without exceeding a total weight of 45 units. Solving By WinQSB(Dynamic Programming---Knapsack Problem) DP Example Stage Item Available Capacity Required Return Function 1 a M 18 27a 2 b M 12 9b 3 c M 15 30c 4 d M 16 16d 5 e M 13 6.5e Knapsack Capacity = 45

Solution Solution for DP Example: Knapsack Problem 02-28-2005 Item Decision Return Total Item Capacity Stage Name Quantity Function Return Value Left 1 a 0 27a 0 45 2 b 0 9b 0 45 3 c 3 30c 90 0 4 d 0 16d 0 0 5 e 0 6.5e 0 0 Total Return Value = 90

Page 169: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 14 ElDaoushy

Solving By ILProgramming Variable --> X1 X2 X3 X4 X5 Direction R. H. S. Maximize 27 9 30 16 6.5 C1 18 12 15 16 13 = 45 Variables Type Integer Solution 1 X1 0 2 X2 0 3 X3 3.0000 (Decision Making Problem...) 4 X4 0 5 X5 0 Objective Function(Max.) = 90.0000

Page 170: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 15 ElDaoushy

6.39 [7] Solve the Knapsack Problem A climber wishes to go on a camping trip and does not wish to carry more than 60 pounds in his pack.Unfortunately in laying out his equipment, he finds its total weight to be 90 pounds. There are 3 objects he wants to take, so in order to decide which combination is best, he attaches a value to each. Suppose his data looks like this:

Object Value Weight Value/Weight 1 70 40 1.75 2 50 30 1.67 3 30 20 1.5 Solving By WinQSB(Dynamic Programming---Knapsack Problem) DP Example (Input Data) Stage Item Available Capacity Required Return Function 1 X1 M 40 70*X1 2 X2 M 30 50*X2 3 X3 M 20 30*X3 Knapsack Capacity = 60 Solution for DP Example: Knapsack Problem 04-17-2005 Item Decision Return Total Item Capacity Stage Name Quantity(X) Function Return Value Left 1 X1 0 70*X1 0 60 2 X2 2 50*X2 100 0 3 X3 0 30*X3 0 0 Total Return Value = 100 (Decision Making Problem...)

Page 171: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 16 ElDaoushy

This problem can be formulated as a LP model as: Max. Z = 70X1 + 50X2 + 30X3 s.to 40X1 + 30X2 + 20X3 = 60 & X1,X2,X3 >=0 and integer

One way of getting a feasible solution to the problem is to take as many units as possible of the most valuable item first (i.e., the one with the largest value/weight ration), then as many of the second as possible, and so on. If this is done for the given problem, the solution is:

X1 = 1, X2 = 0, X3 = 1 and Z = 100.

Note that there is an alternative solution with the same objective value for which:

X2 = 2, X1 = 0, and X3 = 0.

(Coincide with the WinQSB solution DP & ILP in case of actual values)

The first solution is the largest-ratio solution. The largest-ratio rule gives the

optimum answer quite often.

Page 172: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 17 ElDaoushy

Another Problem (prepared by Dr. M. ElKafrawy, INP) DP DP Example Stage Item Available Capacity_Required Return_Function 1 a M 2 65a 2 b M 3 80b 3 c M 1 30c Knapsack Capacity = 5 Solution Solution for DP Example: Knapsack Problem 02-28-2005 Item Decision Return Total Item Capacity Stage Name Quantity(X) Return Value Left 1 a 2 65a 130 1 2 b 0 80b 0 1 3 c 1 30c 30 0 Total Return Value = 160 Hint: The same solution can be found by solving the problem as an ILP Problem with one constraint….

Page 173: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 18 ElDaoushy

Production and Inventory Scheduling Problem: [9]

The Production and Inventory Problem is to determine a Production Schedule for a specific series of time periods to Minimize the Total related Costs.

There are known demands for each period. Typically, there are capacity limits for production and inventory (storage).

When there is more production than demand, inventory will be cumulated,

and when there is less production than demand, backorder will be generated.

For each period, a nonzero production may deserve setup cost.

In DP, the variable cost is expressed as a function of production(P), inventory(H), and backorder(B).

Let:

P(n): number of units Produced in period n. D(n): Demand in period n. H(n): on-Hand inventory at the end of period n. B(n): Backorder at the end of period n. I(n): Inventory position at the end of period n, i.e., I(n) = H(n) or I(n) = B(n) I(n) = I(n-1) + P(n) – D(n). S(n): Setup cost in period n. V( P(n),I(n) ): Variable cost = function of P(n), H(n) , and/or B(n)

C( n,P(n),I(n) ): = S(n) + V( P(n), I(n) ) if P(n) > 0, = V( P(n), I(n) ) if P(n) = 0. f(n,i): cumulative total cost given I initial Inventory level for period n.

Page 174: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 19 ElDaoushy

The dynamic recursive relationship is expressed as: f(n,i) = max{ C( n, P(n), I + P(n) – D(n) + f(n-1), I + P(n) – D(n) ) } for all possible P(n) Note that you can define the variable cost function as a function of P, H, and/or B with operations +, -, *, /, ^ (exponentiation), mod, the scientific function ABS(absolute value),

ATN (arctangent), COS (cosine), EXP (exponential), LOG (natural logarithm), SIN(sign value), SQR (square root), TAN (tangent), . . . etc.

DP QSB Stage Period Demand Production Storage Production Capacity Capacity Setup Cost Cost Function 1 January 4 6 4 500 300P+100H 2 February 5 4 3 450 320P+100H 3 March 3 7 2 500 250P+120H 4 April 4 5 4 600 350P+140H Solution for QSB: Production and Inventory Scheduling Problem

Period Starting Production Ending Setup Variable Cost Variable Total Stage Description Demand Inventory Quantity Inventory Cost Function (P,H,B) Cost Cost (P) (H) (X) (Y) (X + Y) 1 January 4 0 5 1 $500.00 300P+100H $1,600.00 $2,100.00 2 February 5 1 4 0 $450.00 320P+100H $1,280.00 $1,730.00 3 March 3 0 3 0 $500.00 250P+120H $750.00 $1,250.00 4 April 4 0 4 0 $600.00 350P+140H $1,400.00 $2,000.00 Total 16 1 16 1 $2,050.00 $5,030.00 $7,080.00 300 * 5 + 100 * 1 320 * 4 + 0 250 * 3 + 0 350 * 4 + 0

Page 175: Problem Solving & Decision Making Support

Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 20 ElDaoushy

References

1. Moharram W. Mahmoud & Nadia M. Girgis A First Course in Linear Programming, Institute of National Planning, Cairo, Egypt, 1970

2. Richard I. Levin & Charles A. Kirkpatrick Quantitative Approach to Management, 4th Edition, 1978

3. Billy E. Gillett Introduction to Operations Research. A Computer-Oriented. Algorithmic Approach, 1988

4. M. Yehia Abdel Rahman Computers in Designing an Optimal Pipeline Networks, Memo. No. 1500, Institute of National Planning, Cairo, Egypt, 1989

5. El-Shafei, A. OR in Developing Economies: Some experience with applying OR in Egypt’s national planning studies. Memo. No. 1118, Institute of National Planning, Cairo, 1975.

6. Manne, A. S. & Morkowitz H. M. Studies in process analysis, Monograph 18, Jone Willy & Sons, N.Y, London, 1961.

7. Staff of Research and Education Association, Dr. M. Fogiel, Director The Operations Research Problem Solver Research and Education Association, 505 Eighth Avenue, New York, N.Y. 10018

8. Abdalla A. ElDaoushy, Solving SalesPerson Problem with Artificial Intelligence Techniques, Memo No.(1575), March 1994, Institute of National Planning, Cairo, EGYPT.

9. Yih-Long Chang (e-mail: [email protected]) WinQSB --- Quantitative Software for Business (available on the Internet) John Wiley and Sons, Inc.

Prof. Yih-Long Chang has a Ph.D. from the University of Texas at Austin, May 1985. Major Field: Operations Management. Supporting Fields: MIS, Management Science. Now, he is working as a professor at Dupree College of Management, Georgia Institute of Technology. Atlanta, Georgia 30332-0520 (404)894-4334