Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

12 Integer Programming

Uploaded by

Vedaant Nigam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

12 Integer Programming

Uploaded by

Vedaant Nigam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 109

Integer Programming Problem

1
Why study integer programming?

1. The LP divisibility assumption (fractional


solutions are permissible) is not always
valid.

2. Binary variables allow powerful new


techniques like logical constraints.

3. Many different real-life situations can be


modeled as integer programs (IPs).

4. There are efficient algorithms to solve IPs.

2
Applications

• Project Selection Problem (Knapsack Problem)


• Facility Location Problem
• Fixed Charge Problem
• Cutting Stock Problem
• Set Covering Problem

3
Project Selection Problem (Knapsack Problem)

• You have 5 Projects

Project Cost Profit


P1 5000 4000
P2 6000 4500
P3 3500 3000
P4 8000 9500
P5 7500 6400

• Your budget is Rs. 18000. Which Projects will you


choose so that total profit is maximized?
4
Project Selection: Formulation
Decision Variable
xj =1, if project Pj is selected
0, otherwise for all j = 1, 2, …,5

Max 4000 x1+ 4500 x2+ 3000 x3+ 9500 x4+ 6400 x5
s.t. 5000 x1+ 6000 x2+ 3500 x3+ 8000 x4+ 7500 x5≤ 18000

xi ∈ {0,1}, for all i = 1, 2, …,5


• Additional Constraints:
i. At most three projects can be selected: x1+ x2+ x3+ x4+ x5≤ 3
ii. If project 2 is selected then project 1 must be selected: x2 ≤ x1
iii. If Project 2 is selected then project 4 cannot be selected: x2+x4 ≤ 1
5
Fixed-Charge Problem
• A garment company manufactures three types of
clothing: shirts, shorts and pants
• The machine needed for manufacturing each type of
clothing is rented.

Clothing Labor Cloth Rent Variable cost Sales price


type (Hours) (sq m) ($ per week) ($ per unit) ($)
Shirt 3 4 200 6 12
Shorts 2 3 150 4 8
Pants 6 4 100 8 15
Availability 150 hr/week 160 sq m

• Formulate an IP to maximize weekly profit.


6
Fixed-Charge Problem: Formulation
• Decision Variable:
x1 = number of shirts produced per week
x2 = number of shorts produced per week
x3 = number of pants produced per week
yj = 1 if xj > 0 for all j = 1, 2, 3
0, otherwise

Max (12x1 + 8x2 + 5x3) − (6x1 + 4x2 + 8x3) − (200y1 + 150y2 + 100y3)
s.t. 3x1 + 2x2 + 6x3 ≤ 150 (Labor)
4x1 + 3x2 + 4x3 ≤ 160 (Cloth)
xj ≤ Mjyj , j = 1, 2, 3 where Mj = a large positive integer
x1, x2, x3 ≥ 0 and Integer
yj  {0,1}, j = 1, 2, 3
7
Cutting Stock Problem (1-Dimentional)
P.C. Gilmore & R.E. Gomory, (1960). A Linear Programming Approach to the
Cutting Stock Problem. Operations Research 9, 849-859.

• Suppose a company produces a wide, continuous sheet of


material (steel, film, paper, fabric, etc.).
• Customers demand various width of thinner strips.
• How should you cut the wide sheet into strips to meet demand
while minimizing either amount of raw material cut or amount
wasted? 8
Cutting Stock Problem: Example
• The customers demand 25 of 3-ft boards, 20 of 5-ft
boards, and 15 of 9-ft boards. A company
manufactures 17-ft boards, wants to minimize the
waste incurred.
• Solution:
- The company must decide how each 17-ft board
should be cut.
- In general, any cutting pattern that leaves 3 ft or more
of waste need not be considered because we could use
the waste to obtain one or more 3-ft boards.

9
Example of Patterns for 17 Feet Wide board
Ways to cut board
Pattern Number of Waste Decision
(i) 3-ft sheet 5-ft sheet 9-ft sheet (feet) Variable
1 5 0 0 2 x1
2 4 1 0 0 x2
3 2 2 0 1 x3
4 2 0 1 2 x4
5 1 1 1 0 x5
6 0 3 0 2 x6
Demand 25 20 15

Decision variable
xi = number of 17-ft boards cut according to pattern i 10
Cutting Stock Problem: Formulation
• Objective: Minimize waste
Waste = Total width of boards cut − Total demand
17(x1+x2+x3+x4+x5+x6) −(25x3+20x5+15x9)
 Min 17(x1+x2+x3+x4+x5+x6) −310
 Min 17(x1+x2+x3+x4+x5+x6)
 Min x1+x2+x3+x4+x5+x6

• Constraints
- Meet demand of at least 25 for 3-ft sheets
5 x1 + 4 x2 + 2 x3 + 2 x4 + x5  25
- Meet demand of at least 20 for 5-ft sheets
x2 + 2 x3 + x5 + 3 x6  20
- Meet demand of at least 15 for 9-ft sheets
x4 + x5  15
- Non-negativity constraint
xi  0 for all i = 1, 2, …, 6 and integer
11
Set Covering Problem
Overlapping services are offered by a number
of facilities to a number of customers
To find a set of facilities from among a finite
set of candidate facilities so that every
demand node is covered by at least one
facility
Notations:
cj = cost of locating facility at site j

aij =
1 if customer i can be covered by facility located at site j

xj =
{ 0 Otherwise

{ 1 if facility is located at site j

0 Otherwise

Formulation:

n
Minimize  c j x j (Cost of covering each customer)
j 1
n
Subject to a x
j 1
ij j 1 i  1,2,..., m (Each customer is covered by at least one facility)

x j  0 or 1 j  1, 2,..., n
Set Covering Problem: Example
Delhi govt. wants to locate several medical emergency response
units so that it can respond to calls within Delhi within 8 minutes
of the call. Delhi is divided into seven population zones. The
travel time between the centers of each pair of zones is known and
is given in the matrix below.
Not Symmetric, tij ≠ tji
Data: travel time between seven zones
Zone 1 2 3 4 5 6 7
1 0 4 12 6 15 10 8
2 8 0 15 60 7 2 3
3 50 13 0 8 6 5 9
[tij] =
4 9 11 8 0 9 10 3
5 50 8 4 10 0 2 27
6 30 5 7 9 3 0 27
7 8 5 9 7 25 27 0 14
Other information
The response units can be located in the center of
population zones 1 through 7 at a cost (in hundreds of
thousands of dollars) of 100, 80, 120 110, 90, 90, and
110, respectively. Formulate an appropriate set
covering model to determine where the units are to
be located and how the population zones are to be
covered.

Decision Variable:
xj = 1, if medical emergency response unit is located at zone j
= 0, Otherwise

15
Set Covering Problem: Formulation

Minimize 100x1+80x2+120x3+110x4+90x5+90x6+110x7
Subject to (each zone must be covered by at least one medical
emergency response units )
x1 + x2 + x4 + x7 > 1 (To cover zone 1)
x1 + x2 + x5 + x6 + x7 > 1 (To cover zone 2)
x3 + x4 + x5 + x6 > 1 (To cover zone 3)
x3 + x4 + x7 > 1 (To cover zone 4)
x2 + x3 + x5 + x6 > 1 (To cover zone 5)
x2 + x3 + x5 + x6 > 1 (To cover zone 6)
x1 + x2 + x4 + x7 > 1 (To cover zone 7)

x1, x2, x3, x4, x5, x6, x7 ∈ {0,1} 16


Modeling technique:
Either-Or Constraints
• Suppose the following two constraints are given
5x1 + x2 + 9x3  1500 (1)
2x1 + 3x2 + 4x3  1000 (2)
• We want to ensure that only one of the two constraints
can be active. (called either-or constraints)
• How to achieve that in the model?
• 5x1 + x2 + 9x3  1500 + M(y) (1’)
2x1 + 3x2 + 4x3  1000+ M(1-y) (2’)
y ∈ {0,1}
M is a large positive number.
17
k out of p constraints must hold
• Suppose the model includes a set of p constraints
f1(x1, x2, …, xn)  d1
f2(x1, x2, …, xn)  d2
....
fp(x1, x2, …, xn)  dp
such that only some k of these constraints must hold.
• Generalizing the big M method of the previous slide,
that condition is achieved by the following set of constraints:
f1(x1, x2, …, xn)  d1+My1
f2(x1, x2, …, xn)  d2+My2
….
fp(x1, x2, …, xn)  dp+Myp
y1+y2+…+yp = p – k
y1, y2,…, yp binary
18
Integer Programming (IP)
(LP problem + xj are integers)
i.e., Integer Linear Programming (ILP) Problem

PURE IP Binary (or 0-1) IP Mixed IP


(all xj integer) (xj =0 or 1) (some xj ≥ 0 & remaining xj
integer)

19
Pure Integer Model

■ Machine shop obtaining new presses and lathes.


■ Marginal profitability: each press $100/day; each lathe $150/day.
■ Resource constraints: $40,000 budget, 200 sq. ft. floor space.
■ Machine purchase prices and space requirements:

Required
Machine Floor Space (ft.2) Purchase Price

Press 15 $8,000

Lathe 30 4,000

20
Pure Integer Model: Formulation

Integer Programming Model:

Maximize Z = $100x1 + $150x2


subject to:
$8,000x1 + 4,000x2  $40,000
15x1 + 30x2  200 ft2
x1, x2  0 and integer
x1 = number of presses
x2 = number of lathes

21
0 - 1 Integer Model

■ Recreation facilities selection to maximize daily usage by residents.

■ Resource constraints: $120,000 budget; 12 acres of land.


■ Selection constraint: either swimming pool or tennis center (not
both).

Expected Usage Land Requirement


Recreation
(people/day) Cost ($) (acres)
Facility
Swimming pool 300 35,000 4
Tennis Center 90 10,000 2
Athletic field 400 25,000 7
Gymnasium 150 90,000 3

22
0 - 1 Integer Model Formulation

Integer Programming Model:


Maximize Z = 300x1 + 90x2 + 400x3 + 150x4
subject to:
$35,000x1 + 10,000x2 + 25,000x3 + 90,000x4  $120,000
4x1 + 2x2 + 7x3 + 3x4  12 acres
x1 + x2  1 facility
x1, x2, x3, x4 = 0 or 1
x1 = construction of a swimming pool
x2 = construction of a tennis center
x3 = construction of an athletic field
x4 = construction of a gymnasium
23
Mixed Integer Model

■ $250,000 available for investments providing greatest return after


one year.
■ Data:
 Flat cost $50,000/unit; $9,000 profit if sold after one year.
 Land cost $12,000/ acre; $1,500 profit if sold after one year.
 Municipal bond cost $8,000/bond; $1,000 profit if sold after
one year.
 Only 4 flats, 15 acres of land, and 20 municipal bonds available.

24
A Mixed Integer Model: Formulation

Integer Programming Model:


Maximize Z = $9,000x1 + 1,500x2 + 1,000x3
subject to:
50,000x1 + 12,000x2 + 8,000x3  $250,000
x1  4 Flats
x2  15 acres
x3  20 bonds
x2  0
x1, x3  0 and integer
x1 = flats purchased
x2 = acres of land purchased
x3 = bonds purchased
25
What an Integer Program looks like?

Linear Program Integer Program


Min 3x1  2 x2 Min 3x1  2 x2
S.t. 3x1  x2  6 S.t. 3x1  x2  6
4 x1  3x2  12 4 x1  3x2  12
x1  x2  6 x1  x2  6
x1 , x2  0 x1 , x2  0, Integer
26
Solution of Integer Programming
Problem (IPP)
Product Mix Example

Product Quantity LP Solution


Prod1 0 0
Prod2 0 0
Prod3 1440 1440
Prod4 825 825.8065
Prod5 3261 3261.935
Prod6 867 867.0967

27
Where can you use the LP solution for
“discrete” problems?
Where the numbers involved are large enough for
a rounding off to be meaningful:

For example: if your LP solution asks you to


produce 1034.23 bags, you may not go too wrong
if you produce 1034.

What about 11.64 Boeing airplanes?


Logical Decisions
28
Rounding down a LP solution is okay in
these cases
IP
optimum
LP
optimum

x2
Increasing
objective
function value

x1 29
You can go wrong here
■ Rounding non-integer solution values up to the nearest integer
value can result in an infeasible solution.

LP
optimum
IP
optimum
x2
Increasing
objective
function value

x1 30
You could go wrong
 If you have a particularly pointed feasible
region
 If you use LP to predict the solution for an IP
where variables can have only 0-1 values
(Typically in take/leave situations).

31
Linear Program Solution Space
Example
Min 3 x1  2 x2
S.t. 3 x1  x2  6
4 x1  3 x2  12
x1  x2  6
x1 , x2  0
LP Optimal Solution
x2

Feasible Solution Space


(1.2, 2.4)

x1
32
Integer Program Solution Space
Min 3x1  2 x2
S.t. 3x1  x2  6
4 x1  3x2  12
x1  x2  6
x1 , x2  0, Integer
IP Optimal Solution (1, 3)

x2
Feasible solution

x1 33
Solving Integer Linear Programming Problem

 Enumeration Techniques
- Exhaustive Enumeration
- Branch and Bound
 Cutting Plane Approach

 Exhaustive Enumeration
Systematically generate and evaluate all
possible solutions and choose the (feasible)
solution with the optimal (best) value
34
Exhaustive Enumeration (contd…)
P0: Max 3x1 + 2x2 Branching
on x1 x1=?
s.t. x1 + x2 ≤ 3 P0
x2=?
x1, x2 {0,1}
Branching x1= 1 x1 = 0
on x2
P1: Max 3x1 + 2x2
s.t. x1 + x2 ≤ 3 P1 x1= 1 P2 x1= 0
x2=? x2=?
x1 = 1
x2=1 x2=0
x2 {0,1} x2=1 x2=0
P4: Max 3x1 + 2x2
s.t. x1 + x2 ≤ 3 P3 P4 P5 P6

x1 = 1
x1=1 x1=1 x1=0 x1=0
x2 = 0 x2=1 x2=0 x2=1 x2=0
OBJ Value: 5 3 2 0
35
Exhaustive Enumeration (contd…)
Consider an ILP with n binary variables:
 Exhaustive enumeration will generate and evaluate
2n solutions.

Number of binary variable Number of enumeration


(n) 2n
2 4
3 8
10 1024
25 3355432
50 1.126 x 1015

 Exhaustive enumeration is rarely used in practice


36
Branch and Bound
A way of systematically enumerating a small
fraction (hopefully) of feasible solutions to come
up with the optimal solution.
The concept of this method is to divide and
conquer, where we break down the large difficult
problem into smaller subproblems.
• Two mechanisms:
– A mechanism to generate branches when searching
the solution space
– A mechanism to generate a bound so that many
branches can be terminated
37
Branch and Bound (contd…)

- Solve first by relaxing integer requirements on variables (LP


Relaxation)
- These three basic steps:
 Branching
 Bounding, and
 Fathoming

Branching:
Choose one of the variables whose value will be fixed to create two
new subproblems.

38
Branch and Bound (contd…)
Bounding: A bound is an optimistic estimate of the
solution of a problem. Solving the LP relaxation (IP
without integer requirement) of a subproblem will yield an
optimistic estimate of solution.

- In case of Minimization problems, the value of the bound


will be less than the optimal solution (ZLP ≤ ZIP)
- In case of Maximization problems, the value of the bound
will be greater than the optimal solution (ZLP ≥ ZIP)

A general bound for ILP


The LP relaxation of an ILP is a valid bound for ILP.
39
Branch and Bound (contd…)

FATHOMING CRITERIA
There are three situations that will arise that lets us know when
we no longer need to break down a subproblem.
A subproblem is fathomed if
• Its LP relaxation's optimal solution is integral
• Its bound is worse than the best solution found so far
• Its LP relaxation has no feasible solution

40
Branch and Bound (contd…)
Pure Integer Programming Problem
Max Z  8 x1  5 x2
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0; x1 , x2 integer

LP relaxation of the original problem


Subproblem P0: Max Z  8 x1  5 x2
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0 41
Branch and Bound (contd…)
Subproblem P0

Max Z  8 x1  5 x2
IP Feasible solution
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0

x2
Optimal Solution for LP Bound for
P0

P0
(3.75, 2.25)

x1 42
Branch and Bound (contd…)
P0
Max Z  8 x1  5 x2
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0
LP Bound Solution of P0:
P0: ZLP=41.25
(x1=3.75, x2=2.25)

Branching on x1 of P0 creates two subproblems:


P1: P0 and x1 ≥ 4
P2: P0 and x1 ≤ 3

43
Branch and Bound (contd…)
IP Feasible solution

Optimal Solution for LP Bound for P2

x2 Optimal Solution for LP Bound for P1

P2

P1

x1 44
Branch and Bound (contd…)
P0: ZLP=41.25
(x1=3.75, x2=2.25)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=41 P2: ZLP=39
(x1=4, x2=1.8) (x1=3, x2=3)
Fathomed

Branching on x2 of P1 creates two subproblems:


P3: P1 and x2 ≥ 2
P4: P1 and x2 ≤ 1

45
Branch and Bound (contd…)
IP Feasible solution

No feasible region for P3: Infeasible solution

x2
Optimal Solution for LP Bound for P4

P4

x1 46
Branch and Bound (contd…)
P0: ZLP=41.25
(x1=3.75, x2=2.25)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=41 P2: ZLP=39
(x1=4, x2=1.8) (x1=3, x2=3)
x2 ≥ 2 x2 ≤ 1 Fathomed

P3: Infeasible P4: ZLP=40.56


Fathomed (x1=4.44, x2=1)

Branching on x1 of P4 creates two subproblems:


P5: P4 and x1 ≥ 5
P6: P4 and x1 ≤ 4

47
Branch and Bound (contd…)

Optimal Solution for LP Bound for P6

x2
Optimal Solution for LP Bound for P5

x1 48
Branch and Bound (contd…)
P0: ZLP=41.25
(x1=3.75, x2=2.25)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=41 P2: ZLP=39
(x1=4, x2=1.8) (x1=3, x2=3)
x2 ≥ 2 x2 ≤ 1 Fathomed

P3: Infeasible P4: ZLP=40.56


Fathomed (x1=4.44, x2=1)
x1 ≥ 5 x1 ≤ 4
P5: ZLP=40 P6: ZLP=37
(x1=5, x2= 0) (x1=4, x2=1)
Fathomed Fathomed

Z* = 40; (x1=5, x2= 0)

49
Branch and Bound Algorithm for Pure IPP (Maximization Case)

50
Branch and Bound (contd…)
Another Example: (LP relaxation of the original problem)

Max Z  78x1  77x2 P0


St 11x1  4 x2  82 Max Z  78x1  77x2
 87 x1  33x2  77
St 11x1  4 x2  82
 87 x1  33x2  77
x1 , x2 ≥ and integer
x1 , x2  0

Bound: LP Relaxation
Problem Selection: Newest Problem (LIFO rule) 51
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3

Z* = Bound = −M

52
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9

Z* = Bound = −M

53
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible
FATHOMED

Z* = Bound = −M

54
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4

Z* = Bound = −M

55
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8
(x1=5, x2=6.75)
x2 ≥ 7 x2 ≤ 6

Z* = Bound = −M

56
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8
(x1=5, x2=6.75)
x2 ≥ 7 x2 ≤ 6
P5: Infeasible
FATHOMED
Z* = Bound = −M

57
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8
(x1=5, x2=6.75)
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = −M

58
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8
(x1=5, x2=6.75)
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 776

P7: ZLP=776
(x1=6, x2=4)
59
FATHOMED
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8
(x1=5, x2=6.75)
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 852

P7: ZLP=776 P8: ZLP=852


(x1=6, x2=4) (x1=5, x2=6) 60
FATHOMED FATHOMED
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5
(x1=4, x2=9.5)
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8 P9: ZLP=1005
(x1=5, x2=6.75) (x1=4, x2=9)
FATHOMED
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 1005

P7: ZLP=776 P8: ZLP=852


(x1=6, x2=4) (x1=5, x2=6) 61
FATHOMED FATHOMED
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5 P10: ZLP=1022.7
(x1=4, x2=9.5) (x1=3, x2=10.24)
x2 ≥ 11 x2 ≤ 10
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2
FATHOMED (x1=4.2, x2=9)
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8 P9: ZLP=1005
(x1=5, x2=6.75) (x1=4, x2=9)
FATHOMED
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 1005

P7: ZLP=776 P8: ZLP=852


(x1=6, x2=4) (x1=5, x2=6) 62
FATHOMED FATHOMED
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5 P10: ZLP=1022.7
(x1=4, x2=9.5) (x1=3, x2=10.24)
x2 ≥ 11 x2 ≤ 10
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2 P11: Infeasible
FATHOMED (x1=4.2, x2=9) FATHOMED
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8 P9: ZLP=1005
(x1=5, x2=6.75) (x1=4, x2=9)
FATHOMED
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 1005

P7: ZLP=776 P8: ZLP=852


(x1=6, x2=4) (x1=5, x2=6) 63
FATHOMED FATHOMED
Branch and Bound (contd…)
P0: ZLP=1127.4
(x1=3.37, x2=11.22)
x1 ≥ 4 x1 ≤ 3
P1: ZLP=1043.5 P10: ZLP=1022.7
(x1=4, x2=9.5) (x1=3, x2=10.24)
x2 ≥ 11 x2 ≤ 10
x2 ≥ 10 x2 ≤ 9
P2: Infeasible P3: ZLP=1019.2 P11: Infeasible P12: ZLP=1004
FATHOMED (x1=4.2, x2=9) FATHOMED (x1=3, x2=10)
FATHOMED
x1 ≥ 5 x1 ≤ 4
P4: ZLP=909.8 P9: ZLP=1005
(x1=5, x2=6.75) (x1=4, x2=9)
FATHOMED
x2 ≥ 7 x2 ≤ 6
P5: Infeasible P6: ZLP=873.3
FATHOMED (x1=5.3, x2=6)
x1 ≥ 6 x1 ≤ 5 Z* = Bound = 1005

P7: ZLP=776 P8: ZLP=852


(x1=6, x2=4) (x1=5, x2=6) 64
FATHOMED FATHOMED
Branch-and-bound: mixed integer programs
Modification in B&B approach: Branch only on integer-restricted variables.

Example Max Z  8 x1  5 x2
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0; x2 integer

LP relaxation of the original problem


Subproblem: P0 Max Z  8 x1  5 x2
S.t. x1  x2  6
9 x1  5 x2  45
x1 , x2  0 65
Branch-and-bound: mixed integer programs
(contd…)

P0: ZLP=41.25
(x1=3.75, x2=2.25)
x2 ≥ 3 x2 ≤ 2

Z* = Bound = −M

66
Branch-and-bound: mixed integer programs
(contd…)

P0: ZLP=41.25
(x1=3.75, x2=2.25)
x2 ≥ 3 x2 ≤ 2
P1: ZLP=39
(x1=3, x2=3)
Fathomed

Z* = Bound = 39
67
Branch-and-bound: mixed integer programs
(contd…)

P0: ZLP=41.25
(x1=3.75, x2=2.25)
x2 ≥ 3 x2 ≤ 2
P1: ZLP=39 P2: ZLP=41.11
(x1=3, x2=3) (x1=3.89, x2=2)
Z* = Bound = 41.11
Fathomed Fathomed

68
Branch-and-bound: binary integer programs
Modification: When branching on a binary variable xi, which has a fractional value xi*
in the current LP solution, the two new subproblems are created by setting
xi = 0 and xi = 1.
Example Max Z  9 x1  5 x2  6 x3  4 x4
S.t. 6 x1  3x2  5 x3  2 x4  10
x3  x4  1
 x1  x3  0
 x2  x4  0
x1 , x2 , x3 , x4  {0,1}
LP relaxation of the original problem
Subproblem P0: Max Z  9 x1  5 x2  6 x3  4 x4
S.t. 6 x1  3x2  5 x3  2 x4  10
x3  x4  1
 x1  x3  0
 x2  x4  0
0  x j  1, for j  1,2,3,4 69
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0

Z* = Bound = - M

70
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0

Subproblem P1 = ?

Z* = Bound = - M

71
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16
(x1=1, x2=1, x3=0, x4=0.5)
x4 = 1 x4 = 0

Subproblem P2 = ?

Z* = Bound = - M

72
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16
(x1=1, x2=1, x3=0, x4=0.5)
x4 = 1 x4 = 0

P3: Infeasible
FATHOMED

Subproblem P3 = ?

Z* = Bound = - M

73
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16
(x1=1, x2=1, x3=0, x4=0.5)
x4 = 1 x4 = 0

P3: Infeasible P4: ZLP=15.2


FATHOMED (x1=1, x2=1, x3=0.2, x4=0)
x3 = 1 x3 = 0

Z* = Bound = - M
Subproblem P4 = ?
74
Branch-and-bound: binary integer programs
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16
(x1=1, x2=1, x3=0, x4=0.5)
x4 = 1 x4 = 0

P3: Infeasible P4: ZLP=15.2


FATHOMED (x1=1, x2=1, x3=0.2, x4=0)
x3 = 1 x3 = 0

P5: Infeasible
FATHOMED
Z* = Bound = - M
Subproblem P5 = ?
75
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16
(x1=1, x2=1, x3=0, x4=0.5)
x4 = 1 x4 = 0

P3: Infeasible P4: ZLP=15.2


FATHOMED (x1=1, x2=1, x3=0.2, x4=0)
x3 = 1 x3 = 0

P5: Infeasible P6: ZLP=14


FATHOMED (x1=1, x2=1, x3=0, x4=0)
FATHOMED Z* = Bound = 14

Subproblem P6 = ?
76
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2
(x1=1, x2=0.8, x3=0, x4=0.8)
x2 = 1 x2 = 0
P2: ZLP=16 P7: ZLP=13.8
(x1=1, x2=1, x3=0, x4=0.5) (x1=1, x2=0, x3=0.8, x4=0) P7 Fathomed. why?
x4 = 1 x4 = 0 FATHOMED

P3: Infeasible P4: ZLP=15.2


FATHOMED (x1=1, x2=1, x3=0.2, x4=0)
x3 = 1 x3 = 0

P5: Infeasible P6: ZLP=14


FATHOMED (x1=1, x2=1, x3=0, x4=0)
FATHOMED Z* = Bound = 14

Subproblem P7 = ?
77
Branch-and-bound: binary integer programs(Contd…)
P0: ZLP=16.5
(x1=0.83, x2=1, x3=0, x4=1)
x1 = 1 x1 = 0
P1: ZLP=16.2 P8: ZLP=9
(x1=1, x2=0.8, x3=0, x4=0.8) (x1=0, x2=1, x3=0, x4=1)
x2 = 0 FATHOMED
x2 = 1
P2: ZLP=16 P7: ZLP=13.8
(x1=1, x2=1, x3=0, x4=0.5) (x1=1, x2=0, x3=0.8, x4=0)
x4 = 1 x4 = 0 FATHOMED

P3: Infeasible P4: ZLP=15.2


FATHOMED (x1=1, x2=1, x3=0.2, x4=0)
x3 = 1 x3 = 0

P5: Infeasible P6: ZLP=14


FATHOMED (x1=1, x2=1, x3=0, x4=0)
FATHOMED Z* = Bound = 14

Subproblem P8 = ? 78
Knapsack Problem
Knapsack Problem –Given a set of n items (j=1, 2, …, n)
with a weight (wj) and value (cj), select the items so that the
total weight is at most a given limit (W) and the total value
is as large as possible.
Decision variable:
xj =1 if item is included in knapsack;
0 Otherwise
• Formulation
Max c1x1+ c2x2+… +cnxn Single constraint
s.t. w1x1+ w2x2+… +wnxn ≤ W
xj  {0,1}, for all j= 1, 2, …, n 79
Knapsack Problem by Exhaustive Search

Subset Total weight Total value


Ø 0 $0
{1} 2 $20
{2} 5 $30
{3} 10 $50
{4} 5 $10
{1,2} 7 $50
{1,3} 12 $70
{1,4} 7 $30
Generate all possible subsets of n {2,3} 15 $80
items, compute total weight of each {2,4} 10 $40
subset to identify feasible subsets, and {3,4} 15 $60
find the subset of the largest value {1,2,3} 17 infeasible
{1,2,4} 12 $60
(2n) possible subsets {1,3,4} 17 infeasible
{2,3,4} 20 infeasible
{1,2,3,4} 22 infeasible

80
Solving Knapsack problem by B&B approach
• LP relaxation: Solution of LP relaxed problem can
be obtained by inspection (Heuristic)
i. Find cj/wj, for all j = 1, 2, …, n.
ii. Rank the item in non-increasing order of cj/wj
ratio.
iii. Select the best item (with highest cj/wj ratio).
iv. Continue in this fashion until the best remaining
item fills the knapsack.

81
Solving Knapsack problem by B&B approach
• Another Example: 4 items
Max Z=16x1+ 22x2+ 12x3+ 8x4
s.t. 5x1+ 7x2+ 4x3+ 3x4 ≤ 14
xj  {0,1}, for all j = 1, 2, …, 4

Item (j) cj/wj Rank


1 16/5 = 3.20 1
2 22/7 = 3.14 2
3 12/4 = 3.00 3
4 8/3 = 2.67 4

82
Solving Knapsack problem by B&B approach
P0: ZLP = 44
Bound: Z = − ∞
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)

83
Solving Knapsack problem by B&B approach
P0: ZLP = 44
Bound: Z = − ∞
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5
7
(x1= x3 = 1
x2 =5/7, x4 = 0)

84
Solving Knapsack problem by B&B approach
P0: ZLP = 44
Bound: Z = − ∞
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5
7
(x1= x3 = 1
x2 =5/7, x4 = 0)
x2 = 1 x2 = 0

P2: ZLP = 43 3
5
(x1= 3/5
x2 = x3 =1, x4 = 0)

85
Solving Knapsack problem by B&B approach
P0: ZLP = 44 Update
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 Bound: Z = 42
(x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5
7
(x1= x3 = 1
x2 =5/7, x4 = 0)
x2 = 1 x2 = 0

P2: ZLP = 43 3
5
(x1= 3/5
x2 = x3 =1, x4 = 0)
x1 = 0
x1 = 1

P3: Infeasible P4: ZLP = 42


Fathomed (x1= 0
x2 = x3 = x4 = 1)
Fathomed

86
Solving Knapsack problem by B&B approach
P0: ZLP = 44 Bound: Z = 42
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5
7
(x1= x3 = 1
x2 =5/7, x4 = 0)
x2 = 1 x2 = 0

P2: ZLP = 43 3 P5: ZLP = 36


5 (x1= x3 = 1
(x1= 3/5
x2 = x3 =1, x4 = 0) x2 =0, x4 = 1)
x1 = 0 Fathomed
x1 = 1

P3: Infeasible P4: ZLP = 42


Fathomed (x1= 0
x2 = x3 = x4 = 1)
Fathomed

87
Solving Knapsack problem by B&B approach
P0: ZLP = 44 Bound: Z = 42
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5 P6: ZLP = 43 13
7
(x1= x3 = 1 (x1= x2 = 1
x2 =5/7, x4 = 0) x3 =0, x4 = 2/3)
x2 = 1 x2 = 0
x4 = 0
P2: ZLP = 43 3 P5: ZLP = 36 x4 = 1
5 (x1= x3 = 1
(x1= 3/5
x2 = x3 =1, x4 = 0) x2 =0, x4 = 1)
x1 = 0 Fathomed
x1 = 1

P3: Infeasible P4: ZLP = 42


Fathomed (x1= 0
x2 = x3 = x4 = 1)
Fathomed

88
Solving Knapsack problem by B&B approach
P0: ZLP = 44 Bound: Z = 42
5x1+ 7x2+ 4x3+ 3x4 ≤ 14 (x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5 P6: ZLP = 43 13
7
(x1= x3 = 1 (x1= x2 = 1
x2 =5/7, x4 = 0) x3 =0, x4 = 2/3)
x2 = 1 x2 = 0
x4 = 0
P2: ZLP = 43 3 P5: ZLP = 36 x4 = 1
5 (x1= x3 = 1
(x1= 3/5
x2 = x3 =1, x4 = 0) x2 =0, x4 = 1)
x1 = 0 Fathomed
x1 = 1
P7: ZLP = 42 6
P4: ZLP = 42 7
P3: Infeasible (x1= x4 = 1
Fathomed (x1= 0 x3 =0, x2 = 6/7)
x2 = x3 = x4 = 1) Fathomed
Fathomed Branching on P7 will not
give a value better than 42.
Why? 89
Solving Knapsack problem by B&B approach
P0: ZLP = 44
(x1= x2 = 1
x3 =1/2, x4 = 0)
x3 = 1 x3 = 0
P1: ZLP = 43 5 P6: ZLP = 43 13
7
(x1= x3 = 1 (x1= x2 = 1
x2 =5/7, x4 = 0) x3 =0, x4 = 2/3)
x2 = 1 x2 = 0
x4 = 0
P2: ZLP = 43 3 P5: ZLP = 36 x4 = 1
5 (x1= x3 = 1
(x1= 3/5
x2 = x3 =1, x4 = 0) x2 =0, x4 = 1)
x1 = 0 Fathomed
x1 = 1
P7: ZLP = 42 6 P8: ZLP = 38
P4: ZLP = 42 7
P3: Infeasible (x1= x4 = 1 (x1= x2 = 1
Fathomed (x1= 0 x3 =0, x2 = 6/7) x2 = x4 = 0)
x2 = x3 = x4 = 1) Fathomed Fathomed
Fathomed Branching on P7 will not
Optimal Solution give a value better than 42.
Why? 90
Traveling Salesman Problem (TSP)
Traveling Salesman Problem (TSP) deals with finding a minimum cost (distance
or time) tour for a salesman visiting n cities where
 each city is visited exactly once
 and the salesman returns to the starting city

Tour: A tour is a complete route through the n cities where no city is visited more
than once
Subtour: A subtour is a round trip that does not pass through all cities

Network representation
of the TSP

91
Traveling Salesman Problem (TSP) (Contd…)
Integer programming formulation of TSP
Suppose TSP consists of n cities i = j = 1,2,…, n.
cij = distance (time or cost) from city i to city j, for i  j
cij = M (a large positive number), for i  j
1 if the salesman goes from city i to city j
xij  
n n 0 otherwise
Min Z   cij xij
i 1 j 1

n
s.t. x
i 1
ij 1 for j  1,2,, n (the salesman must arrive at each city once)

x
j 1
ij 1 for i  1,2,, n (the salesman must leave each city once)

ui  u j  nxij  n  1 for i  j; i  2,3,, n; j  2,3,, n (subtour elimination constraint)

xij {0,1} for i  1,2,, n; j  1,2,, n

uj  0 for j  1, 2, ,n 92
Traveling Salesman Problem (TSP) (Contd…)
Cycle Total Distance (in miles)
1. 1-2-3-4-5-1 79
3
2. 1-2-3-5-4-1 108
29
3. 1-2-4-3-5-1 80 11
4. 1-2-4-5-3-1 105 30
20
2
5. 1-2-5-3-4-1 78
6. 1-2-5-4-3-1 74 8 4
7. 1-3-4-2-5-1 67 => Shortest Tour
13
8. 1-3-2-4-5-1 97 22
9. 1-3-5-2-4-1 96 20

10. 1-3-2-5-4-1 95 16

11. 1-4-2-3-5-1 101 1

12. 1-4-3-2-5-1 70 6 5

A problem with n nodes (locations) has (n-1)! possible tours.


For symmetric problems, this number is divided by 2. 93
Traveling Salesman Problem (TSP) (Contd…)

• Here, there are 5 nodes, n = 5, therefore there are (5-1)! / 2= 4! / 2


= 12 possible tour for this problem.

• The optimal tour is 1-3-4-2-5-1 of length 67 Miles.

• Of course, This trial approach can only be used for small problems.

• For example, the number of possible tours is 181440 for a problem


with 10 nodes.

• For a problem with 15 nodes, it is 43589145600.

94
Branch and Bound approach for TSP

Observations for developing the solution procedure:

 Deletion of subtour elimination constraint from TSP results


into a Assignment Problem (Subproblem)

 The subproblem (assignment problem) can be solved using


Hungarian Algorithm.

 If the optimal solution to the assignment problem is feasible


to the TSP (i.e., if the optimal solution of the assignment
problem yields a tour), then it is also optimal for the TSP.

95
Branch and Bound approach for TSP
Solution Procedure
Step 0: Ignore the subtour elimination constraint from TSP. The resulting problem is an
assignment problem.
Step 1: Solve the associated assignment problem using Hungarian Algorithm.
Step 2: If the optimal solution to the assignment problem provides a tour (i.e., no subtour), then it
is the optimal solution to the TSP and STOP. OTHERWISE (the optimal solution to the
assignment problem yields subtours), go to Step 3 (restrictions are imposed to remove the
subtours).
Step 3: Select a subtour with the smallest number of cities (because it creates the smallest number
of subproblems). Let k be the number of cities in the selected subtour (i1 - i2 -…- ik - i1).
Step 4: Branch into k subproblems (branches). Then for the subproblems P1, P2,…,Pk , set
c i1i2  M
c i2i3  M

c ik i1  M, respectively
Step 5: Solve one of the subproblem. If the solution of the resulting assignment problem provides
a tour it provides an upper bound (minimum tour length). Otherwise, Go to Step 3.
Step 6: Continue the process until all the unexplored subproblems have been fathomed (better
upper bound or subproblem cannot produce a better solution).
Step 7: The optimum tour is the one associated with the best upper bound.
96
Branch and Bound approach for TSP

Example Problem: 5 City with the following distance matrix

City 1 City 2 City 3 City 4 City 5

City 1 0 10 3 6 9

City 2 5 0 5 4 2

City 3 4 9 0 7 8

City 4 7 1 3 0 4

City 5 3 2 6 5 0

97
Ignoring the subtour elimination constraint from TSP: Solve the
resulting Assignment Problem using Hungarian Algorithm

Subproblem P0

City 1 City 2 City 3 City 4 City 5


City 1 M 10 3 6 9
City 2 5 M 5 4 2
City 3 4 9 M 7 8
City 4 7 1 3 M 4
City 5 3 2 6 5 M

Z* = Bound= M

98
Row Reduction
City 1 City 2 City 3 City 4 City 5
City 1 M 7 0 3 6
City 2 3 M 3 2 0
City 3 0 5 M 3 4
City 4 6 0 2 M 3
City 5 1 0 4 3 M

Column Reduction
City 1 City 2 City 3 City 4 City 5
City 1 M 7 0 1 6
City 2 3 M 3 0 0
City 3 0 5 M 1 4
City 4 6 0 2 M 3
City 5 1 0 4 1 M
99
Optimal Solution: x13  x25  x31  x42  x54  1 , all other xij = 0, ZA = 15.

This solution has two subtours: 1 – 3 – 1 and 2 – 5 – 4–2. So, this is not optimal
solution to the TSP. 100
Z* = Bound = M P0: ZA = 15
(1-3-1) (2-5-4-2)
x13 = 0 x31 = 0

P1:

Branch on subproblem P0:


Subproblem P1: Subproblem P0 with constraint x13 = 0, i.e. Set c13 = M
Subproblem P1
City 1 City 2 City 3 City 4 City 5
City 1 M 10 M 6 9
City 2 5 M 5 4 2
City 3 4 9 M 7 8
City 4 7 1 3 M 4
City 5 3 2 6 5 M
101
Optimal Solution: x14  x25  x31  x43  x52  1, all other xij = 0, ZA = 17.
This solution contains two subtours: 1 – 4 – 3 – 1 and 2 – 5 – 2. This is not optimal
solution to the TSP.
Z* = Bound= M
102
P0: ZA = 15
(1-3-1) (2-5-4-2)
x13 = 0 x31 = 0

P1: ZA = 17
(2-5-2)(1-4-3-1)
x25 = 0 x52= 0

P2:
Branch on Subproblem P1:
Subproblem P2: Subproblem P1 with constraint x25 =0, i.e. Set c25 = M)
Subproblem P2 City 1 City 2 City 3 City 4 City 5
City 1 M 10 M 6 9
City 2 5 M 5 4 M
City 3 4 9 M 7 8
City 4 7 1 3 M 4
City 5 3 2 6 5 M
103
Optimal Solution: x14  x23  x31  x45  x52  1, all other xij = 0, ZA = 21
This solution gives a tour: 1 – 4 – 5 – 2 – 3 – 1. So, this is a feasible solution to the
TSP. Fathomed (feasible solution and update the bound)
Z* = Bound= 21
104
Z* = Bound= 21 P0: ZA = 15
(1-3-1) (2-5-4-2)
x13 = 0 x31 = 0

P1: ZA = 17
(2-5-2)(1-4-3-1)
x25 = 0 x52= 0

P2: ZA = 21 P3:
(1-4-5-2-3-1)
Fathomed
Subproblem P3: Subproblem P1 with constraint x52 =0, i.e. Set c52 = M)
City 1 City 2 City 3 City 4 City 5
City 1 M 10 M 6 9
Subproblem P3
City 2 5 M 5 4 2
City 3 4 9 M 7 8
City 4 7 1 3 M 4
City 5 3 M 6 5 M
105
Optimal Solution: x14  x25  x31  x42  x53  1, all other xij = 0, ZA = 19
This solution gives a tour: 1 – 4 – 2 – 5 –3 – 1. So, this is a feasible solution to the TSP.
Fathomed (Update bound since this is better solution) Z* = Bound= 19 106
P0: ZA = 15
Z* = Bound= 19
(1-3-1) (2-5-4-2)
x13 = 0 x31 = 0

P1: ZA = 17 P4:
(2-5-2)(1-4-3-1)
x25 = 0 x52= 0

P2: ZA = 21 P3: ZA = 19
(1-4-5-2-3-1) (1-4-2-5-3-1)
Fathomed Fathomed

Subproblem P4: Subproblem P0 with constraint x31 = 0 i.e. Set c31 = M

Subproblem P4:

107
Optimal Solution: x13  x25  x34  x42  x51  1, all other xij = 0, Z = 16.
This solution gives a tour: 1 – 3 – 4 – 2 –5 – 1. So, this is a feasible solution to the TSP.
Fathomed (Update bound since this is better solution)
Z* = Bound= 16
108
Optimal
Z* = 16 solution to
P0: ZA = 15
(1-3-1) (2-5-4-2) the TSP

x13 = 0 x31 = 0

P1: ZA = 17 P4: ZA = 16
(2-5-2)(1-4-3-1) (1-3-4-2-5-1)
Fathomed
x25 = 0 x52= 0

P2: ZA = 21 P3: ZA = 19
(1-4-5-2-3-1) (1-4-2-5-3-1)
Fathomed Fathomed

Optimal Sequence of visit by Salesman: 1-3-4-2-5-1,


and Total distance: 16
109

You might also like