Top Banner
August 2010 Subject Code : MC0079 Assignment No: 01 Subject Name: Computer Based Optimization Methods Marks: 60 Credits : 4 Bk Id B0902 Answer the following: 610 = 6 1. Briefly describe the structure of a mathematical model in OR. Ans: The Structure of Mathematical Model
46
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MC0079 (1)

August 2010

Subject Code : MC0079 Assignment No: 01

Subject Name: Computer Based Optimization Methods

Marks: 60

Credits : 4 Bk Id B0902

Answer the following: 610 = 6

1. Briefly describe the structure of a mathematical model in OR.Ans:

The Structure of Mathematical Model

Many industrial and business situations are concerned with planning activities. In each case of planning, there are limited sources, such as men, machines, material and capital at the disposal of the planner. One has to make decision regarding these resources in order to either maximize production, or minimize the cost of production or maximize the profit

Page 2: MC0079 (1)

etc. These problems are referred to as the problems of constrained optimization. Linear programming is a technique for determining an optimal schedule of interdependent activities, for the given resources. Programming thus means planning and refers to the process of decision-making regarding particular plan of action amongst several available alternatives.

Any business activity of production activity to be formulated as a mathematical model can best be discussed through its constituents; they are:

- Decision Variables,

- Objective function,

- Constraints.

1.6.1 Decision variables and parameters

The decision variables are the unknowns to be determined from the solution of the model. The parameters represent the controlled variables of the system.

1.6.2 Objective functions

This defines the measure of effectiveness of the system as a mathematical function of its decision variables. The optimal solution to the model is obtained when the corresponding values of the decision variable yield the best value of the objective function while satisfying all constraints. Thus the objective function acts as an indicator for the achievement of the optimal solution.

While formulating a problem the desire of the decision-maker is expressed as a function of ‘n’ decision variables. This function is essentially a linear programming problem (i.e., each of its item will have only one variable raise to power one). Some of the Objective functions in practice are:

- Maximization of contribution or profit

- Minimization of cost

- Maximization of production rate or minimization of production time

- Minimization of labour turnover

- Minimization of overtime

- Maximization of resource utilization

Page 3: MC0079 (1)

- Minimization of risk to environment or factory etc.

1.6.3 Constraints

To account for the physical limitations of the system, the model must include constraints, which limit the decision variables to their feasible range or permissible values. These are expressed in the form of constraining mathematical functions.

For example, in chemical industries, restrictions come from the government about throwing gases in the environment. Restrictions from sales department about the marketability of some products are also treated as constraints. A linear programming problem then has a set of constraints in practice.

The mathematical models in OR may be viewed generally as determining the values of the decision variables x J, J = 1, 2, 3, —— n, which will optimize Z = f (x 1, x 2, —- x n).

Subject to the constraints:

g i (x 1, x 2 —– x n) ~ b i, i = 1, 2, —- m

and xJ 0 j = 1, 2, 3 —- n where ~ is , or =.

The function f is called the objective function, where g i ~ b i, represent the i th constraint for i = 1, 2, 3 —- m where b i is a known constant. The constraints x j

  0 are called the non-negativity condition, which restrict the variables to zero or positive values only.

2. Find all basic solutions for the system

42 321 xxx

552 321 xxx

Solution: Here A = , X = and b = .

i) If x1 = 0, then the basis matrix is B = . In this case 2x2 + x3 = 4, x2 + 5x3 = 5.

Page 4: MC0079 (1)

If we solve this, then x2 = and x3 = . Therefore x2 = , x3 = is a basic feasible

solution.

ii) If x2 = 0, then the basis matrix is B = . In this case, x1 + x3 = 4, 2x1 + 5x3 = 5.If

we solve this, then x1 = 5 and x3 = -1. Therefore x1 = 5, x3 = -1 is a basic solution. (Note

that this solution is not feasible, because x3 = -1 < 0).

iii) If x3 = 0, then the basis matrix is B = . In this case, x1 + 2x2 = 4.

2x1 + x2 = 5. If we solve this, then x1 = 2, and x2 = 1. Therefore x1 = 2, x2 = 1 is a basic

feasible solution.

Therefore

i) (x2, x3) = (5/3, 2/3),

ii) (x1, x3) = (5, -1), and

iii) (x1, x2) = (2, 1) are only the collection of all basic solutions.

3. Use simplex method to solve the LPP

Maximize 4321 42 xxxxZ

subject to 43 421 xxx

32 21 xx

34 432 xxx

0,,, 4321 xxxx

Answer: Rewriting in the standard form

Maximize Z = 2x1 + 4x2 + x3 + x4 + 0.S1 + 0.S2 + 0.S3

Page 5: MC0079 (1)

Subject to x1 + 3x2 + x4 + S1 = 4

2x1 + x2 + S2 = 3

x2 + 4x3 + x4 + S3 = 3

x1, x2, x3, x4, S1, S2, S3 0.

The initial basic solution is S1 = 4, S2 = 3, S3 = 3

\X0 = = C0 =

The initial table is given by

S1 is the outgoing variable, x2 is the incoming variable to the basic set.

The first iteration gives the following table :

Page 6: MC0079 (1)

x3 enters the new basic set replacing S3, the second iteration gives the following table :

x1 enters the new basic set replacing S2, the third iteration gives the following table:

Page 7: MC0079 (1)

Since all elements of the last row are non-negative, the optimal solution is Z = which

is achieved for x2 = 1, x1 = 1, x3 = and x4 = 0.

4. Solve the following problem by MODI methodA firm owns facilities at six places. It has manufacturing plants at places A, B and C with daily production of 50, 40 and 60 units respectively. At point D, E and F it has three warehouses with daily demands of 20, 95 and 35 units respectively. Per unit shopping costs are given in the following table. If the firm wants to minimize its total transportation cost, how should it route its products?

Warehouses

PlantsD E F

A 6 4 1

B 3 8 7

C 4 4 2

Ans: A firm owns facilities at six places. It has manufacturing pants at places A, B, and C with daily production of 50, 40 and 60 units respectively. At point D, E and F it has three warehouses with daily demands of 20, 95 and 35 units respectively. Per unit shipping costs are given in the following table. If the firm wants to minimize its total transportation cost, how should it route its products?

Page 8: MC0079 (1)

Solution: We use the North West corner rule for the initial basic feasible solution, given

in the following table and the basic cell are represented in right top square box.

Let u1 = 0. For the occupied cell (1, 1), u1 + v1 = c11 0 + v1 = 6 v1 = 6.

Similarly, u1 + v2 = c12 0 + v2 = 4 v2 = 4. Now with v2 = 4, u2 + 4 = 8 u2 = 4

and u3 = 0.

Now from u3 = 0, we get v3 = 0. Therefore we have determined all ui and vj values.

Next we calculate = ui + vj – cij values which are given in the left bottom squares

(opportunity costs).

Now

Page 9: MC0079 (1)

Therefore the cell (2, 1) has the largest positive opportunity cost and so select x21 for

inclusion as the basic variable. The closed loop (indicated in arrows in the above table)

starting with cell (2, 1).

The revised solution is shown in the following table.

This solution is tested for optimality and is found to be non-optimal. Here the cell (1, 3)

has positive opportunity cost and so a closed loop is traced starting with this.

The resulting solution, when tested is found to be optimal (given in the following table).

(observe that in this table no opportunity cost is positive).

Page 10: MC0079 (1)

Therefore the optimal transportation cost is

Rs. (4 50) + (1 35) + (3 20) + (8 20) + (4 60) = 555.

4.4.3 Algorithm flow chart for the MODI method

Page 11: MC0079 (1)

5. Solve the assignment problem given in the following table for optimal solution using HAM:

Worker Job

A B C D

1 45 40 51 67

Page 12: MC0079 (1)

2 57 42 63 55

3 49 52 48 64

4 41 45 60 55

Solution:

Step 1: The minimum value of each row is subtracted from all elements in the row. It is

shown in the reduced cost table, which is also called the opportunity cost table.

Reduced Cost Table 1:

Step 2: For each column of this table, the minimum value is subtracted from all the other

values. Clearly, the columns that contain a zero would remain unaffected by this

operation. Here only the fourth column values would change. Consider the following

table.

Reduced Cost Table 2:

Step 3: Draw the minimum number of lines covering all zeros. As a general rule, we

should first cover those rows/columns which contain larger number of zeros. The

following table shows reduced cost and the lines are drawn.

Reduced Cost Table 3:

Page 13: MC0079 (1)

Step 4: Since the number of lines drawn is equal to 4 (= n), the optimal solution is

obtained. The assignments are made after scanning rows and columns for unit zeros.

Assignments made are shown with brackets, below.

Reduced Cost Table 4:

Assignments are made in the following order. Rows 1, 3 and 4 contain only one zero

each. So assign 1-B, 3.-C, and 4-A. Since worker 1 has been assigned job B, we cross

the zero in the second column of the second row. After making these assignments, only

worker 2 and job D are left for assignment. The final pattern of assignments is 1-B, 2-D,

3-C, and 4-A, involving a total time of 40 + 55 + 48 + 41 = 184 minutes.

6. Write briefly about the concept “Probability and Cost Consideration in Project Scheduling” with examples wherever necessary?

Answer:

Probability and Cost Consideration in Project Scheduling

Page 14: MC0079 (1)

The analysis in CPM does not take into the case where time estimates for the different

activities are probabilistic. Also it does not consider explicitly the cost of schedules. Here

we will consider both probability and cost aspects in project scheduling.

Probability considerations are incorporated in project scheduling by assuming that the

time estimate for each activity is based on 3 different values. They are –

a = The optimistsic time, which will be required if the execution of the project goes

extremely well.

b = The pessimistic time, which will be required if everything goes bad.

m = The most likely time, which will be required if execution is normal.

The most likely estimate m need not coincide with mid-point of a and b. Then the

expected duration of each activity can be obtained as the mean of and 2 m. i.e.

.

This estimate can be used to study the single estimate D in the critical path calculation.

The variance of each activity denoted by V is defined by variance

V = .

The earliest expected times for the node i denoted by E(mi) for each node i is obtained

by taking the sum of expected times of all activities leading to the node i, when more

than one activity leads to a node i, then greatest of all E(mi) is chosen . Let mi be the

earliest occurrence time of the event i, we can consider mi as a random variable.

Assuming that all activities of the network are statistical independent, we can calculate

the mean and the variance of the as follows = .

Where K defines the activities along the largest path leading to i.

Page 15: MC0079 (1)

For the latest expected time, we consider the last node. Now for each path move

backwords, substituting the for each activity (ij). Thus we have

if only one path events from J to i or it is the

minimum of {E[LJ) – ] for all J for which the activities (i, j) is defined.

Note: The probability distribution of times for completing an event can be approximated

by the normal distribution due to central limit theorem.

Since represents the earliest occurrence time, event will meet a certain schedule

time STi (specified by an analyst) with probability

= Pr

= Pr (Z Ki)

where Z ~N(01) and Ki = . It is common practice to compute the probability

that event i will occur no later than its LCe such probability will then represent the

chance that the succeeding events will occur within the (ESe, LCe) duration.

Example: A project is represented by the network shown below and has the following

data.

Task A B C D E F G H I

Optimistic Time 5 18 26 16 15 6 7 7 3

Pessimistic Time 10 22 40 20 25 12 12 9 5

Most Likely Time 8 20 33 18 20 9 10 8 4

Determine the following:

Page 16: MC0079 (1)

a) Expected task time and their variance.

b) The earliest and latest expected times to reach each event.

c) The critical path.

d) The probability of an event occurring at the proposed completion data if the original

contract time of completing the project is 41.5 weeks.

e) The duration of the project that will have 96% channel of being completed.

Solution:

a) Using the formula we can calculate expected activity times and variance in the

following table

)

Activity a B m v

1-2

1-3

1-4

5

18

26

10

22

40

8

20

33

7-8

20-00

33-0

0.696

0.444

5.429

Page 17: MC0079 (1)

2-5

2-6

3-6

4-7

5-7

6-7

16

15

6

7

7

3

20

25

12

12

9

5

18

20

9

10

8

4

18-0

20-0

9-0

9-8

8-0

4-0

0.443

2.780

1.000

0.694

0.111

0.111

Forward Pass:

E1 = 0 E2 = 7.8 E3 = 20 E4 = 33 E5 = 25-8 E6 = 29 E7 = 42.

Backward Pass:

L7 = 42.8 L6 = 38.8 L5 = 34.8 L4 = 33.0 L3 = 29.8 L2 = 16.8 L1 = 0.

b) The E-values and L-values are shown in Fig.

c) The critical path is shown by thick line in fig. The critical path is 1-4-7 and the earliest

completion time for the project is 42.8 weeks.

d) The last event 7 will occur only after 42.8 weeks. For this we require only the duration

of critical activities. This will help us in calculating the standard duration of the last event.

Expected length of critical path = 33+9.8 = 42.8

Page 18: MC0079 (1)

Variance of article path length = 5.429+0.694 = 6.123

Probability of meeting the schedule time is given by Pi (Z Ki) =

Pi (Z – 0.52) = 0.30 (From normal distribution table)

Thus the probability that the project can be completed in less than or equal to 41.5

weeks is 0.30. In other words probably that the project will get delayed beyond 41.5

weeks is 0.70.

e) iven that P (Z Ki) = 0.95. But Z0.9S = 1.6 u, from normal distribution table. Then

1.6 u =

Sji = 1.64´2.47+42.8 = 46.85 weeks.

Example: A project is represented by the network shown below and has the following

data.

Solution:

Page 19: MC0079 (1)

Earliest/Latest Times and Slack:

Page 20: MC0079 (1)

August 2010

Page 21: MC0079 (1)

Subject Code : MC0079 Assignment No: 02

Subject Name: Computer Based Optimization Methods

Marks: 60

Credits : 4 Bk Id B0902

Answer the following : 610 = 6

1. Ships arrive at a port at a rate of one in every three hours, with a negative

exponential distribution of inter arrival times. The time a ship occupies a berth for

unloading and loading has a negative exponential distribution with an average of

12 hours. If the average delay of ships waiting for berths is to be kept below 6

hours, how many berths should there be at the port?

Answer:

Solution:

= 1/3

= 1/12

r =

For multichannel queues, < 1, to ensure that the queue does not explode.

Therefore c > 4

Let us calculate the waiting time when c = 5

Substituting for n, c and p

Average waiting time of a ship

Page 22: MC0079 (1)

= 6.65, which is greater than 6 hours and inadequate.

When c = 6, Po = .

And average waiting time of a ship E(w) = 1.71 hours.

Hence 6 berths should be provided at the port.

2. Find the optimum integer solution to the following all IPP

Maximize Z = x1 + 2x2

subject to the constraints

x1 + x2 7

2x1 11

2x2 7

x1, x2 0 and are integers

Solution:

Step 1: Introducing the slack variables, we get

2x2 + x3 = 7

x1 + x2 + x4 = 7

2x1 + x5 = 11

x1, x2, x3, x4, x5 > 0.

Step 2: Ignoring the integer condition, we get the initial simplex table as follows:

Page 23: MC0079 (1)

Introducing x2 and leaving x3 from the basis, we get

Introducing X1 and leaving X4 we get the following optimum table.

Optimum table

Page 24: MC0079 (1)

The optimum solution thus got is: .

Step 3: Since the optimum solution obtained above is not an integer solution, we must

go to next step.

Step 4: Now we select the constraint corresponding to the criterion

maxi (fBi) = max (fB1, fB2, fB3)

= max

Since in this problem, the x2 – equation and x1-equation both have the same value of fBi

ie , either one of the two equations can be used.

Page 25: MC0079 (1)

Now consider the first row of the optimum table . The Gomory’s constraint to be added is

Adding this new constraint to the optimum table we get

Step 5: To apply dual simplex method. Now, in order to remove the infeasibility of the

optimum solution:

, we use the dual simplex method.

i) leaving vector is G1 (i.e. )

ii) Entering vector is given by

Page 26: MC0079 (1)

       =

Therefore k = 3. So we must enter a3 corresponding to which x3 is given in the above

table. Thus dropping G1 and introducing x3. We get the following dual simplex table.

Thus clearly the optimum feasible solution is obtained in integers.

Finally we get the integer optimum solution to the given IPP as x1 = 4, x2 = 3 and max z

= 10.

Page 27: MC0079 (1)

3. Reduce the following game by dominance and find the game value

Player B

Player

A

I II III IV

I 3 2 4 0

II 3 4 2 4

III 4 2 4 0

IV 0 4 0 8

Solution: This matrix has no saddle point. We reduce the size of the matrix by the

principle of dominance.

From player’s A’s point of view, row I is dominated by row III. Therefore row I is deleted

and the reduced matrix is

From B’s point of view, column I is dominated by III. Therefore column I is deleted and

so the matrix becomes

  II III IV

II 4 2 4

III 2 4 0

IV 4 0 8

In the above matrix no single row (or column) dominates another row (column). But

column II is dominated by the average of column III and IV which is

Page 28: MC0079 (1)

Hence column II is deleted. Therefore the reduced matrix is

  III IV

II 2 4

III 4 0

IV 0 8

Again row II is dominated by the average of III and IV rows, which gives

. Therefore row II is deleted and 2 ´ 2 matrix results.

  III IV

III 4 0

IV 0 8

The above 2 ´ 2 matrix has no saddle point. It can be solved by the arithmetic method.

Therefore the complete solution to the given problem is

Page 29: MC0079 (1)

Optimal strategy for player A: (0, 0, 2/3, 1/3).

Optimal strategy for player B: (0, 0, 2/3, 1/3).

The value of the game is (for A) = = 8/3.

4. Write the different applications of simulation?

Answer:

1. The application of simulation in business is extremely wide. Unlike the other

mathematical models, through theoretical, simulation can be easily understood by the

users and thereby facilitates their active involvement. This, in turn, makes the results

more reliable and also ensures easy acceptance for execution. The degree to which a

simulation model can be made close to reality is dependent upon the ingenuity of the

O.R team who should identify the relevant variables as well as their behavior.

2. The use of computer simulation for studying the likely behavior of the nuclear reactors

during accidents is case in point. Clearly testing actual reactors are even scaled down

reactor models under emergency conditions would involve excessive risks.

3. Simulation can also be in use for a wide diversity of problems encountered in

production systems – the policy for optimal maintenance in terms of frequency of

replacement of spares or preventive maintenance, number of maintenance crews,

number of equipment for handling materials, job shop scheduling, routing problems,

stock control and so forth. The other areas of application include dock facilities, facilities

at airports to minimize congestion, hospital appointment systems and even management

games.

4. Like in the case of other O.R. models, with the help of simulation, the manager tries to

strike a balance between opposing costs of providing facilities (which usually mean long

term commitment of funds) and the opportunity and other costs of not providing them.

Page 30: MC0079 (1)

5. A firm engaged in producing 2 models viz., model A and model B, performs only 3

operations painting, assembly and testing. The relevant data are as follows

Unit Sale Price Hours required for each unit

Assembly Painting Testing

Model A Rs

50.00

1.0 0.2 0.0

Model B Rs

80.00

1.5 0.2 0.1

Answer: Solution: Let us first write the notations as under:

Z : Total revenue

x1 : Number of Units of Model A

x2 : Number of Units of Model B

b1 : Weekly hours available for assembly

b2 : Weekly hours available for painting

b3 : Weekly hours available for testing.

Since the objective (goal) of the firm is to maximize its revenue, the model can be stated

as follows:

Maximize Z = 50x1+80x2 – objective function

Subject to

1.0 x1+1.5x2 600 – Assembly constraints

0.2 x1+0.2x2 100 – Painting constraints

0.0 x1+0.1x2 30 – Testing constraints

and

Page 31: MC0079 (1)

x1 ³ 0, x2 ³ 0 – Non-negativity conditions.

Here x1 and x2 are the decision variables.

6. Write a C++ program for simplex method.

Answer:

Simplex Algorithm

1) Locate the most negative number in the last (bottom) row of the simplex table,

excluding that of last column and call the column in which this number appears as the

work (pivot) column.

2) Form ratios by dividing each positive number in the work column, excluding that of the

last row into the element in the same row and last column. Designate that element in the

work column that yields the smallest ratio as the pivot element. If more than one

element yields the same smallest ratio choose arbitrarily one of them. If no element in

the work column is non negative the program has no solution.

3) Use elementary row operations to convert the pivot element to unity (1) and then

reduce all other elements in the work column to zero.

4) Replace the x -variable in the pivot row and first column by x-variable in the first row

pivot column. The variable which is to be replaced is called the outgoing variable and the

variable that replaces is called the incoming variable. This new first column is the current

set of basic variables.

5) Repeat steps 1 through 4 until there are no negative numbers in the last row

excluding the last column.

6) The optimal solution is obtained by assigning to each variable in the first column that

value in the corresponding row and last column. All other variables are considered as

non-basic and have assigned value zero. The associated optimal value of the objective

function is the number in the last row and last column for a maximization program but

the negative of this number for a minimization problem.

Page 32: MC0079 (1)

3.4.2 Simplex Method Flowchart

Note:

1. The pivot column is the column with the most negative value in the objective function.

If there are no negatives, stop, you’re done.

Page 33: MC0079 (1)

2. Find the ratios between the non-negative entries in the right hand side and the

positive entries in the pivot column. If there are no positive entries, stop, there is no

solution.

3. The pivot row is the row with the smallest non-negative ratio. Zero counts as a non-

negative ratio.

4. Pivot where the pivot row and pivot column meet.

5. Go back to step 1 until there are no more negatives in the bottom row.

Problems:

1) Maximize z = x1+ 9x2 + x3

Subject to x1 + 2x2 + 3x3 9

3x1 + 2x2 + 2x3 15

x1, x2, x3 0.

Rewriting in the standard form

Maximize z = x1 + 9x2 + x3 + 0.S1 + 0.S2

Subject to the conditions

x1 + 2x2 + 3x3 + S1 = 9

3x1 + 2x2 + 2x3 + S2 = 15

x1, x2, x3, S1, S2 0.

Where S1 and S2 are the slack variables.

The initial basic solution is S1 = 9, S2 = 15

Page 34: MC0079 (1)

\ X0 = , C0 =

The initial simplex table is given below :

S1 – outgoing variable, x2 incoming variable.

Since there are three Zj – Cj which are negative, the solution is not optimal.

We choose the most negative of these i.e. – 9, the corresponding column vector x2

enters the basis replacing S1, since ratio is minimum. We use elementary row operations

to reduce the pivot element to 1 and other elements of work column to zero.

First Iteration – The variable x1 becomes a basic variable replacing S1. The following

table is obtained.

Page 35: MC0079 (1)

Since all elements of the last row are non-negative the optimal solution is obtained. The

maximum value of the objective function Z is which is achieved for x2 = , S2 = 6

which are the basic variables. All other variables are non-basic.

2) Use Simplex method to solve the LPP

Maximize Z = 2x1 + 4x2 + x3 + x4

Subject to x1 + 3x2 + x4 4

2x1 + x2 3

x2 + 4x3 + x4 3

x1, x2, x3, x4 0

Rewriting in the standard form

Maximize Z = 2x1 + 4x2 + x3 + x4 + 0.S1 + 0.S2 + 0.S3

Subject to x1 + 3x2 + x4 + S1 = 4

2x1 + x2 + S2 = 3

x2 + 4x3 + x4 + S3 = 3

x1, x2, x3, x4, S1, S2, S3 0.

The initial basic solution is S1 = 4, S2 = 3, S3 = 3

\X0 = = C0 =

The initial table is given by

Page 36: MC0079 (1)

S1 is the outgoing variable, x2 is the incoming variable to the basic set.

The first iteration gives the following table :

x3 enters the new basic set replacing S3, the second iteration gives the following table :

Page 37: MC0079 (1)

x1 enters the new basic set replacing S2, the third iteration gives the following table:

Since all elements of the last row are non-negative, the optimal solution is Z = which

is achieved for x2 = 1, x1 = 1, x3 = and x4 = 0.

Page 38: MC0079 (1)