0% found this document useful (0 votes)
33 views

Lecture 3 - Branch and Bound

The document discusses the branch and bound algorithm for solving integer programs. It describes the key steps of branching, bounding, and fathoming to iteratively solve subproblems until reaching the optimal solution. An example of using branch and bound to solve the traveling salesperson problem is provided, showing the process of branching on variables and pruning subproblems until identifying the shortest route between 6 cities with a total distance of 668 miles.

Uploaded by

immanuel Matthew
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)
33 views

Lecture 3 - Branch and Bound

The document discusses the branch and bound algorithm for solving integer programs. It describes the key steps of branching, bounding, and fathoming to iteratively solve subproblems until reaching the optimal solution. An example of using branch and bound to solve the traveling salesperson problem is provided, showing the process of branching on variables and pruning subproblems until identifying the shortest route between 6 cities with a total distance of 668 miles.

Uploaded by

immanuel Matthew
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/ 24

KECERDASAN BUATAN

Lecture 2 : Branch and Bound


Branch and Bound (B&B)
• Branch and Bound (B&B) is an exact method that
guarantees finding optimal solutions by following
a divide-and-concur approach
• It is commonly used to solve Integer Programs
(IP), Binary Integer programs (BIP), and Mixed
Integer Programs (MIP)
• Integer Programs in general are NP, while Linear
Programs are P (solvable in polynomial time using
the Simplex Algorithm)
• Most, if not all, Solvers implement this method,
among others, to find optimal solutions
Steps for Branch and Bound Method
• Step 1: Branching
• Relax the initial problem and find a solution
(this is not the solution you are looking for, it
is the relaxed solution).
• Partition the set of feasible solutions by
selecting a variable (x1) and setting it to x1=0,
and x1=1.
• This initiates the first iteration of
subproblems.
Steps for Branch and Bound Method
• Step 2: Bounding
• Solve the two relaxations of the problem for
the first iteration (solve the two subproblems).
• This allows us to see which branch we need to
further explore.
Steps for Branch and Bound Method
• Step 3: Fathoming
• By fathoming (pruning) we mean to dismiss a
branch from further consideration.
• We fathom a branch when:
1) The subproblem is infeasible (discard).
2) The subproblem has an integer solution (stop
branching, keep the value for future comparisons).
3) If the subproblem has an optimum that is less than
the optimum of the other branch, discard that
problem. The incumbent optimum is denoted by Z*.
Steps for Branch and Bound Method
• Continue iterations by branching, bounding,
and fathoming.
• Stop when there are no remaining
subproblems.
Example
• Branch and Bound Approach for Traveling
Salesperson Problem
• Joe State lives in Gary, Indiana. He owns
insurance agencies in 6 cities. The distance
between each cities (in miles) is shown in the
next slide. What order of visiting his agencies
will minimize the total distance traveled?
Distances of Cities
Destination
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
Origin 3 217 290 M 113 303
4 164 201 113 M 196
5 58 79 303 196 M
Possibilities
• In case of 3 cities : A, B, C (2 routes : (3-1)! = 2)
– ABC
– ACB
• In case of 4 cities : A, B, C, D (6 routes : (4-1)! = 6)
– ABCDA
– ABDCA
– ACBDA
– ACDBA
– ADBCA
– ADCBA
• For 10 cities : 9! = 362880 routes, really hard to list
them all, thus need to use optimization
Solution
• To tackle the traveling salesperson problem,
define
– 𝑥𝑖𝑗 = 1 if Joe leaves city I and travels next to city j
– 𝑥𝑖𝑗 = 0 otherwise
Also, for i  j
– 𝑐𝑖𝑗 = distance between cities i and j
– 𝑐𝑖𝑖 = M, where M is a large positive number
• This can be solved as assignment problem
using Branch and Bound
1. Sub Problem 1
Destination
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
Origin 3 217 290 M 113 303
4 164 201 113 M 196
5 58 79 303 196 M

X15 = X21 = X34 = X43 = x52 =1


Total Distance : 495
Sub Tour X15 → X52 → X21
Sub Tour X34 → X43
Since there are 2 sub tour (> 1 tour) the solution is not optimal
Branching
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M
2. Sub Problem 2
SUB PROBLEM 2 = SP 1 + X34 = M ; Solve With Hungarian Method
Destination
Row's min
City 1 2 3 4 5 value
1 M 132 217 164 58 58
2 132 M 290 201 79 79
Origin 3 217 290 M M 303 217
4 164 201 113 M 196 113
5 58 79 303 196 M 58
Destination
City 1 2 3 4 5
1 M 74 159 106 0
2 53 M 211 122 0
Origin 3 0 73 M M 86
4 51 88 0 M 83
5 0 21 245 138 M
Column's
min value 0 21 0 106 0
2. Sub Problem 2 (cont’)
Destination

City 1 2 3 4 5

1 M 53 159 0 0

2 53 M 211 16 0
Origin 3 0 52 M M 86

4 51 67 0 M 83

5 0 0 245 32 M
Scan rows first
Skip first row because there are 2 zero value
Second row, third row, fourth row and five row, each have zero
After that scan column
The fourth column has one zero
2. Sub Problem 2 (cont’)
Destination

City 1 2 3 4 5

1 M 132 217 164 58

2 132 M 290 201 79


Origin 3 217 290 M 113 303

4 164 201 113 M 196

5 58 79 303 196 M

X14 = X25 = X31 = X43 = X52 = 1


For Z refer to the first table (distance table)
Z = 217+79+113+164+79 = 652
Sub Tour X14 → X43 → X31
Sub Tour X25 → X52
Branching
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M

SP 2

2 Z =652
X14 = X25 = X31
= X43 = X52 = 1

X25 = M X52 = M
3. Sub Problem 4
SUB PROBLEM 4 = SP 2 + X25 = M ; Solve With Hungarian Method

Destination
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 M
Origin 3 217 290 M M 303
4 164 201 113 M 196
5 58 79 303 196 M

X15 = X24 = X31 = X43 = X52


Z = 58 + 201 + 217 + 113 + 79 = 668
Tour X15 → X52 → X24 → X43 → X31

(Optimal Solution)
Branching
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M

SP 2

2 Z =652
X14 = X25 = X31
= X43 = X52 = 1

X25 = M X52 = M

SP 4
Z =668
X15 = X24 = X31
= X43 = X52 = 1
Candidate Solution

3
4. Sub Problem 5
SUB PROBLEM 5 = SP 2 + X52 = M ; Solve With Hungarian Method

Destination
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
Origin 3 217 290 M M 303
4 164 201 113 M 196
5 58 M 303 196 M

X14 = X25 = X32 = X43 = X51


Z = 164 + 79 + 290 + 113 + 58 = 704
Tour X14 → X43 → X32 → X25 → X51

SUB PROBLEM 5 IS NOT BETTER THAN SUB PROBLEM 4 BECAUSE


THE Z VALUE IN SP 5 > SP 4
Branching
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M

SP 2

2 Z =652
X14 = X25 = X31
= X43 = X52 = 1

X25 = M X52 = M

SP 4 SP 5
Z =668 Z =704
X15 = X24 = X31
= X43 = X52 = 1
Candidate Solution
X14 = X25 = X32
= X43 = X51 = 1
X
3 4
5. Sub Problem 3
SUB PROBLEM 3 = SP 1 + X43 = M ; Solve With Hungarian Method

Destination
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
Origin 3 217 290 M 113 303
4 164 201 M M 196
5 58 79 303 196 M

X14 = X25 = X32 = X43 = X51


Z = 217 + 79 + 113 + 164 + 79 = 652
Sub Tour X13 → X34 → X41
Sub Tour X25 → X52
Branching
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M

SP 2 SP 3

2 Z =652
X14 = X25 = X31
= X43 = X52 = 1
Z =652
X13 = X25 = X34
= X41 = X52 = 1
5
X25 = M X52 = M X25 = M X52 = M

SP 4 SP 5
Z =668 Z =704
X15 = X24 = X31
= X43 = X52 = 1
Candidate Solution
X14 = X25 = X32
= X43 = X51 = 1
X
3 4
Sub Problem 6 & 7
SP 1

1
Z =295
X15 = X21 = X34
= X43 = X52 = 1

X34 = M X43 = M

SP 2 SP 3

2 Z =652
X14 = X25 = X31
= X43 = X52 = 1
Z =652
X13 = X25 = X34
= X41 = X52 = 1
5
X25 = M X52 = M X25 = M X52 = M

SP 4 SP 5 SP 6 SP 7
Z =668 Z =704 Z =704 Z =910
X15 = X24 = X31
= X43 = X52 = 1
Candidate Solution
X14 = X25 = X32
= X43 = X51 = 1
X X15 = X34 = X23
= X41 = X52 = 1
X
X13 = X25 = X31
= X42 = X54 = 1
X
3 4 6 7
Assignment
• Please add the distances of each city to other
cities with the last number of your Student ID.
In case of the last number is 0 please add the
each distances with 10
• Please conduct the procedure above, with the
new distances of each city to other cities.

You might also like