Showing posts with label AP. Show all posts
Showing posts with label AP. Show all posts

Tuesday, 3 December 2013

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.