Tuesday 17 December 2013

NETWORK SCHEDULING BY PERT/CPM

PERT- Program Evaluation Review Technique
CPM-Critical Path Method

NETWORK SCHEDULING
Its a technique used for planning and scheduling large project.Its a method for minimizing troubleshoots such as delays, interruption.
There are two basic planning & Control techniques.:
   PERT
   CPM

NETWORK:
Its the graphical representation of logically and sequentially connected arrows and nodes representing activities and events in the project.Its an arrow diagram.

ACTIVITY:
An activity represents some action and its  a time concuming effort necessary to complete a parrticular part of the overall project.

EVENT:
The beginning and the end points of an activity are called events/nodes.


MERGE EVENT:
Its not necessary for an event to be ending event for only one activity as it can be the ending event of two or more activity such a event is defined as merge event.

BURST EVENT:
If the event happens to be the beginning event of two or more activities then they are called as Burst event.


We have the following types of activities

1. Preceding
2. Succeeding
3.Concurrent
4.Dummy Activity

DUMMY ACTIVITY:
Certain activities which neither consume type or resources but are used simply to represent a connection/link between events are known as Dummy Activity.



CONSTRUCTION OF NETWORK:
Construct the network for the project whose activities and preceding relationships are shown below

ACTIVITIES            A              B               C                D             E             F
IMMEDIATE    
PREDECESSOR     -                 A              A                -               D           B,C,E



DOMINANCE PROPERTY

Q1. Solve

                        Player B
                          B1    B2    B3
Player A   A1   [ 1      7        2
                 A2     6      2        7
                 A3     5      1        6]

Soln:
STEP 1:
Find out the maximin and minimax values

 [ 1      7        2     1
    6      2        7    2     maximin=2
    5      1        6]   1

   6        7        7
minimax=6

maximin != minimax
Therefore no saddle point.

STEP II:
Now compare each row and check whether they are minimum values. If so then delete that row.

Compare A1 and A2 , here few values are minimum and few are maximum.
Now compare  A2 and A3, A3 has minimum values therefore delete A3.

By dominance Property,       B1       B2        B3
                                    A1    1           7         2
                                    A2     6          2         7
STEP III:
Now compare each column and check whether they are maximum values. If so then delete that column.

Compare B1 and B2 , here few values are minimum and few are maximum.
Now compare  B1 and B3, B3 has maximum values therefore delete B3.

          B1         B2
A1     1             7        1
A2     6             2        2         maximin=2
           6             7
minimax=6

maximin!=minimax
Therefore no saddle point

STEP IV:
                a22-a12
p1=--------------------------
       (a22+a11)-(a12+a21)

p1=1/2     p2=1/2

             a22-a21
q1=--------------------------
       (a22+a11)-(a12+a21)

q1=2/5    q2=3/5

                            a11a22-a21a12
value of game=-------------------------- =4
                        (a22+a11)-(a12+a21)

SA= [ A1       A2        A3
          1/2        1/2        0]

SB=[B1       B2         B3
        2/5      3/5          0]



Sunday 15 December 2013

GRAPHICAL METHOD FOR GAME THEORY

Q1.Solve the following 2 x 3 game graphically

                               Player B
Player A    [ 1          3         11
                    8          5          2]



STEP I :
 A's expected pay off against B's pure move is given by:


B's PURE MOVE                     A's EXPECTED PAY OFF E(P)
     B1                                              E1(P)=8-7P1
     B2                                              E2(P)=5-2P1
     B3                                              E3(P)=2P1+2

STEP II:
Now for the graph consider Axis 1 as  A2 and Axis 2 as A1




STEP III:
The reduced Pay off matrix is given by

          B2           B3    --------> the intersection point
A1 [   3              11       3
A2      5               2]      2     maxmin=3

           5               11
minimax=5

maxmin != minmax
Therefore  there exists no saddle point

P1=9/11          p2=2/11

q1=3/11           q2=8/11


Value of game = 49/11

The optimal Strategy is given by
            [  A1          A2
SA  =      9/11       2/11]

           [  B1          B2       B3
SB =      0             3/11     8/11]


NOTE:
The left out matrix value is given as '0'
For 2 x n matrix find lower envelope, find maximin (maximum values)
For m x 2 matrix find upper envelope, find minimax (minimum values)




GRAPHICAL METHOD FOR GAMES 2 x n / m x 2 MATRIX

Consider the following 2 x n games

           B1       B2 .............Bn
A1 [    a11       a12.............a1n
A2      a21       a22.............a2n]


Let the mixed strategy for Player A is given by
          [  A1        A2
SA =     P1        P2]         such that p1+ p2=1   and p1,p2 >=0


Now the Pure Strategy for A available to B would be as follows

B's PURE MOVE                   A's EXPECTED PAY OFF
    B1                                         E1(P)=a11P1+a21P2
    B2                                         E2(P)=a12P1+a22P2
     .
     .
     .
     .
    Bn                                         En(P)=a1nP1+a2nP2

GAME THEORY : (WITHOUT SADDLE POINT)

Q1.Solve the following Pay off Matrix

                   B1         B2
     A1   [   5              1
     A2       3              4]

Soln:

STEP I:
Find the row minima and colmn maxima, and find out the maximin amd minimax values.

[5      1       1
 3      4]      3        maximin=3

 5       4
minimax=4

maximin != minimax
Therefore there is no saddle point.

              a22-a12
p1=   --------------------
        (a11+a22)-(a12+a21)

p1=(4-1) / (5+4)-(1+3)

p1=3/5      p2=1-p1=1-3/5=2/5  
p2 = 2/5


        a22-a21
q1=   --------------------
        (a11+a22)-(a12+a21)

q1=1/5    q2=4/5

                            a22a11-a12a21
Value of game= ---------------------------   =17/5
                             (a11+a22)-(a12+a21)

Optimum Strategies are given by
       
           [ A1        A2
SA=     3/5        2/5]

             [B1       B2
SB =       1/5      4/5]










GAMES (2 x 2) WITHOUT SADDLE POINT

Consider a 2 x 2 , 2 person zero sum game without any saddle point having the pay off matrix for player as

          B1       B2
A1  [ a11        a12
A2    a21        a22]

The optimum strategy for A is given as
              [  A1       A2
 SA  =       p1        p2]

The optimm strategy for B is given as
            [ B1        B2
SB =      q1         q2]

             a22-a12
p1= ---------------------
       (a11+a22)-(a12+a21)

p1+p2=1
p2=1-p1


             a22-a21
q1 =  ----------------------
          (a11+a22)-(a12+a21)

q1+q2=1
q2=1-q1

                              a11a22 - a12a21
Value of game  = -----------------------------------
                              (a11+a22)-(a12+a21)

Saturday 14 December 2013

Game Theory Example

Q1.Solve the game whose Pay off Matrix is given by

                           B1          B2          B3           Player B
Player A  A1   [  1              3            1
               A2       0             -4          -3
               A3       1              5           -1]


Soln:
STEP I:
Find out the Row minima and column maxima.

              [1       3       1        1
               0       -4      -3      -4        maximin=1
               1        5       -1]     -1

               1         5        1
  minimax=1

STEP II:
maximin=minimax=1
There exists a saddle point value of game = 1
The optimal strategy is (A1,B1)    -->  this  value is the intersection of maxima and minima.
The game is strictly determined since maximin=minima   is not equal to  0

Q2. Solve:

[ 0      2
 -1      4]

Soln:
STEP I:
     [ 0      2   0
      -1      4]  -1     maximin=0
       0       4
minimax=0

STEP II:
maximin=minimax=0
there exists a saddle point value of game=0
The optimum strategy is (A1,B1)
The game is fair since maximin=minimax=0

MAXMIN MINIMAX Principle

MAXIMIN=MINIMAX PRINCIPLE

MAXIMIN- Maximum of  Minimum among the row
MINIMAX- Minimum of Maximum among the column

If maximin=minimax value then the corresponding stratifies are called Optimal Strategies and the game is said to have a Saddle Point.
The value of the game is given by the saddle point.

SADDLE POINT:
Saddle point is the position in which the maximum of row coincides with the minimum of column maxima.

Game Theory

COMPETITION:
Its a watch word of modern life.A competitive situation is called a game.
The term game represents the conflict between two or more parties.
STRATEGY:
It is defined as a complete set of plans of action.Its a decision rule for making a choice fom the list of course of action.
Two types of Strategy:
1. Pure Strategy
2. Mixed Strategy

A strategy is called pure if one knows in advance of the play that its certain to be adapted irrespective of the strategy the other player might choose.

The optimal strategy mixed for each player may be determined by assigning to each strategy its probability of being chosen.
ie., the probabilistic combination of available choices of strategy.

PAY OFF:
Pay off is the outcome of playing the game.If a Player 'A' has 'm' course of action and Player 'B' has 'n' course of action then the Pay off matrix may be constructed as

                      Player B
                      1          2          ........................ n
                1[ a11     a12         ................... ....a1n
Player A  2   a21    a22       ...........................a2n           -----> Out come of A
                .
                .
                .
                m    am1     am2   .........................amn]
----> Out come of B

TYPES OF GAME:
1. 2 Person Game
2. n Persons Game

ZERO SUM GAME:
Its one in which the sum of payment to all the competitors is zero for every possible outcome of game.

Sum of points won= sum of points lost

TWO PERSON ZERO SUM GAME:
Gain of one player=Loss of other player

A game with 2 players where the gain of one player equals to the loss of other.



TSP Example

Q2.A salesman has to visit 5 cities the distance between the 5 cities are as follows:

                             To City
                          A         B         C         D           E

From City   A[infi         7            6          8            4
                   B 7         infi            8          5            6
                   C 6           8           infi         9            7
                   D 8           5            9        infi            8
                   E  4           6            7          8           infi]

If the sales man starts from city A and has to come back to his starting point which route should he select so that the total distance covered is minimum.

Soln:'

If we solve this problem, the final distance matrix will be.

           A             B               C              D           E
A      infi              3                0              4             0
B       3              infi                1              0             1
C       0               1                infi             2             0
D       4               0                  2            infi            3
E        0               1                  0             3           infi

The travel is given as A-->E-->B-->D-->C-->A

Distance=4+5+6+9+6
             =30 Km

Tuesday 3 December 2013

TSP Example

Q1.A Travelling salesman has to visit 5 cities the cost of going from one city to another is shown below.

                    A        B        C        D        E
From  A [  infi         4         10      14        2
City    B     12       infi         6        10        4
          C     16       14         infi        8       14
          D      24       8          12        infi     10
          E        2        6           4        16      infi ]

Soln:

STEP I:
Process row wise

[ infi   2      8      12      0
   8    infi     2       6      0
   8     6     infi      0      6
  16    0      4      infi     2
   0     4      2      14    infi ]

STEP II:
 Process column wise. Strike out either horizontally / vertically in such a way that maximum number of zeros are covered.

[ infi     2      6     12     0
  8      infi      0      6     0
  8        6     infi     0     6
 16       0      4     infi    2
  0        4      0     14   infi ]

STEP III:
Number of Straight lines N=5
Order of matrix n=5
N=n. Therefore the optimal solution is

                   A             B               C             D           E
A     [       infi               2                 6           12            0
B              8               infi                 0             6            0
C              8                 6                infi            0            6
D             16                0                 4            infi           2
E               0                 4                 0             14         infi ]

A-->E; E-->A          B-->C;C-->D;D-->B

A-->E-->A;
B-->C-->D-->B     There is a break in the travel.

STEP IV:
When this situation occurs find the minimum value from the above cost matrix. Here it is  2 cancel this value and the other minimum value '0' in that row.

                   A             B               C             D           E
A     [       infi               2                 6           12            0
B              8               infi                 0             6            0
C              8                 6                infi            0            6
D             16                0                 2            infi           2
E               0                 4                 0             14         infi ]

A-->B;   B-->C;   C-->D;  D-->E;  E-->A

therefore the optimum sequence is A-->B-->C-->D-->E-->A
                                                    4+6+8+10+2
cost=Rs.30



Travelling Salesman Problem (TSP)

Assuming the salesman has to visit 'n' cities.He wishes to start from a particular city visit each city once and return to his starting point.His objective is to select a sequence in which the total travelling time is minimized.

MATHEMATICAL FORMULATION:
Let Cij be the distance or time or cost of going from city 'i' to city 'j'.
Let the decision variable Xij=1, if the salesman travels from city'i' to city 'j', otherwise 0.
The objective is to minimize the travelling time.

Hungarian Method- Unbalanced Assignment Problem

Q1.
                   Machines
                 A        B          C          D        E
Jobs   1[    4         3          6           2         7
          2[     10       12       11          14       16
          3[    4          3         2            1        5
          4[    8          7         6            9         6]

Soln:
STEP I:
The given matrix is unbalanced matrix.Hence add a row of "0"

[ 4    3     6      2       7
  10  12   11    14      16
  4      3    2     1        5
  8     7      6    9        6
  0     0      0     0       0]

STEP II:
Process row wise.
[ 2     1      4     0     5
  0     2      1     4     6
  3     2      1     0     4
  2     1       0     3     1
  0     0       0     0     0]

Number of straight lines N=4
Order of matrix n=5
N<n

Therefore the smallest value   in the previous matrix is  "1" subtract from the remaining values and add in the intersecting points.
[ 2   0  3  0  4
  0   1   0  4  5
  3   1   0  0  3
  3   1   0  4  1
  1   0   0  1   0]

Number of Straight Lines N =5
Order of Matrix n=5
N=n

Assign the jobs to machines.
      A        B         C         D         E
1[  2          0         3          0         4
2[  0            1        0          4         5
3 [ 3            1        0          0         3
4 [3            1        0           4        1
5[ 1           0         0           1         0]


1----->B  ; 2-->A ; 3-->D;  4---> C ; 5-->E

Cost= 3+10+1+6+0
       =Rs.20

      

Hungarian Method

Q1. Using the following Cost matrix determine (i) Optimal Job Assignment
                                                                       (ii)The cost of the assignment


                                       Jobs
                              1          2           3           4          5
Mechanic    A[     10          3            3           2          8
                   B       9            7           8           2           7
                   C       7            5           6           2           4
                   D       3            5           8           2           4
                   E       9            10          9           6         10


Soln:
STEP I:
Since the given matrix is a square Matrix (5 x 5) its balanced.
STEP II:

Process row wise

[ 8  1   1   0  6
  7  5   6   0  5
  5  3   4   0  2
  1  3   6   0  2
  3  4   3   0  4]

STEP III:

Process  Column wise for the above matrix

[ 7   0   0    0    4
  6   4   5    0    3
  4   2   3    0    0
  0   2   5    0    0
  2   3   2    0    2]

STEP IV:
Now we have drawn horizontal and vertical lines in such a way that most of the zeros are covered.
The number of Straight lines N=4
The order of matrix n=5
N<n

STEP V:
Since N<n
Therefore find out the smallest value from the above matrix .The smallest value is "2". Now subtract 2 fro the remaining values . Add "2" in the intersecting places "&" and "$" in the first row are the intersecting points.

[ 9  0   0  2   6
 6   2   3   0   3
 4   0   1   0   0
 0   0   3   0   0
 2   1   0   0   2]

Here all the columns are striked out as we have to cover most of the zeros.
Number of Straight lines N =5
Order of matrix n=5
Thus we get the optimal solution.

STEP VI:
Now we have to assign the jobs to the persons:
      1       2        3         4          5
A[  9       0        0         2          6
B   6        2        3        0           3
C   4        0        1        0           0
D   0        0        3        0           0
E   2        1        0         0           2]

1--> D ;  2-->A ;  3--->E ;  4--> B; 5--> C

Now we have to consider the original matrix and assign the values (ie., in each row we have "0" the value being assigned to the jobs) find the corresponding value in the original matrix

Minimum Cost= 3+3+9+2+4=Rs.21(this value no need to be unique as each of us will assign in different method)

Monday 2 December 2013

Assignment Problem (AP)

Assignment Problem can be stated in the form of n x n matrix Cij of real numbers as given in the following table.

                        Jobs
                      1       2        3               ..............n
Person   1 [    c11   c12    c13..........................c1n
              2        c21   c22    c23..........................c2n
               .
               .

               .
              n        cn1     cn2   cn3............................cnn]

Mathematical Formulation :

An Assignment problem can be stated as

Hungarian Method:
These are the steps to be followed in Hungarian Method for Optimal Job Assignment and for cost assignmnet.
STEP I: Check whether the given matrix is a square matrix.If its so then its balanced.If not balanced add "0" in either the row/column based on the matrix.
STEP II: Process row wise entries.Find out the smallest value and subtract the entire row value.
STEP III:Process  column wise entries.Find out the smallest value and subtract the entire column value.
STEP IV:Draw horizontal/vertical lines in such a way that they cover all the zeros ie., it should be crossed in minimum number of straight lines.
STEP V:Check whether Number of Straight lines(N) = Order of Matrix(n).
If N=n then we get the optimal solution.
If N<n then again find out the smallest value from the above matrix and subtract with the other values in the matrix.Leave the rows and columns that are being striked out.In the intersection point add the smallest value.
STEP VI:Finally assign the jobs to the correct person by assigning "0".Find the minimum cost.

Sunday 1 December 2013

MODI Method / Modification Distribution

Q1.Solve the TP.

                 D1       D2      D3       D4       Supply
O1            11        20       7           8           50
O2            21        16      20         12          40
O3             8         12       8            9          70
Demand    30        25      35          40


Soln:
STEP I:
Eai=160 Ebj=130.The given TP is unbalnced Therefore add a Destination Column.

               D1     D2       D3      D4     D5      Supply
O1          11      20         7         8       0           50
O2          21      16        20       12      0           40
O3            8       12         8         9      0           70
Demand   30      25        35       40    30

Eai=Ebj=160.Now the TP is Balanced.

STEP II:
Now calculate the IBFS using VAM .
The Solution will be,

                      35
11     20      7        8     0
                               10    30
21     16     20      12     0
   30      25   15        15
8       12     8         9       0


In the above table we have 7 independent non negative allocation and m=n-1=7. non degenerate Basic feasible solution is obtained.

Total Cost= Rs.1160

STEP III:
Now select the row or column which has the maximum number of allocations.
Here in the above table we have the maximum number of allocations in the 3rd row.
Therefore assign u3=0
-----------------------------------------
4            9                  35      0         4
  11          20            7            8           0            u1=-1
------------------------------------------
10          1             9                 10        30
   21         16           20          12          0           u2=3
------------------------------------------
   30            25           15          15     3
8              12           8             9           0             u3=0
--------------------------------------------
v1=8       v2=12     v3=8      v4=9     v5=-3


c31=u3+v1=8      c32=u3+v2=12      c33=u3+v3=8      c34=u3+v4=9

c24=u2+v4=12    c25=u2+v5=0        c13=u1+v3=7
         u2=3               v5=-3                         u1=-1


Now calculate
This should be calculated for all the cells which where not allocated.(This should be calculated for the cells in the table which was obtained as a result of applying VAM)

Now (Delta)ij >=0 .Therefore Optimal Solution with Total Cost= Rs.1160.


Vogel's Approximation Method / Unit Cost Penalty Method

Q1.Find the IBFS for the following TP by VAM.


                D1        D2         D3          D4          Supply
O1            11        13          17           14            250
O2            16        18          14           10            300
O3            21        24          13           10            400
Demand   200       225       275          250

Soln:
STEP I:
The given TP is a balanced one. Since Eai=Ebj=950.Therefore there exists a Feasible Solution.

STEP II:
Calculate Penalty (The difference between the Smallest and next smallest cost in each row and column).

        D1       D2     D3     D4          Supply        P1
        ------------------------
          200
O1  11        13      17        14         250              2(13-11)
O2  16        18       14        10        300              4
O3  21        24      13         10       400               3
      200     225     275        250
P2   5         5         1            0

Among the Penalty calculated Select the highest value and choose the cell which has the lowest cost.

                                                  P1
     50
13           17       14         250     1(14-13)
18           14       10          300    4
24           13       10         400     3
225        275      250
5               1         0   P2


Similarly if we calculate the final one will be      

    125
10       250
125


Solution is given by

   200       50
11        13        17     14
                175               125
16        18        14      10
                             275    125
21        24        13       10

The values are independent ie., the number of closed cycles is m+n-1=3+4-1=6

There are six positive independent allocation which equals to m+n-1=6.This ensures that the solution is non-degenerate Basic Feasible solution.

Transportation Cost=(11 x 200)+(13 x 50)+(18 x 175)+(10 x 125)+(13 x 275)+( 10 X 125)
                              =Rs.12075




Least Cost Method / Matrix Minima Method

Q1.Obtain the initial feasible solution for the following TP using Matrix Minima Method.


                 D1          D2        D3        D4       Supply
O1             1            2            3            4          6
O2             4            3            2            0          8
O3             0            2            2            1         10
Demand     4             6           8             6

Soln:  
STEP I:
Sum up Demand and Supply.
Since Eai=Ebj=24. There exists a feasible solution for TP.

STEP II:
In the Least Cost Method, we have to find out the least value in the given problem and start from there.
In this problem the least value is "0", so start from there,

------------------
1      2      3      4        6
4      3      2      0        8
   4
0      2       2     1       10
------------------
4      6       8      6



-----------------
2        3         4          6
                         6
3         2         0          8
2         2         1          6
------------------
6         8         6

------------
    6
2           3           6
3           2           2
2           2           6
------------
6           8


----------
3        2        2
    0
2         2        6
---------
0         8

Here we have subtracted the demand and supply values , in the previous steps the least values were "0" therefore we did not subtract it .

----
   2
2        2
2        6
---
8

-----
    6
2           6
-----
6

STEP III:
The Solution is given by:

                   6
1             2            3             4
                                 2              6
4              3            2             0
   4               0            6
0               2            2             1


Total Cost = (2 x 6)+(2 x 2)+(0 x 6)+(0 x 4)+(2  x 0)+(2 x 6)
                 = Rs.28