You are on page 1of 14

BRANCH AND BOUND ALGORITHM (DANKINS BRANCHING METHOD)

CONSIDER THE PROBLEM MAX.

X 0 = 3X1 + 4X 2

S.T.

7 X1 + 16X 2 52 3X1 2X 2 9

X 1 , X 2 0 AND INTEGERS

THE COMPLETE TREE IS


N(1)

3 X1 =4, X 2 = 2

X0 = 18
X2 2

X2 1
N(2)

X1 3
N(8)

11 15 X1 = , X2 = X 0 = 1 3 X1 4
NO

N(3)

20 116 X1 = , X2 = X0 = 2 7 7
X1 3
NO FEASIBLE SOLUTION

13 X1 = , X2 = X0 = 3 1

N(9) FEASIBLE

SOLUTION

N(4)

X1 2 19 31 X1 = , X2 = X0 = 2 8 2 X2 3

N(5)

X2 2
N(6)

4 X 14 X1 = , X2 = LB= 0 = X1 = , X2 = X0 =96 2 2 3 7 7 N(7)

N(7) & N(8) ARE FATHONED NODES OPTIMAL SOLUTION IS N(0)

TRAVELLING SALESMAN PROBLEM A Travelling salesman has to visit n cities and return to starting city. He must visit every city and should visit only once. The costs of travel from city i to city j is given. To find the optimal tour, that is, the tour having smallest cost. Consider the problem Example The Tourist Bureau of India wants to find the optimal tour policy of five cities 1, 2, 3, 4, 5 starting from city 1 and finally returning to city 1. The cost of travel is shown in the figure below. Determine the optimal tour plan.

2 35 20 1 10 10 5 20 4 THE COST MATRIX OF ABOVE PROBLEM IS 20 15 30 3

TABLE - 1
TO FROM 1 2 3 4 5 1 20 10 10 2 20 30 35 3 30 15 20 4 10 15 20 5 10 35 20 20

In above the entries are cost of travel in Rs. In above cost matrix, the cost of a tour, which is not feasible is . We have specially selected the above example to show all aspects of the algorithm. In general the costs matrix is symmetric. But it is not necessary. One may have to pay some taxes while entering a particular city while entering another city there may be no taxes. We take in above example a symmetric cost matrix. The algorithm developed here is equally applicable to non-symmetric case also. Subtract from each row the smallest cost in that row. This will bring a zero in every row. Thus subtracting 10, 20, 15, 10, 10 from 1st, 2nd, 3rd, 4th, 5th rows respectively the cost matrix reduces to

TABLE - 2
0 0 0 10 15 25 10 5 10 0 0 10 0 15 5 10

65

Where at the bottom on the right we show the total reduction. If there is no zero in every column of Table 2, subtract appropriate quantity from columns to achieve this. Thus subtracting 10 and 5 from 2nd and 3rd columns respectively, The cost matrix in which there is at least one zero in every row and column will be called a reduced matrix. Thus the cost matrix of Table S is in reduced form. When we subtract 15 from 3rd row of Table 1 we make the travel from city 3 to every other city cheaper by Rs.15. Similar argument holds for other rows. When we subtract 10 from 2nd column of Table 2, we make travel to city 2 from every other city cheaper by Rs.10. Similar argument holds for other columns. The important point to note is that these row and column operations will change the cost of travel but do not change the identity of best (optimal) tour. Hence the programming problem is not disturbed.

We get

TABLE - S
0 5 0 0 0 5 0 5 5 15 5 0 5 5 0 0 0 5 10 10 15 5 0 5

80

Clearly the city pairs with zero cost in reduced cost matrix of Table S are candidate pairs to be included in the tour. In Table S, there are eight candidate pairs viz city pairs (1, 2), (1, 4), (1, 5), (2, 1), (3, 4), (4, 1), (4, 3) and (5, 4). All these can not be included in the tour. Inclusion of some will be more beneficial (of less cost) than others. To find out which candidate pair is most suitable for inclusion, we reason as follows: Suppose we exclude the candidate pair (2, 1) then what is the penalty? Excluding (2, 1) implies the following. (a) We must travel from city 2 to some city other than city 1. This will cost at least Rs.5, where Rs.5 is the smallest entry in row 2 other than entry in the cell (2, 1). (b) We must travel to city 1 from some city other than city 2. This will cost at least Rs.0, where Rs.0 is the smallest entry in column 1 other than entry in the cell (2, 1). Thus if we do not include in tour the candidate pair (2, 1) the penalty which we call the least cost of exclusion (LCE) of candidate pair (2, 1) is the sum of least costs in (a) and (b), that is, Rs.5 + Rs.0 = Rs.5. So the LCE for a candidate pair (i, j) is the sum of smallest entries in the ith row and jth column not taking into account the entry zero in cell (i, j). We now calculate the LCE for each candidate pair in reduced cost matrix of Table S. These LCE are written in Table S itself on south-east corner. Clearly the candidate pair for which LCE is largest must be included in the tour. Here there are six candidate pairs with largest LCE viz Rs.5. So there is a tie. We break the tie arbitrarily. Let ;us select arbitrarily the candidate pair (1, 5) for inclusion in the tour. Now we subdivide the set of all possible tours (solutions) S into two mutually exclusive subsets S 1

and S2, where S1 is the subset which do not include city pair (1, 5) and S2 is the subset which includes city pair (1, 5). In figure we shall denote S 1 by (1, 5) meaning that (1, 5) is not included and S2 by (1, 5).

ALL TOURS S

LB 80

LB 85 S1 Figure 1 Now we attach lower bounds as follows:

LB 90 S2

(1, 5)

(1, 5)

The LB on S is the amount subtracted from rows and columns to reduce the given cost matrix. Hence LB on S is 80. Lower bound on a node of bar type (i, j) = LB on earlier node of which it is the immediate subset + LCE for the candidate pair (i, j). (*) Lower bound on a Node (k, l) = LB on earlier node of which it is the immediate subset + cost of inclusion of candidate pair (k, l) (**) Here LB on Node (1, 5) = 80 + 5 = 85. To find out the LB on node (1, 5), we will calculate the cost of inclusion of pair (1, 5). Inclusion of pair (1, 5) in the tour has the following consequences: (a) Deletes the possibility of inclusion of pairs formed by 1st row and formed by 5th column. So in Table S, we delete 1st row and 5th column. (b) Deletes the possibility of inclusion of pair (5, 1). Because if we include city pair (5, 1) then we end in a sub-tour not visiting many cities. So inclusion of city pair (1, 5)

in tour makes inclusion of city pair (5, 1) infeasible, hence we replace the cost in cell (5, 1) by . We will in future write put in cell (i, j), which will mean put in cell (i, j) replacing earlier cost there. If cell (i, j) is empty then we do not put there, but leave the cell empty. (a) and (b) reduce Table S to

0 0

5 15

5 0 5

0 10

80

The cost of inclusion of candidate pair (1, 5) is the amount required to reduce the above matrix. Subtracting 5 from 5th row and then subtracting 5 from 2nd column, we get TABLE (1, 5)

0 5 0 0

0 5 5

5 0 0 0 5

0 5 5

90

The above matrix is in reduced form (that is having a zero in every row and column). The amount required to reduce matrix of Table S is 10. Hence L B on Node (1, 5) = 80 + 10 = 90. We now enter all L B in figure 1. The above matrix corresponds to Node (1, 5) so we number it as Table (1, 5). This type of correspondence in numbering will be maintained throughout. The method is to branch-off from the terminal node with smallest LB. It is node (1, 5) in figure 1. So we branch-off from Node (1, 5) in figure 1. So we branch-off from Node (1, 5). To get matrix corresponding to Node (1, 5) we go to original reduced cost matrix viz. Table S and put in cell (1, 5). This gives

0 0 0

0 5 15

5 0 5

0 0 10

15 5 10

80

Now reducing above matrix we get TABLE (1, 5) 0 5 0 0 0 5 0 5 5 15 5 0 5 5 0 0 0 0 10 5 10 0 5

85

The above is the reduced cost matrix corresponding to Node (1, 5). Since we have to branch-off from Node (1,5). We calculate LCE for each candidate pair in Table (1, 5) and enter these on south-east corner. We include in the tour the candidate pair having largest LCE. We break the tie arbitrarily by selecting the pair (1, 2) for inclusion, that is, we sub-divide the Node (1, 5) into subsets (1, 2) and (1, 2). FIGURE - 2

S 85 (1, 5) 90 (1, 2) (1, 2)

80

90 (1, 5) 90

Now we calculate the LB on Node (1, 2) and Node (1, 2). Henceforth for node we shall use N LB on N (1, 2) earlier LB + LCE for candidate pair (1, 2) = 85 + 5 = 90. To find out LB on N (1, 2), we in Table (1, 5), delete row 1 and column 2 and put in infeasible cell (2, 1). We get

0 0

5 0 5

0 10

10 0 5

85

Reducing above matrix by subtracting 5 from 1st row, we get TABLE (1, 2)

0 0 0 5

0 5 0 0 5

0 0 10

5 0 5 5

90

The cost of inclusion of city pair (1, 2) is the amount subtracted from preceding matrix to get the above reduced matrix. Hence cost of inclusion of city pair (1, 2) is 5. Thus L B on N(1, 2) = earlier LB + cost of inclusion of (1, 2) = 85 + 5 = 90. We enter these LB on figure 2. This completes one iteration. Now the terminal nodes are N(1, 2), N(1, 2) and N(1, 5). All have same LB. We can select any out of these for branching. To branch-off from a bar type node taken is to be the last choice, because (as we shall see) it is cumbersome to branch-off from a node of bar type. We now arbitrarily select N(1, 2) for branching. The matrix corresponding to N(1, 2) is Table (1, 2). Now we calculate LCE for candidate pairs of Table (1, 2) and enter these there. The largest LCE viz. 10 is for candidate pair (3, 4). So we include pair (3, 4) in the tour, that is, branch-off from N(1, 2) into N(3, 4) and N(3, 4). FIGURE - 3

80 S 85 (1, 5) 90 (1, 2) 100 (3, 4) (3, 4) (1, 2) 95 90 (1, 5) 90

We next calculate LB on N(3, 4) and N(3, 4). LB on N(3, 4) = 90 + LCE for pair (3, 4) = 100.

To find out LB on N(3, 4) delete row 3, column 4 and put in infeasible positions in Table (1, 2). This tour includes (1, 2) and (3, 4), hence the infeasible positions are (2, 1) and (4, 3). We get

0 0 5 Reducing the above matrix, we get

90

TABLE (3, 4)

0 5

0 0

0 0 0 5 Hence LB on N93, 4) = 90 + 5 = 95.

0 0 95

In figure 3, the terminal nodes with smallest LB are N(1, 2) and N(1, 5). We select N(1, 5) for branching. The table corresponding to this node is Table (1, 5). We now calculate LCE for candidate pairs of this table and enter these in the table. (Note that it is at this stage when we calculate LCE for Table (1, 5) and enter them in Table (1, 5). The LCE are not calculated when Table (1, 5) was made. This holds for earlier cases also). Including pair (3, 4), that is, branching from N(1, 5) into N(3, 4) a and N(3, 4) a, we get LB on N(3, 4) = 90 + 5 = 95 In Table (1, 5) delete row 3, column 4 and put In infeasible positions (5, 1) and (4, 3). Reducing this matrix we get Hence LB on N(3, 4) a = 95. Now we have to branch-off from N(1, 2). We will write the rules for branching from a bar type node with reference to node (3, 4). We purposely select N(3, 4) for this purpose, because this node includes a node of non-bar type also viz. N(1, 2). The rules are (1) Go to original reduced cost matrix viz. Table S. (2) The subset of tours represented by N(3, 4) includes city pair (1, 2) so delete row 1 and column 2 in the matrix of (1). (3) In view of (2) put with infeasible city pairs, that is, put in cell (2, 1). Check infeasible subtours also. (4) Put with city pairs not included in the subset of tours represented by N(3, 4). Here put at cells (1, 5) and (3, 4). (5) Reduce the matrix of (4). This reduced matrix will correspond to N(3, 4) and will have same LB as calculated earlier viz. 95. With this matrix branch-off as usual by calculating LCE. The above are general rules applicable to any bar type node. In the example we are solving, we have to branch-off from N(1, 2). Using (1) to (4) of above rule, we get Using (5), we get The above matrix corresponds to N(1, 2). Now we can branch-off from N(1, 2). Calculate LCE for Table (1, 2) and proceed as usual. Largest LCE is for candidate pair (1, 4). So we branch-off into N(1, 4) and N(1, 4). Now we shall make part figures (branches). Kindly go on to attaching these branches to the tree of figure 4. LB on N(1, 4) = 90 + = .

To find out LB on N(1, 4), we in Table (1, 2), delete row 1 and column 4, and put in infeasible positions. We get This is already in reduced form, hence LB on N(1, 4) is 90 + 0 = 90. Now we branch-off from N(1, 4). Calculate LCE in Table (1, 4) and proceed as usual. Branch-off into N(3, 2) and N(3, 2). The table corresponding to N(3, 2) is (after reduction) Now the terminal nodes are (1, 4), (3, 2), (3, 2), (3, 4), (3, 4). Any node with smallest LB can be branched-off. Let us take N(3, 2) So refer to Table (3, 2), calculate LCE for Table (3, 2) and proceed as usual. Now include (2, 1). While obtaining table (2, 1) we have deleted row 2, column 1 and put in infeasible positions. There is an important step as regards to infeasible positions. In above one infeasible position is (1, 2), but this position is empty. Another infeasible position is obtained as follows: The subset of tours coming to N(2, 1) includes city pairs (1, 4), (3, 2), (2, 1) that is (3, 2), (2, 1), (1, 4). This implies that inclusion of city pair (4, 3) is infeasible, otherwise we end in a sub-hour. Thus, we put in cell (4, 3). This type of infeasible position should be checked at every step. Now we branch-off from N(3, 4). For this we go to Table (3, 4) and calculate LCE for candidate pairs etc. We include (2, 3). While obtaining Table (2, 3) we have deleted row 2, column 3 and have put in infeasible positions (3, 2) and (4, 1) (Note that (1, 2), (3, 4), (2, 3) => (4, 1) in infeasible. Now we branch-off N(2, 3). Include (4, 5). The above table is obtained by deleting row 4 and column 5. Note that at the end step, when there is only one entry in the table, there does not arise the question of ending in a sub-tour. Hence there are no infeasible positions. The zero element in above matrix shows that city pair (5, 1) must be included in the tour.

80 S 85 (1, 5) 90 90 (1, 2) (1, 2) 95 (3, 4) (1, 4) 100 90 (1, 4) 100 95 (3, 2) (3, 2) 100 100 (2, 1) (2, 1) To get the optimal tour we read upwards from N(5, 1). The optimum tour is (5, 1), (4, 5), (2, 3), (3, 4), (1, 2) and not (1, 5), That is, (1, 2), (2, 3), (3, 4), (4, 5), (5, 1), That is, (1, 2, 3, 4, 5, 1). The optimum cost is the last LB, that is Rs.95. (5, 1) 95 (2, 3) (4, 5) (4, 5) (3, 4) 95 (2, 3) 95 95 (3, 4)a (3, 4)a 95 90 (1, 5) 95

You might also like