Memo No (963

)

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

Contents

Section I Introduction . . . . . . Classification of Problems in Operations Research Sequencing Problems . . . Allocation Problems . . . Routing Problems . . . . Replacement Problems . . . Inventory Problem . . . . Queuing Problems . . . Competitive Problems . . . Search Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page I-1 I-1 I-2 I-8 I-10 I-11 I-11 I-11 I-12 I-12

Section II Mathematical Modeling in Operations Research . . . Linear Programming Models (LP). . . . . . Formulation of Linear Programming Models . . . . Some Examples of LP Models . . . . . . Diet (Nutrition) Problem . . . . Television Problem . . . . . Product Mix Problem . . . . . Truck Production Problem . . . . Crop Farm Organization Problem . . . Machine Scheduling Problem . . . Petroleum Refining Problem . . . . Graphical Solution of a LP Models . . . . . Classification and Properties of Solutions (the way to the Simplex Method) . Extreme-Point Solutions & Basic Feasible Solutions An Optimal Solution . . . . . The Simplex Method . . . . . . . Integer LP Models --- Examples. . . . . . Non-LP Models --- Examples . . . . . . Quadratic Programming Models --- Examples . . . Integer Quadratic Programming Models --- Examples . . Goal Programming. . . . . . . .
ii

II-1 II-2 II-3 II-4 II-4 II-7 II-8 II-11 II-13 II-16 II-18 II-26 II-41 II-44 II-54 II-58 II-71 II-73 II-74 II-75 II-76

Section III Network Modeling . . . . . . . . Manufacturing and Transportation . . . . The Transportation Problem . . . . . The Assignment Problem . . . . . The Minimal Spanning Tree Problem & the Pipeline Networks Pipeline Networks . . . . . . Traveling SalesPerson Problem . . . . . Section IV Dynamic Programming . . . Stagecoach Problem . . Knapsack Problem . . . Production and Inventory Scheduling References . . . . . III-1 III-1 III-2 III-11 III-17 III-31 III-36

. . . . .

. . . . .

. . . . .

. . . . .

IV-1 IV-2 IV-10 IV-18 IV-20

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

iii

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems) I-1

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 Machine 1 Machine 2 Sequence 20 4 1 10 12 2 3 5 3 10 8 4 5 6 5 2 12 6 8 4 7 7 10 8 3 6 9 4 1 10 Have a look on “Job-Shop” Problem on the Internet………
Problem Solving & Decision Making Using Computer (Selected Real World Problems) I-2

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 Machine 1 Seq. Time Time in out 20 1 0 30 2 20 33 3 30 43 4 33 48 5 43 50 6 48 68 7 50 65 8 58 68 9 65 10 68 72 Machine 2 Time Time in out 20 24 30 42 42 47 47 55 55 61 61 73 73 77 77 87 87 93 93 94 Idle time on machine 2 ‫ﺍﻟﻮﻗﺖ ﺍﻟﻀﺎﺋﻊ‬ 20 6 (i.e., 30-24) 0 0 0 0 0 0 0 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

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

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. 2. 3. 4. 6-3-9-5-8-2-4-1-7-10 or 6-9-5-5-8-2-4-1-7-10 or 6-3-9-5-8-2-4-7-1-10 or 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! ! !

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

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

Machine 1 Job Time Time in out 2 6 0 5 3 2 8 9 5 13 5 8 20 8 13 30 2 20 40 4 30 60 1 40 68 7 60 72 10 68

Machine 2 Time Time in out 2 14 14 19 19 25 25 31 31 41 41 53 53 61 61 65 68 72 72 73

Idle time on machine 2 2 0 0 0 0 0 0 0 3 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.

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

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 1 2 3 4 5 6 7 8 9 10 Job Job Job Job Job Job Job Job Job Job Job Name 1 2 3 4 5 6 7 8 9 10 Operation 1 Operation 2 20 4 10 12 3 5 10 8 5 6 2 12 8 4 7 10 3 6 4 1

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

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……

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

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 2 4 3 2

Person A Person B

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 2 8 5 Job 2 6 4 7 Job 3 3 9 8

Person A Person B Person C

......... ‫ﻣﺜﺎﻝ: ﺍﻟﻌﻤﺎﻝ ﻓﻲ ﻣﺼﻨﻊ ﻧﺴﻴﺞ‬

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

ElDaoushy

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

3!
Total Effectiveness

A:1 B:2 C:3 14

A:1 B:3 C:2 18

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

A:3 B:1 C:2 18

A:3 B:2 C:1 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.

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

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?

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

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.

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

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.

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

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.

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

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.

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

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: Optimize Subject to: & 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 =. Z = ∑ cj x j
j=1 n

j=1

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

n

or, in details: Optimize Z = c1 X1 + c2 X2 + c3 X3 + . . . + cn Xn
s.to:

a11 X1 + a12 X2 + a13 X3 + . . . + a1n Xn a21 X1 + a22 X2 + a23 X3 + . . . + a2n Xn a31 X1 + a32 X2 + a33 X3 + . . . + a3n Xn
...

(*) (*) (*) (*)

b1 b2 b3 bm

Am1 X1 + am2 X2 + am3 X3 + . . . + amn Xn
&

X j >= 0 for all values of j

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

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?

Vegetable Green Beans ‫ﻓﺎﺻﻮﻟﻲ‬ ‫ﺍ‬ Carrots ‫ﺟﺰﺭ‬ Broccoli Cabbage ‫ﻛﺮﻧﺐ‬ Beets ‫ﺑﻨﺠﺮ‬ Potatoes Min Weekly Requirements Iron 0.45 0.45 1.05 0.4 0.5 0.5 6 mg

Units of Nutrient per Unit of Weight Vitamin Phosphorus A C Niacin 10 415 8 0.3 28 50 25 22 75 325 mg 9065 2550 75 25 235 17,500 usp 3 53 27 5 8 245 mg 0.35 0.6 0.15 0.25 0.8 5.0 mg

Cost/ unit of weight 5 5 8 2 6 3

Hint: Repeating implicitly represents Weight……

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

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

12 Constraints

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

ElDaoushy

Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 4 X2 = 1.7 X3 = 2.3 X4 = 2 X5 = 0 X6 = 4
& Z = 62.9

real number; must be integer…..

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 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……………………………

!!!! Decision Maker Opinion* !!!!

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

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 I 1.0 II 1.5 III 4.0 Available 2000 Max. s.to Time Min. required no of units 2.0 200 1.2 250 1.0 100 1000 Profit 10 14 12

Z = 10X1 +14X2 + 12X3 X1 + 1.5X2 + 4X3 <= 2000 2X1 + 1.2X2 + X3 <= 1000 X1 >= 200 X2 >= 250 X3 >= 100 . . .raw materials . . .time

& all Xj >= 0. Solution Using WinQSB S/W (Linear Programming): X1 = 200 X2 = 250 X3 = 300
&

Z = 9,100

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

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 Carpentry Painting Finishing Profit/Unit A X1 2 1 2 1.2 B X2 3 2 2 2.0 C X3 4 2 3 1.8 D X4 4 3 3 4.0 Capacities 6000 4000 5000

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

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, Maximize Z = ∑ cj Xj
j=1 n

s.to
j=1

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

n

&

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

ElDaoushy

Solution Using WinQSB S/W (Linear and Integer Programming)): X1 = 0 X2 = 0 X3 = 0 X4 = 1,333.333
&

Decision Making Problem ! . ! . ! . .

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 ...

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

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 I II III IV V Final Assembly Constraint 7500 5000 1000 9000 3000 Ratio to type I (Metal Stamping) 1.0 1.4 2.0 0.8 2.2
10,000

Ratio to type I (Engine Assembly) 1.0 1.6 3.0 1.0 2.6
15,000

Profit $350 450 500 300 400

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

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 X4 = 9,000 X5 = 0
&

Decision Making Problem* ! . ! , ! .

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….

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

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.

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

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 A Farm 1 2 3 Max. Area devoted to each Crop X1A X2A X3A 70 X1B X2B X3B 80 X1C X2C X3C 30 40 60 30 B C Usable Area of each Farm

Water Consumption Crop \ Farm 1 2 3 Profit/Feddan

2

3

1 Water Available in feddan-inch 150 180 100

A X1A X2A X3A 400,000

B X1B X2B X3B 300,000

C X1C X2C X3C 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.

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

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 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 X2A = 40 X3A = 30 X1C = 0 X2C = 0 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… X1B = 40 X2B = 20 X3B = 0 Decision Making Problem! . ! , ! . 9 Variable & 9 Constraints

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

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 Product Type 1 5 1 5 2 6 3

Machine 2 3 6 4 4 5 7 2

4 3 4 8

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 Machine Type 1 2 3 4 Demand 8 2 4 9 1 700 7 6 6 3 2 500 4 8 5 2 3 400 Available 90 75 90 85 Time

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 . . .

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

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 4X31 + 8X32+ 5X33 + 2X34 = 400 X11 + X21 + X31 X12 + X22 + X32 X13 + X23+ X33 X14 + X24+ X34 & all Xij >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X11 = 70.1190 X21 = 0 X31 = 19.8810
&

…demand constraints

<= 90 <= 75 <= 90 <= 85

…hour constraints

X12 = 56.1905 X22 = 0 X32 = 18.8095

X13 = 6.6667 X23 = 83.3333 X33 = 0

X14 = 0 X24 = 0 X34 = 85.0000

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

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

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.

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

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.

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

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.

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

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:
j=1

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

n

&

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.

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

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 submatrices 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.

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

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 .

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

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.

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

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].

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

ElDaoushy

Graphical Solution of LP Models [1]
We know that a Linear Programming Model consists of three parts: (i) (ii) An objective function (linear) to be maximized or minimized. 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 programming 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 + s.to: X1 ≤4 X2 ≤ 6 3X1 + & X1 ≥ 0, 2X2 ≤ 18 X2 ≥ 0 5X2

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 Fig.(1) X2

X1

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

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 . X2

0 X2 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 nonnegativity constraints.

Fig.(2)

X1

0

Fig.(3)

X1

Next let us consider the structural constraints: 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

X2

0 Fig.(4)

X1

X2

0 Fig.(5) fig. (5)
Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 27 ElDaoushy

X1

Take 3X1 + 2X2 ≤ 18. The straight line 3X1 + 2X2 = 18 divide the plane into two parts. The inequality 3X1 + 2X2 < 18 represents that part containing the origin as shown in Fig.(6)*. All the points (X1, X2) on the straight line 3X1 + 2X2 = 18 satisfy the above constraint.
0F

X2

0 Fig.(6)

X1

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 polygon and on the boundary side satisfy the structural and non-negativity constraints. In other words these points satisfy: X1 3X1 + & X1 ≥ 0 , X2 2X2 X2 ≤4 ≤6 ≤ 18 ≥0.

X2 d c b

o

Fig.(7)

a

X1

All such points form what we call the set of feasible solution for the given example. This set contains an infinite number of solutions. The points: o ≡ (X1 = 0, X2=0) , b ≡ (X1 = 4, X2=3), 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 ) Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 28

a ≡ (X1 = 4, X2=0) c ≡ ( X1 = 2, X2=6)

ElDaoushy

Finally, let us consider the objective function The question is: which particular solution(s) will maximize the objective function: f(X) = 3X1 + 5X2 ? To answer this question by the graphical method, it is clear that the objective function (not an equation) cannot be drawn on a graph. But, fortunately 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 feasible 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 Xd 2

c b

f

o

g Fig.(8)

a

X1

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

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 maximum value of the function and therefore it represents the optimal solution . 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 nonnegativity constraints is the solutions that satisfy all these constraints.

(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 maximizes or minimizes the objective function.

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

ElDaoushy

Example 2:
Determine the value of X1, X2 that minimizes the objective function f(X) = 3X1 – s.to X1 + X1 – X2 X2 ≥ 3 X2 ≤ 1 X2 ≤ 2

&

X1 ≥ 0, X2 ≥ 0

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

g

aa

c

b

o f Fig.(9)

X1

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)
Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 31

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 objective 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 optimal solution. This point is: c ≡ (X1 = 3, X2 = 3) and the corresponding value of the objective function is: f(X) = 3*3 – 2 = 7 which is the maximum value of f(X)

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

ElDaoushy

Example 3:
Determine the value of X1 , X2 that maximizes: f(X) = 4X1 – s.to -X1 + X1 – X1 – & 2X2 X2 ≥ -6 4X2 ≤ 2 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 procedure as in the above example, both sides of the constraints should be multiplied 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).

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

ElDaoushy

X2

g c d b o f a X1

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

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

ElDaoushy

Example 4:
Determine X1 and X2 that maximize the objective function f(x) = 3X1 + s.to X1 3X1 + X1 ≥ 0 ≤4 X2 ≤ 6 2X2 ≤ 18 X2 ≥ 0 g 2X2 X2 d c b

&

o

f

a Fig.(11)

X1

In this example the polygon oabcd represents the set of feasible solutions and the objective function has the same slope as third structural constraint. Then fg will be parallel to bc. Hence, on shifting fg parallel to itself, 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.

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

ElDaoushy

Example 5:
Determine X1 and X2 that minimize: f(X) = 2X1 + s.to 3X1 + X1 + & 2X2 ≤ 12 X2 = 5 X2

X1 ≥ 0, X2 ≥ 0.

X2

b c e g o
f

a Fig.(12)

d

X1

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

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

ElDaoushy

Example 6:

Determine X1 and X2 that maximize: f(X) = 6X1 + s.to X1 + 2X2 = 8 = 10 =4 4X2

2X1 + X2 X1 &

X1 ≥ 0, X2 ≥ 0.

X2

a g o

f

Fig.(13)

X1

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)

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

ElDaoushy

Example 7:
Determine X1 and X2 that minimize: f(X) = X1 + s.to X1 + X1 2X1 & X2 ≥ 4 2X2 ≤ 2 X2 ≥ 4 4X2

X1 ≥ 0, X2 ≥ 0. X2

a b g o f Fig.(14) X1

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 objective 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.

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

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 optimal mix product using the graphical method. The above information can be arranged in the following table : Models Process I II Profit / Unit A 2 2 10 B 1 3 20 Available hours 20 30

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 + s.to 2X1 + 2X1 + & X1 ≥ 0, X2 c b 20X2 X2 ≤ 20 3X2 ≤ 30 X2 ≥ 0.

g o f Fig.(15)
Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 39 ElDaoushy

a X1

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 satisfying 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)

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

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 problem 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 extremepoint 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:

∑a
j =1

n

ij

x j ≤ bi ; 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 convex set. In other words, the structural and the non-negativity constraints form a convex polygon.

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

ElDaoushy

Consider as an example, the following constraints: X1 ≤ 4 X2 ≤ 6 3X1 + 2X2 ≤ 18 and X1 ≥ 0, X2 ≥ 0. X2 d These are represented graphically by the polygon oabcd in Fig.(1) . If we take any two points inside this polygon 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 polygon. Thus oabcd is a convex polygon. c

g h

b

o Fig.(1)

a

X1

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. h

Fig(2)

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”

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

ElDaoushy

It can be easily shown that this property is satisfied in the twodimensional 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 a2 1 A= . . . am1

a12 a22 . . . am2

... ... ... ... ... ...

a1n a2n . . . amn

X1 X2 ,X= . . . Xn , P0 =

b1 b2 . . . bm

0 0 , O= . . . 0

For more details, refer to [1]

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

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. b d X2 g c f

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 joining two other points in the set. Therefore none of them can be expressed as a convex combination of any other two points in the set.

o

a

e

X1

Fig.(3)

These points are actually the intersection of two adjacent sides of the polygon. 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 inequalities 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-

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

ElDaoushy

dimensional space and the intersection of sets of three planes in a threedimensional space and so on. It should be noticed that the converse is not true, i.e. the points of the intersection of two adjacent sides (in a two-dimensional space) is not necessary an extreme-points, because it may not satisfy all the other constraints. 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 follows: 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 constraints. 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 variables & m structural constraints, where the total number of constraints, including the non-negativity constraints, is m + n. An extreme-point solution 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.

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

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) (4) X1 ≥ 0, X2 ≥ 0.

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 constraint is equal to the right hand side. But, each quantity being negative 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. Consequently the quantities X3, X4 and X5 should be non-negative, That is: X3 ≥ 0, X4 ≥ 0 and X5 ≥ 0 .

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

ElDaoushy

Accordingly, we come to the following two important remarks: (i) Any violation of a structural constraint will happen if the associated slack variable has a negative value. (ii) The use of any structural constraint to determine an extremepoint solution should be associated with the fact that its corresponding slack variable is zero. As an illustration: Consider the above two constraints: X1 ≤ 4 X2 ≤ 6 (1) (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) (3) 3X1 + 2X2 ≤ 18

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

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

ElDaoushy

None of these values is negative, therefore this solution is an extremepoint 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

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

ElDaoushy

Repeating this for all the possible cases we find that:

X1 = 0, X2 = 0 o≡ X3 = 4, X4 = 6 , X5 = 16 X3 = 0, X5 = 0 b≡ X3 = 4, X2 = 3 , X4 = 3 X1 = 0, X4 = 0 d≡ X2 = 6, X3 = 4, X5 = 6 are the extreme-point solutions. c≡ a≡

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

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

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

ElDaoushy

These constraints can be converted into equations by adding the slack variables Xn+1 , Xn+2 , ... ¸ Xn+m as follows:

a11X1 + a12X2 + ... + a1nXn + Xn+1 a21X1 + a22X2 + ... + a2nXn . . ... . . . . ... . . am1X1 + am2X2 + ... + amnXn + &

+ Xn+2 . . . . + Xn+m = bm

= b1 = b2

Xj ≥ 0 , j = 1,2 , ...,n , n+1 , ... , n+m

An extreme-point solution is simply the result of solving a simultaneous of m equations in m variables.

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

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 variables 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 equations) The m variables are referred to as basic variables (the dependent variable) 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 determining the extreme-point solution that it is consistent with the definition of the basic feasible solution. Thus a basic feasible solution is an extremepoint solution.

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

ElDaoushy

As an illustration, take the same problem where the constraints are X1 X2 3X1 + 2X2 & X1 ≥ 0, ≤4 ≤6 ≤ 18

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 nonbasic or the independent variables & X3, X4, X5 are the basic or dependent 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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems) II - 52

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 o a b c d X1 = 0 , X2 = 0 , X3 = 0 , X4 = 0 , X1 = 0 , X2 = 0 X3 = 0 X5 = 0 X5 = 0 X4 = 0

Basic Variables X3 = 4 , X1 = 4 , X1 = 4 , X1 = 2 , X2 = 6 , X4 = 6, X4 = 6, X2 = 3, X2 = 6, X3 = 4, X5 = 18 X5 = 6 X4 = 3 X3 = 2 X5 = 6

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

ElDaoushy

Remarks:
(1) The solution where the slack variables are selected as basic variables 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 optimizes the value of the linear objective function. Mathematically, 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 .

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

ElDaoushy

Example 1:
Suppose it is required to determine X1 and X2 that maximize f(X) = 3X1 + 5X2 s.to: X1 X2 ≤ 4 ≤ 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 solution in the above objective function we find that At At At At At "o", "a", f(x) = 3 (0) + 5 (0) = 0. f(x) = 3 (4) + 5 (0) = 12.

"b", f(x) = 3 (4) + 5 (3) = 27. "c", f(x) = 3 (2) + 5 (6) = 36. "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).

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

ElDaoushy

Example 2:
Find X1 and X2 that maximize the objective function: f(X) = 5X1 s.to: 3X1 X1 2X2 ≤ 12 5X2 ≤ 6 - 2X2

-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 variables X3, X4 and X5 . These constraints become: 3X1 - 2X2 + X3 X1 - 5X2 +X4 -X1 + 2X2 = 12 = 6 +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

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

ElDaoushy

Now, we can summarize the above discussion as follow :

1- Any linear programming problem has an infinite number of solutions 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 variables, and Basic variables which are the dependent or the non-zero variables.

Going from one basic feasible solution to another, one of the nonbasic variables becomes basic and one of the basic variables becomes 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 feasible solutions, because it always leads to a better basic feasible solution until the optimal solution is obtained. This method will be discussed in the next section.

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

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 ∑ aij xj (>=,=,<= ) bi ;
j=1 n

bi >= 0 for all values of i =1, . . , m

& all xj >= 0. It can be converted to the equivalent LP model: Optimize Z = ∑ cj xj
j=1

s.to ∑ aij xj = bi
j=1 n

for all values of i =1, . . ., m

& 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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 58

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 59 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: Linear and Integer Programming. Quadratic Programming. Non-Linear Programming. Network Modeling. 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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 60

1. 2. 3. 4. 5.

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 Television Problem Product Mix Problem (page II-5) (page II-7) (page II-9) (page II-12) (page II-15)

Truck Production Problem

Crop Farm Organization Problem

Machine Scheduling Problem (page II-17)

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

ElDaoushy

3.9 [7] Solve by Simplex Method Max. 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 Z = X1 + 2X2 + 3X3 + 4X4

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

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 $.17 $.18 Plant I $.25 $.18 $.14 Plant II $.25 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 B X2 X5 400

Plant I Plant II Total Demand

A X1 X4 300

C X3 X6 500

Supply 850 650

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

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 + X1 X2 X3 & Xj >= 0 X2 + X3 X4 + + X4 X5 + + X5 <= 850 X6 <= 650 = 300 = 400 + X6 = 500

Multiple Solutions exist . . . (comes from “Results/Obtain Alternate Optimal”) . . . . X1 X2 X3 X4 X5 X6 Z Hint: This Problem can also be formulated and solved as a Transportation Problem even though ∑S > ∑D. See Later. . . . 300 400 0 0 0 500 213 150 400 0 150 0 500 213 300 400 0 0 0 500 213 .... .... .... .... .... 213

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

ElDaoushy

3.15 [7] Solve by Simplex Method Max. 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….) Z = 3X1 + X2 + 9X3 - 9X4

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

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. s.to X1 + X2 <= 20 X1 + 4X2 < = 40 & Xj >= 0. Solution Using WinQSB S/W (Linear and Integer Programming): X1 = 13.3333, ! ! ! Decision Maker . . . . X2 = 6.6666, and Z = 133.333 . . . . material constraint . . . . labor constraint Z = 6X1 + 8X2 ... the profit objective

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

ElDaoushy

3.18 [7] Solve by Simplex Method Max. 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. Z = 3X1 + X2 + 3X3

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

ElDaoushy

3.20 [7] Solve by Simplex Method Max. 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. Z = 3X1 + 2X2 + 5X3

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

ElDaoushy

3.21 [7] Solve by Simplex Method Min. s.to X1 & 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. + X3 - X4 +2X5 = 2 X2 - X3 + 2X4 - X5 = 1 Z= - X3 - X4 - X5 + 11

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

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 mantime. 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. s.to Z = 5X1 + 6X2 + 14X3 3X1 + X2 + 2X3 <= 48 3X1 4X2 + 3X3 <= 120 2X1 + 4X2 + X3 < = 80 & 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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 70

time. . . time. . . Labor. . .

ElDaoushy

Integer LP Problems --- Examples
6.48 [7] Solve by Integer LP Problem Max. s.to Z = 3X1 + 13X2 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 Variable X1 X2 Solution Value 2.0000 4.0000

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

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

ElDaoushy

6.10 [7] Solve by Integer LP Problem Max. s.to X1 + X2 + X3 + X4 <= 8 2X1 + X2 +3X3 <= 12 5X2 + X3 + 3X4 <= 6 X1 <= 1 X2 <= 1 <= 4 X3 X4 <= 2 & Xj >= 0 and integer Z = 6X1 + 3X2 + X3 + 2X4

Solution Using WinQSB S/W (Linear and Integer Programming):
Decision Variable 1 2 3 4 X1 X2 X3 X4 Solution Value 1.0000 0.0000 3.0000 1.0000

Objective Function (Max.) = 11.0000 Left Hand Right Hand Side Direction Side 5.0000 1.0000 6.0000 1.0000 0.0000 3.0000 1.0000 <= <= <= <= <= <= <= 8.0000 12.0000 6.0000 1.0000 1.0000 4.0000 2.0000

Constraint 1 2 3 4 5 6 7 C1 C2 C3 C4 C5 C6 C7

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

ElDaoushy

Non-Linear Programming (WinQSB–NonLinear Programming)
1. Max Z = -X12 + 2X1X2 + X22 s.to: =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 = X12 + 2X1X2 + 2X22 + X32 – X2 X3 + X1 + 3 X2 – X3 s.to: X1 X1 X2 X2 >= 0 <= 100 >= 0 <= 200 X3 >= 0 X3 <= 300 X12 + X22 –e(-x1-x2)

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]
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 73

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 Maximize a* b* c* Constraint 1 Constraint 2 Constraint 3 a 1 -2 3 2 -2 1 2 -2 b -4 c Direction R.H.S

-1 1 3 5 -1 4 <= = = 150 210 315

[Solution: a= 56.81, b = 31.54, c = 23.51, & Z = -5,355.86] 2. Max. Z = 3.2G1 + 5G2 + 5G3 – G12 – 2G22 – 5G32 s.to: 4G1 + 2.5G2 + 3G3 3.6G1 + 7G2 – 2.5G3 & G1, G2, G3 >= 0
Variable  Maximize G1* G2* G3* Constraint 1 Constraint 2 G1 3.2 -1 G2 5 -2 4 3.6 2.5 7 -5 3 -2.5 = = 50 86.9 G3 5 Direction R.H.S

= 50 = 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……
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 74

ElDaoushy

Integer Quadratic Programming (WinQSB-Quadratic Programming – NonNegative Integer)
Max. Z = 3.2G1 + 5G2 + 5G3 – G12 – 2G22 – 5G32 s.to: 4G1 + 2.5G2 + 3G3 3.6G1 + 7G2 – 2.5G3 & G1, G2, G3 >= 0 & Integer. This problem can be illustrated using the option: “Spreadsheet Matrix Form” as follows:
Variable  Maximize G1* G2* G3* Constraint 1 Constraint 2 Variable Type G1 3.2 -1 G2 5 -2 4 2.5 3.6 7 Integer Integer -5 3 -2.5 integer >= = 50 86.9 G3 5 Direction R.H.S

>= 50 = 86.9

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

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

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 MultiCriteria 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.

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

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…..
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 77

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.

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

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).

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

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 s.to $8T + $6C + Du – Do = $140 --- profit obtained ($8T+$6C) + any underachievement – any overachievement must = the Target. 4T + 2C 2T + 4C <= 60 <= 48 & --- assembly constraint --- finishing constraint 3 Constraints) Du --- minimize underachievement of the profit target

(4 Variables: T, C, Du, and Do

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 80

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 --- tables goal T+ Dut – Dot = 10 4T + 2C <= 60 2T + 4C <= 48 & all variables >= 0. & 4 constraints) --- assembly constraint --- finishing constraint

(6 variables: T, C, Dup, Dop, Dut,Dot

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

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
1 2 3 4 5 6 G1 G1 G1 G1 G1 G1 T C Dup Dut Dop Dot

Solution
12.50 0 0 0 0 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 D ut = 0 & G1 = 0 Dop = 4 Dot = 3

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

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 s.to: 2X1 + 3X2 X1 + X2 ≤ 100 4X1 + X2 ≤ 200 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).

(Labor constraint) (Storage constraint)

(1). (2).

Now, a Goal Programming Problem: Suppose instead that the Firm wants to achieve 3 Objectives:
X1 + X2 = 100 4X1 + X2 = 200 2X1 + 3X2 = 110 (instead of 300) (Use all available Labor) (Use all Storage) (Achieve reasonable Profits) (1) (2) (3)

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

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

ElDaoushy

We introduce Deviation Variables to represent the over- or underachievement of the Goals:
DLu DLo DSu DSo DPu DPo represents the amount of under-achievement of goal (1) -- Labor represents the amount of over-achievement of goal (1) represents the amount of under-achievement of goal (2) --- Storage represents the amount of over-achievement of goal (2) represents the amount of under-achievement of goal (3) -- Profit 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: if the Goal is under-achieved, then: DKo > 0 & DKu = 0 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 4X1 + X2 + DSu – DSo = 200 2X1 + 3X2 + DPu – DPo = 110 (1′) (2′) (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 Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 84

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 Min:G1 s.to: C1 C2 C3 LB UB VT 1 4 2 0 M C

X2

Dlu 1

Dlo 1

Dsu 1

Dso 1

Dpu 1

Dpo 1

Direction

R.H.S.

1 1 3 0 M C

1

-1 1 -1 1 -1 0 M C

= = =

100 200 110

0 M C

0 M C

0 M C

0 M C

0 M C

Solution:
Combined Report for Example Page 3

1 2 3 4 5 6 7 8

G1 G1 G1 G1 G1 G1 G1 G1

X1 X2 Dlu Dlo Dsu Dso Dpu Dpo

49.00 4.00 47.00 0 0 0 0 0

0 0 1.00 1.00 1.00 1.00 1.00 1.00

0 0 47.00 0 0 0 0 0

0 0 0 2.00 1.10 0.90 1.30 0.70

-3.00 -1.75 -1.00 -1.00 -0.10 0.10 -0.30 0.30

3.67 3.25 3.33 M M M M M

G1

Goal Value

(Min.) = 47.00

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

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems II - 86

ElDaoushy

Computer Software Input/Output: GP: Weighting of Goals X1 Min:G1 C1 C2 C3 LB UB VT 1 4 2 0 M C 1 1 3 0 M C X2 Dlu Dlo Dsu Dso Dpu Dpo Dir. R.H.S. 2 1 1 -1 1 -1 1 0 M C 0 M C 0 M C 0 M C 0 M C -1 0 M C 1 1 1 0 = = = 100 200 110

Hint: Leave the cells of no value as empty cells

Solution: 1 2 3 4 5 6 7 8 G1 G1 G1 G1 G1 G1 G1 G1 G1 X1 X2 Dlu Dlo Dsu Dso Dpu Dpo 33.33 66.67 0 0 0 0 0 156.67 (Min.) = 0

Goal Value

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

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: Priority 2: Priority 3: Min DSu + DSo (s. t. DSu = DSo = 0)

Min DLu + DLo Min

(s. t. DSu = DSo = DLu = DLo = 0) DPu + DPo [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.

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

ElDaoushy

Computer Software Input/Output:
GP: Prioritizing Goals: 3 Number of Variables: 8 Number of Constraints: 7 X1 Min:G1 Min:G2 Min:G3 C1 C2 C3 C4 C5 C6 C7 1 4 2 1 1 3 X2 Dsu 1 Dso 1 1 1 1 1 1 1 1 1 1 -1 1 -1 -1 1 = = = = = = = 100 200 110 0 0 0 0 Dlu Dlo Dpu Dpo Dir. R.H.S.

Lower Bound: … 0 … Upper Bound: … M … Variable Type: … Continuous -

Solution:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 G1 G1 G1 G1 G1 G1 G1 G1 G2 G2 G2 G2 G2 G2 G2 G2 G3 G3 G3 G3 G3 G3 G3 G3 G1 G2 G3 X1 X2 Dsu Dso Dlu Dlo Dpu Dpo X1 X2 Dsu Dso Dlu Dlo Dpu Dpo X1 X2 Dsu Dso Dlu Dlo Dpu Dpo Goal Goal Goal 33.33 66.67 0 0 0 0 0 156.67 33.33 66.67 0 0 0 0 0 156.67 33.33 66.67 0 0 0 0 0 156.67 Value (Min.) = 0 Value (Min.) = 0 Value (Min.) = 156.67

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

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 2 3 4 5 6 G1 G1 G1 G2 G2 G2 A B C A B C 16.00 14.00 36.00 16.00 14.00 36.00

G1 Goal Value(Min.)= 114.00 G2 Goal Value(Max.)= 574.00

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

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.

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

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).
D1 S1 D2 P L A N T S S2 W A R E H O U S E S

Si

xij/cij

Dj

Sm Capacity/Supply

Dn

Demand/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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 2

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: Min. Z = ∑ ∑ Cij Xij
i j mn

s.to

∑ Xij <= Si
j i

n

for all values of i = 1, 2, . . . , m

(1) (2)

∑ Xij >= Dj for all values of j = 1, 2, . . ., n & 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

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

ElDaoushy

Suppose that: ∑ Si = ∑ Dj
i j

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

s.to

∑ Xij = Si
j

for all values of i = 1, 2, . . . , m

(1)

∑ Xij = Dj
i

for all values of j = 1, 2, . . ., n

(2)

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

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

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) 1 2 3 Dealer Demand Dealer (Destination) Plant 2 3 4 5 Capacity 1.7 1.6 1.8 2.4 300 1.5 (2.2) 1.2 1.6 400 1.4 1.2 1.5 1.0 100 50 300 150 200

1 1.2 1.8 1.5 100

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 + 1.5X31 + 1.4X32 + . . . + 1.0X35 s.to ∑ X1j = 300
j=1 5

15 Variables

5

∑ X2j = 400
j=1

3 Constraints

∑ X3j = 100
j=1

5

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

ElDaoushy

and ∑ Xi1 = 100
i=1 3

∑ Xi2 = 50
i=1

3

∑ Xi3 = 300
i=1

3

5 Constraints

∑ Xi4= 150
i=1

3

i=1

∑ Xi5 = 200

3

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

Plant (Source) 1 2 3 Dealer Demand

Dealer (Destination) 1 2 3 4 5 0 0 100 0 200 00 50 0 150 200 0 0 0 0 100 100 50 300 150 200

Plant Capacity 300 400 100 800

& Z = 1,135

Solution: Using WinQSB (Network Modeling/Transportation Problem)
Solution for Minimization (Transportation Problem) From Source Source Source Source Source Source To Destination Destination Destination Destination Destination Destination Shipment 100 200 50 150 200 100 Unit Cost 1.20 1.60 1.50 1.20 1.60 1.20 Total Cost 120.00 320 75 180 320 120.00

1 1 2 2 2 3

1 3 2 4 5 3

Total Objective Function Value = 1135 Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 6

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

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

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 17 W1 23 W2 25 W3 Needs 16 For Cars M2 23 15 M 20 M3 20 23 13 20 M4 M 20 21 16 Excess Cars 20 20 32

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) roadrepair 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 W1 M3 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 Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 8

ElDaoushy

5.2 [7] Solve the Transportation Problem
Find an optimal solution for the following Transportation Problem: Origin (Surplus Area) 1 2 3 Demand Destination (Shortage Area) 1 2 3 $50 $100 $100 200 300 200 100 200 300 140 200 80 Supply

110 160 150 420

Solution:

Using WinQSB (Network Modeling/Transportation Problem)
To Destination Destination Destination Destination Destination Shipment 110 80 80 60 90 Unit Cost 100 200 200 100 200 Total Cost 11000 16000 16000 6000 18000

From Source Source Source Source Source

1 2 2 3 3

2 1 3 1 2

Total Objective Function Value = 67000

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

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. Destination 3 4 7 2 13 8 5 -1 2 7 15 7 12 2

Origin 1 2 3 4 5 Demand

1 10 1 2 7 3 8

2 4 1 8 9 4 7

5 3 7 1 3 -2 3

6 4 6 4 2 5 10

Supply 15 10 5 9 3 42

Solution:
From Source Source Source Source Source Source Source Source Source

Using WinQSB (Network Modeling/Transportation Problem)
To Destination Destination Destination Destination Destination Destination Destination Destination Destination 2 4 6 1 2 3 3 6 5 Shipment 5 2 8 8 2 5 7 2 3 Unit Cost 4 2 4 1 1 -1 2 2 -2 Total Cost 20 4 32 8 2 -5 14 4 -6

1 1 1 2 2 3 4 4 5

Total Objective Function Value = 73

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

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: Min. Z = ∑ ∑ Cij Xij
j=1 i=1 n n

s.to ∑ Xij = 1
j=1 n n

for all values of i

i=1

∑ Xij = 1

for all values of j

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

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

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: Task 2 3 8 8 6 5 10 7 9 7

Employee 1 2 3 4

1 5 4 6 9

4 6 8 4 3

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

Employee 1 1 1 1 2 3 4

Task 2 3

4

1 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 Employee 1 Employee 2 Employee 3 Employee 4 To Task 1 Task 2 Task 3 Task 4 Assignment 1 1 1 1 Unit Cost 5 6 7 3 Total Cost 5 6 7 3

1 2 3 4

Total Objective Function Value = 21

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

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).

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

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

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

ElDaoushy

5.40 [7] Solve the Assignment Problem
Solve the Assignment Problem for which the cost matrix is: Jobs 1 Person 1 2 3 4 5 5 2 4 6 4 3 3 1 8 2 2 4 7 5 1 5 3 7 6 2 2 7 4 1 5 4 3 1 5

Solution:

Using WinQSB (Network Modeling/Assignment Problem)
To Assignee Assignee Assignee Assignee Assignee Assignment 1 1 1 1 1 Unit Cost 1 2 2 1 2 Total Cost 1 2 2 1 2

From Assignment Assignment Assignment Assignment Assignment

1 2 3 4 5

5 1 4 3 2

Total Objective Function Value = 8

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

ElDaoushy

5.41 [7] Solve the Assignment Problem
Find a feasible solution for the Assignment Problem: Jobs 3 2 7 5 7 9 1

Men 1 2 3 4 5 Required

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

2

4 7 6 3 3 5 1 1 1 1 1 1

5

1

1

Available 1 1 1 1 1 5

Solution:

Using WinQSB (Network Modeling/Assignment Problem)

From Assignment Assignment Assignment Assignment Assignment

1 2 3 4 5

To Assignee Assignee Assignee Assignee Assignee

3 5 1 4 2

Assignment 1 1 1 1 1

Unit Cost 2 1 4 3 3

Total Cost 2 1 4 3 3

Total Objective Function Value = 13

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

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:
700

4 300 1. Water Line Taps ON 100
600 1,000

6 200 500 5 400
800

3

1,100

2 Fig. 15-23 [2]

7 900

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

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:
To Node From 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:

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

ElDaoushy

Connected 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 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 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 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 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 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 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

1

2 1,100 0 M M M M 900 1,100 0 M M M M 900 1,100 0 M M M M 900 1,100 0 M M M M 900 1,100 0 M M M M 900 1,100 0 M M M M (900)

3 (100) M 0 M 500 M M

4 300 M M 0 M 700 M (300) M M 0 M 700 M

5 600 M 500 M 0 200 M 600 M 500 M 0 200 M 600 M 500 M 0 200 M 600 M (500) M 0 200 M

6 1,000 M M 700 200 0 800 1,000 M M 700 200 0 800 1,000 M M 700 200 0 800 1,000 M M 700 200 0 800 1,000 M M 700 (200) 0 800

7 400 900 M M M 800 0 400 900 M M M 800 0 (400) 900 M M M 800 0

The Total Minimal Connected Distance = 100+300+400+500+200+900 = 2400 Routes: are 13, 14, 17, 35, 56, 72

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

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: 4 300 1. Water line taps on 100 3 500 5 400 7 900 200
ElDaoushy

6

2

Fig. 15-24 [2]

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.

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

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
Distance/Cost 900 500 100 200 300 400

From Node Connect To Node7 Node2 Node3 Node5 Node1 Node3 Node5 Node6 Node1 Node4 Node1 Node7

Total Minimal Connected Distance (or Cost) = 2400

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

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

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

ElDaoushy

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

B

15 12

E

20 29

H

10

18

-2 A
27

24 D 22 35 F 11 26 G

37 9 -5 K

-10 C

36 4

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

ElDaoushy

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
From A B 10 10 -10 27 18 -2 15 C -10 18 36 4 12 35 22 D 27 -2 36 E F G H K

To A B C D E F G H K 15 12 22 29 20 4 35 22 11 26 37 -5 22 29 11

20 37 9 26 -5 9

From Node Connect To A B A C B D D E C F F G K H G K

Distance/Cost 10 -10 -2 12 4 11 9 -5

Total Minimal Connected Distance (or Cost) = 29

B
10

15 12

E

20 29

H

18

-2 A
27

24 D 22 35 F 11 26 G

37 9 -5 K

-10 C

36 4

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

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.

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

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

ElDaoushy

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
From A To A B C D E F G 2 2 5 3 2 1 2 5 5 2 3 1 3 1 6 2 3 8 5 1 4 6 4 B C D E F G

8

From Node Connect To A B C C E F B C D E F G

Distance/Cost 2 2 1 2 1 4 Distance (or Cost) = 12

Total Minimal Connected

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

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

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)

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

T

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

ElDaoushy

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
From To O A B C D E T 2 5 4 O 2 2 7 1 4 3 A 5 2 B 4 1 7 4 3 4 1 7 C D E T

4

1 5

5 7

From Node Connect To O A A B B C E D B E D T

Distance/Cost 2 2 1 1 3 5

Total Minimal Connected Distance(or Cost) = 14

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

T

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

ElDaoushy

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

1

14 18

4
15 7

9 12 13 10

8
3

5
6 2

11

3
16

6 4 5 17 7

2

8

The following represents corresponding table: From To 1 2 3 4 5 6 7 8 1 6 6 5 14 18 2 8 11 16 2 5 2 3 4 14 11 7 15 10 9 5 18 8 16 7 4 17 12 6 7 8

15 4

10 17

9 12 13 3

13

3

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

ElDaoushy

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
Connect To Node2 Node3 Node4 Node5 Node6 Node7 Node8 Distance/Cost 2 5 7 8 4 3 9

From Node Node3 Node1 Node5 Node2 Node5 Node8 Node4

Total Minimal Connected Distance(or Cost) = 38

1

14 18

4
15 7

9 12 13 10

8
3

5
6 2

11

3
16

6 4 5 17 7

2

8

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

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 1 2 3 4 5 6 7 8 9 10 Field Name Sedr Asal Balaeim Bahary Balaeim Ras_Ghareb Morgan Karim Shokeir Amal Ghardaka

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

ElDaoushy

Suez
25

1 60
165

150 160

3
190 210 265

2 4

240

5

6

7 8
325

9

10

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

ElDaoushy

From \ Suez Node To 1 Suez 25 Node1 Node2 Node3 Node4 Node5 Node6 Node7 Node8 Node9 Node10 25 60 150 165 160 210 190 265 240 325 30 115 135 135 175 165 185 210 300

Node 2 60 30

Node 3 150 115 85

Node 4 165 135 55 25

Node 5 160 135 60 25 40

Node 6 210 175 150 60 25 50

Node 7 190 165 135 50 50 25 50

Node Node Node 8 9 10 265 240 325 185 150 65 50 50 25 30 210 175 100 75 85 30 75 40 40 115 85 300 265 175 150 165 110 150 115 85

85 55 60 150 135 150 175 265 25 25 60 50 65 100 175

40 25 50 50 75 150 50 25 50 85 165

50 25 30 110 30 75 150

Solution:

Using WinQSB (Network Modeling/Minimal Spanning Tree)
Distance/Cost 25 30 55 25 25 25 25 25 30 85

From Node Connect To Suez Node1 Node2 Node3 Node4 Node4 Node5 Node6 Node6 Node9 Node1 Node2 Node4 Node5 Node3 Node6 Node7 Node8 Node9 Node10

Total Minimal Connected Distance (or Cost) = 350
Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 33

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 A B C D E From \To Suez A B C D E Suez 120 125 160 180 290

Name Mostorod Cairo Helwan Tanta Alexandria 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 Suez A B A D

Connect To A B C D E

Distance/Cost 120 15 30 80 105

Total Minimal Connected Distance (or Cost) = 350

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

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

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

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: Z = ∑ ∑ cij xij
i=1 j=1 N N

.

.

.

.

.

.

(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: ∑ xij = 1 ; i = 1, 2, . . , N
j=1 N

.

.

.

.

(2)

leaves each Town exactly once…... ∑ xij = 1 ; j = 1, 2, . . , N .
i=1 N

.

.

.

.

(3)

arrives each Town exactly once…...
Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 36

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].

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

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.

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

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: bico@isye.gatech.edu)

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 CityTravel 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: bico@isye.gatech.edu )

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: bico@isye.gatech.edu)

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

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: bico@isye.gatech.edu )

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: bico@isye.gatech.edu )

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

ElDaoushy

Example 1: Consider the following Traveling Salesperson Problem with the following cost data: From A To A B C D 4 4 6 10 7 10 B 6 7 5 C D 10 10 5

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic
From Node A B C D Connect To B C D A Distance/Cost 4 7 5 10

Total Minimal Traveling Distance (or Cost) = 26

! ! !

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic
From Node A C D B Connect To C D B A Distance/Cost 6 5 10 4

Total Minimal Traveling Distance (or Cost) = 25

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

ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement Heuristic
From Node 1 A 2 C 3 D 4 B Connect To C 6 D 5 B 10 A 4 Distance/Cost

Total Minimal Traveling Distance (or Cost) = 25

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Brach and Bound Method
From Node 1 A 2 C 3 D 4 B Connect To C 6 D 5 B 10 A 4 Distance/Cost

Total Minimal Traveling Distance (or Cost) = 25

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

ElDaoushy

Example 2: Consider the following Traveling Salesperson Problem with the following cost data:

From LA To LA DEV HOU DAL CMH NY DEV 100 100 150 300 500 160 150 300 HOU 150 160 100 260 290 DAL CMH 300 300 260 240 200 NY 500 290 360 200

150 100 240 360

1. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Nearest Neighbor Heuristic
From Node LA DEV DAL HOU CMH NY Connect To DEV DAL HOU CMH NY LA Distance/Cost 100 150 100 260 200 500

Total Minimal Traveling Distance(or Cost) = 1310

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic
From Node LA HOU DAL NY CMH DEV Connect To HOU DAL NY CMH DEV LA Distance/Cost 150 100 360 200 300 100

Total Minimal Traveling Distance (or Cost) = 1210

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

ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement Heuristic
From Node LA HOU DAL NY CMH DEV Connect To HOU DAL NY CMH DEV LA Distance/Cost 150 100 360 200 300 100

Total Minimal Traveling Distance (or Cost) = 1210

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method
From Node LA DEV DAL CMH NY HOU Connect To DEV DAL CMH NY HOU LA Distance/Cost 100 150 240 200 290 150

Total Minimal Traveling Distance (or Cost) = 1130

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

ElDaoushy

6.40 [7] Solve the Traveling SalesPerson Problem Consider the following Traveling Salesperson Problem with the cost data: To City 1 From City 1 2 3 4 5 M 20 4 10 35 2 20 M 5 25 10 3 4 5 M 6 6 4 10 30 6 M 20 5 25 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
1 2 3 4 5 From Node Node1 Node5 Node4 Node2 Node3 Connect To Node5 Node4 Node2 Node3 Node1 Distance/Profit 25 20 25 5 4

Total Maximal Traveling Distance or Profit = 79

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic
1 2 3 4 5 From Node Node1 Node2 Node4 Node3 Node5 Connect To Node2 Node4 Node3 Node5 Node1 Distance/Profit 20 30 6 6 35

Total Maximal Traveling Distance or Profit = 79 Problem Solving & Decision Making Using Computer (Selected Real World Problems) III - 45

ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement Heuristic

1 2 3 4 5

From Node Node1 Node2 Node4 Node3 Node5

Connect To Node2 Node4 Node3 Node5 Node1

Distance/Profit 20 30 6 6 35

Total Maximal Traveling Distance or Profit = 79

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method
From Node Node1 Node2 Node4 Node3 Node5 Connect To Node2 Node4 Node3 Node5 Node1 Distance/Profit 20 30 6 6 35

1 2 3 4 5

Total Maximal Traveling Distance or Profit = 79

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

ElDaoushy

The same example ---with “Symmetric Arc Coefficients – i.e., both ways same Cost” To City 1 From City 1 2 3 4 5 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 Node1 Node3 Node2 Node5 Node4 Connect To Node3 Node2 Node5 Node4 Node1 Distance/Cost 4 5 10 20 10

1 2 3 4 5

Total Maximal Traveling Distance or Profit = 49

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic
1 2 3 4 5 From Node Node1 Node4 Node5 Node2 Node3 Connect To Node4 Node5 Node2 Node3 Node1 Distance/Cost 10 20 10 5 4

Total Maximal Traveling Distance or Profit = 49

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

ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement Heuristic
From Node Node1 Node4 Node5 Node2 Node3 Connect To Node4 Node5 Node2 Node3 Node1 Distance/Cost 10 20 10 5 4

1 2 3 4 5

Total Maximal Traveling Distance or Profit = 49

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method
1 2 3 4 5 From Node Node1 Node4 Node5 Node2 Node3 Connect To Node4 Node5 Node2 Node3 Node1 Distance/Cost 10 20 10 5 4

Total Maximal Traveling Distance or Profit = 49

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

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 A B C D Connect To B C D A Distance/Cost 1 1 3 5

Total Minimal Traveling Distance (or Cost) = 10

2. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Cheapest Insertion Heuristic
From Node A D B C Connect To D B C A Distance/Cost 5 2 1 2

Total Minimal Traveling Distance (or Cost) = 10

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

ElDaoushy

3. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Two-way Exchange Improvement Heuristic
From Node A D B C Connect To D B C A Distance/Cost 5 2 1 2

Total Minimal Traveling Distance (or Cost) = 10

4. Solution: WinQSB - Minimization (Traveling Salesman Problem)using Branch and Bound Method
From Node A D B C Connect To D B C A Distance/Cost 5 2 1 2

Total Minimal Traveling Distance (or Cost) = 10

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

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.

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

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.

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

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:

2 275 100

300 200

6 200 9 400 100
10

1

150 175

4

175

5 250 150 8 125 7

200 3 350

275

Highway Network

The Problem is to find the Shortest Route from Atlanta to St. Louis.

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

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.

Stage 4

Stage 3 2 275

Stage 2 6 200 200 9 400

Stage 1

300

100

100
10

1

150 175

4

175

5 250 150 8 125 7

200 3 350

275

Highway Networks with Problem Stages—Stage Inputs and Stage Outputs

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

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:

Stage 1

100 9 100
10

St. Louis

150 150 8

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

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.

Stage 2 300 6 200 400 400 5 150 250 275 125 7 8 150 100 9 100
10

St. Louis

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.

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

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.

Stage 3 300 6 200 400 175 5 150 250 600 200 3 350 275 275 125 7 8 150 200 100 9 500 4 400 100
10

600 2 275 300

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 7

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).

Stage 4 600 2 275 650 1 100 500 4 300 6 200 400 400 150 175 175 5 150 250 600 200 3 350 275 275 125 7 8 150 200 100 9 100
10

300

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 14-6-9-10 with a Total Distance of 650 miles.

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

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 Node Node Node Node Node Node Node Node Node 1 2 3 4 5 6 7 8 9 10 100 175 Node1 150 275 300 Node2 200 350 Node3 175 275 Node4 200 250 400 Node5 Node6 200 125 Node7 150 Node8 Node9 100 Node10

Solution for Example Page 412 [2]: Stagecoach-Shortest Route Problem From To Distance Input State Output State Node1 Node4 150 Node4 Node6 200 Node6 Node9 200 Node9 Node10 100 From Node1 to Node10 Min. Distance Cumulative Distance 150 350 550 650 = 650 Distance to Node10 650 500 300 100

Stage 1 2 3 4

Hint:
WinQSB enables you to choose any Start and Destination Nodes in the given map to find the Shortest Route between them.

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

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.
Problem Solving & Decision Making Using Computer (Selected Real World Problems) IV - 10

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.

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

ElDaoushy

Example: Consider the following Problem to be solved by WinQSB:
Input Data:
Item (Stage) 1 2 3 4 Item Units Identification Available A B C D 5 3 4 2 Unit Capacity Return Required Function 10 6 3 5 8A 10B 4C 7D

Knapsack Capacity = 20

Hint: The “Units Available” column is an optional Constraint . . . . . Solution for Knapsack Problem
02-27-2005 Stage 1 2 3 4 Item Name A B C D Decision Quantity 0 2 1 1 Return Function 8A 10B 4C 7D Total Item Return Value 0 20 4 7 Capacity Left 20 8 (20 – 2*6 --- 6 = capacity of each item of B) 5 (8 – 1*3) 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 = s.to: 10A + A B C & A, B, C, D >= 0 and Integer 6B + 3C + 5D = 20 <= <= <= D <= 5 3 4 2 8A + 10B + 4C + 7D

optional part

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

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. 1 2 3 4 5 Weight 18 12 15 16 13 Value 27 9 30 16 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 1 a M 2 b M 3 c M 4 d M 5 e M Knapsack Capacity = 45 Capacity Required Return Function 18 27a 12 9b 15 30c 16 16d 13 6.5e

Solution
Solution for DP Example: Knapsack Problem 02-28-2005 Stage 1 2 3 4 5 Item Name a b c d e Decision Quantity 0 0 3 0 0 Return Function 27a 9b 30c 16d 6.5e Total Item Return Value 0 0 90 0 0 Capacity Left 45 45 0 0 0

Total Return Value = 90

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

ElDaoushy

Solving By ILProgramming
Variable --> Maximize C1 Variables Type X1 X2 X3 30 15 X4 16 16 X5 6.5 13 Direction R. H. S.

27 9 18 12 Integer

=

45

Solution
1 2 3 4 5 X1 X2 X3 X4 X5 0 0 3.0000 0 0

(Decision Making Problem...)

Objective Function(Max.) = 90.0000

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

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 1 2 3 Value 70 50 30 Weight Value/Weight 40 1.75 30 1.67 20 1.5

Solving By WinQSB(Dynamic Programming---Knapsack Problem)
DP Example (Input Data) Stage 1 2 3 Item X1 X2 X3 Available M M M Capacity Required 40 30 20 Return Function 70*X1 50*X2 30*X3

Knapsack Capacity = 60

Solution for DP Example: Knapsack Problem 04-17-2005 Stage 1 2 3 Item Name X1 X2 X3 Decision Quantity(X) 0 2 0 Return Function 70*X1 50*X2 30*X3 Total Item Return Value 0 100 0 Capacity Left 60 0 0

Total Return Value = 100

(Decision Making Problem...)

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

ElDaoushy

This problem can be formulated as a LP model as:
Max. Z = s.to & 70X1 + 50X2 + 30X3 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.

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

ElDaoushy

Another Problem (prepared by Dr. M. ElKafrawy, INP)
DP Stage 1 2 3 DP Example Item a b c Available M M M Capacity_Required Return_Function 2 65a 3 80b 1 30c

Knapsack Capacity = 5

Solution
Solution for DP Example: Knapsack Problem 02-28-2005 Stage 1 2 3 Name a b c Item Decision Return Return 65a 80b 30c Total Item Value 130 0 30 Capacity Left 1 1 0

Quantity(X) 2 0 1

Total Return Value = 160

Hint: The same solution can be found by solving the problem as an ILP Problem with one constraint….

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

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): D(n): H(n): B(n): number of units Produced in period n. Demand in period n. on-Hand inventory at the end of period 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.

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

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
Demand Production Capacity 6 4 7 5 Storage Capacity 4 3 2 4 Production Setup Cost 500 450 500 600 Cost Function 300P+100H 320P+100H 250P+120H 350P+140H

Stage Period

1 2 3 4

January February March April

4 5 3 4

Solution for QSB: Production and Inventory Scheduling Problem
Stage Period Starting Description Demand Inventory Production Quantity (P) 5 4 3 4 16 Ending Inventory (H) 1 0 0 0 1 Setup Cost (X) $500.00 $450.00 $500.00 $600.00 $2,050.00 Variable Cost Function (P,H,B) Variable Cost (Y) $1,600.00 $1,280.00 $750.00 $1,400.00 $5,030.00 Total Cost (X + Y) $2,100.00 $1,730.00 $1,250.00 $2,000.00 $7,080.00

1 2 3 4 Total

January February March April

4 5 3 4 16

0 1 0 0 1

300P+100H 320P+100H 250P+120H 350P+140H

300 * 5 + 100 * 1 320 * 4 + 0 250 * 3 + 0 350 * 4 + 0

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

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: yihlong.chang@mgt.gatech.edu) 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

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

ElDaoushy

Sign up to vote on this title
UsefulNot useful