0% found this document useful (0 votes)
17 views11 pages

Lect 6-Branch-Bound Hangarian

1) The document describes a process for assigning jobs to people with the goal of minimizing total cost. It involves finding zeros in a cost matrix and using them to cover rows and columns. 2) When the number of covering lines equals the number of rows/columns, assignments can be made by matching each uncovered cost to a person and job. 3) The example shows applying this process to two cost matrices, finding cycles of assignments, and breaking cycles by setting costs to infinity to determine the overall minimum cost.

Uploaded by

zezokhalid99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views11 pages

Lect 6-Branch-Bound Hangarian

1) The document describes a process for assigning jobs to people with the goal of minimizing total cost. It involves finding zeros in a cost matrix and using them to cover rows and columns. 2) When the number of covering lines equals the number of rows/columns, assignments can be made by matching each uncovered cost to a person and job. 3) The example shows applying this process to two cost matrices, finding cycles of assignments, and breaking cycles by setting costs to infinity to determine the overall minimum cost.

Uploaded by

zezokhalid99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Prof/Mohamed Amin

J1 J2 J3 J4
A 9 2 7 8
B 6 4 3 7
C 5 8 1 8
D 7 6 9 4

First, select smallest value in each row and subtract it from all
elements of this row (e.g. in row1 the smallest value is 2)
J1 J2 J3 J4
A 7 0 5 6
B 4 1 0 4
C 4 7 0 7
D 3 2 5 0

Second, if a column has no zeros, then do the same for such


columns similar to rows (e.g. column 1 has no zeros)
J1 J2 J3 J4
A 4 0 5 6
B 0 1 0 4
C 1 7 0 7
D 0 2 5 0

Third, cover all columns and rows that have zero’s by minimum
number of lines. If the number of covering lines equal to the
number of rows, then begin the assignment process:

Person Jobs Cost


A J2 2
B J1 6
C J3 1
D J4 4
2+6+1+4=13
J1 J2 J3
A1 20 15 31
A2 17 16 33
A3 18 19 27

J1 J2 J3
A1 5 0 16
A2 1 0 17
A3 0 1 9

Note that the third column has no zeros

J1 J2 J3
A1 5 0 7
A2 1 0 8
A3 0 1 0
J1 J2 J3
A1 5 0 7
A2 1 0 8
A3 0 1 0

Notice that the number of covered lines are less than the number of rows(columns)
We select the smallest value from the uncovered cells and subtract it from all
uncovered cells. This yields

J1 J2 J3 J1 J2 J3
A1 4 0 6 A1 4 0 6
A2 0 0 7 A2 0 0 7
A3 0 1 0 A3 0 1 0

Now, the covered lines = number of rows(columns)


Thus, assign one person to one job and calculate
the overall cost
C1 C2 C3 C4 C5
C1 ∞ 1 7 4 3
C2 2 ∞ 6 3 4
C3 1 6 ∞ 2 1
C4 1 5 4 ∞ 6
C5 7 5 4 5 ∞

Step 1: find zeros of each row

C1 C2 C3 C4 C5
C1 ∞ 0 6 3 2
C2 0 ∞ 4 1 2
C3 0 5 ∞ 1 0
C4 0 4 3 ∞ 5
C5 3 1 0 1 ∞
Step 2: find zeros of each column

C1 C2 C3 C4 C5
C1 ∞ 0 6 2 2
C2 0 ∞ 4 0 2
C3 0 5 ∞ 0 0
C4 0 4 3 ∞ 5
C5 3 1 0 0 ∞

Step 3: find covering lines

C1 C2 C3 C4 C5
C1 ∞ 0 6 2 2
C2 0 ∞ 4 0 2
C3 0 5 ∞ 0 0
C4 0 4 3 ∞ 5
C5 3 1 0 0 ∞
Step 4 : Covering lines= number of lines
• c1
C1 C2
C2 C4 • c4 • c2
C4 C1
C3 C5 • c3 • c5
C5 C3

As observed from the above figure, we have 2 cycles: the first is c1, c2, c4, c1
and the second is c3, c5, c3. We deal with the small cycle c3, c5, c3. To break the
small cycle into 2 paths c3 c5 put C(3,5)=∞ then resolve the problem. And for
c5 c3 put C(5,3)=∞ and again resolve the problem.
Let’s start with the case C(3,5)=∞
C1 C2 C3 C4 C5
C1 ∞ 0 6 3 2
C2 0 ∞ 4 1 2
C3 0 5 ∞ 1 ∞
C4 0 4 3 ∞ 5
C5 3 1 0 1 ∞
step 1: all rows have zeros. Step 2: find zeros of column no. 5. Then Step 3: find
covering lines

C1 C2 C3 C4 C5
C1 ∞ 0 6 2 0
C2 0 ∞ 4 0 0
C3 0 5 ∞ 0 ∞
C4 0 4 3 ∞ 3
C5 3 1 0 0 ∞

Now, the covered lines = number of


rows(columns) Thus, we can calculate the
overall distance=12
For the second case: we put C(5,3)=∞
apply the same steps as in the first approach

C1 C2 C3 C4 C5
C1 ∞ 1 7 4 3
C2 2 ∞ 6 3 4
C3 1 6 ∞ 2 1
C4 1 5 4 ∞ 6
C5 7 5 ∞ 5 ∞

C1 C2 C3 C4 C5
C1 ∞ 0 6 3 2
C2 0 ∞ 4 1 2
C3 0 5 ∞ 1 0
C4 0 4 3 ∞ 5
C5 2 0 ∞ 0 ∞
C1 C2 C3 C4 C5
C1 ∞ 0 3 3 2
C2 0 ∞ 1 1 2
C3 0 5 ∞ 1 0
C4 0 4 0 ∞ 5
C5 2 0 ∞ 0 ∞

C1 C2 C3 C4 C5
C1 ∞ 0 3 3 2
C2 0 ∞ 1 1 2
C3 0 5 ∞ 1 0
C4 0 4 0 ∞ 5
C5 2 0 ∞ 0 ∞

Now, we have 2 cycles c1, c2, c1 and c3,c5,c4,c3. which is left as an exercise?

You might also like