Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
51 views7 pages

Studyset3 With Solutions

Uploaded by

Leonard Verhamme
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)
51 views7 pages

Studyset3 With Solutions

Uploaded by

Leonard Verhamme
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/ 7

Applications of Operations Research

Solutions for Study Set 3: Lectures 6 and 7

1. (from Nemhauser and Wolsey’s Integer and Combinatorial Optimization) The BST
Delivery Company must make deliveries to 10 customers whose respective daily de-
mands are dj for j = 1, 2, ..., 10. The company has 4 trucks available with capacities
Lk and daily operative costs ck for any k = 1, ..., 4. Each customer needs to be served
by exactly one truck, a single truck cannot deliver to more than 5 customers, and cus-
tomer pairs {1, 7}, {2, 6} and {2, 9} cannot be visited by the same truck. On a daily
basis, the company must deliver to all the customers and the goal is to minimize the
total operative cost. Model this problem.

Solution: We define a binary variable yk which is 1 if truck k is being used and


0 otherwise, and a binary variable xjk which is 1 if customer j is served by truck k and
0 otherwise. The model is
4
X
min ck y k
k=1
4
X
s.t. xjk = 1 j = 1, 2, ...., 10
k=1
10
X
xjk ≤ 5 k = 1, ...., 4
j=1
10
X
dj xjk ≤ Lk k = 1, ...., 4
j=1

x1k + x7k ≤ 1 k = 1, ..., 4


x2k + x6k ≤ 1 k = 1, ..., 4
x2k + x9k ≤ 1 k = 1, ..., 4
xjk ≤ yk j = 1, ..., 10, k = 1, .., 4
xjk ∈ {0, 1} j = 1, ..., 10, k = 1, .., 4
yk ∈ {0, 1} k = 1, ..., 4

The constraints ensure that

• Every customer has to be served by exactly one truck.


• Every truck cannot deliver to more than 5 customers.

1
• The total demand delivered by any truck cannot exceed the capacity of the truck.
• Customer pairs {1, 7}, {2, 6} and {2, 9} cannot be visited by the same truck.
• We force the variables y to be 1 only if the corresponding truck is actually being
used.

2. (from Nemhauser and Wolsey’s Integer and Combinatorial Optimization) Suppose K


trucks can be used to serve n clients from a single depot. Each client must be visited
exactly once. The time for truck k to travel from i to j is ℓijk and the cost is cijk . Each
truck has to travel along a tour that starts and ends at the depot and does not take
longer than Lk units of time. The aim of the problem is to minimize the total cost.
Model this problem.

Solution: For sake of modeling, construct a directed graph G = (N, A) whose set
of nodes N = {0, 1, . . . , n} represents the set of all the customers (nodes 1 to n) and
the depot (node 0) and whose set of arcs A = {(i, j) : i, j ∈ N, i ̸= j} represents all the
possible connections between any two nodes. We define a binary variable xijk which is
1 if truck k travels along arc (i, j) and 0 otherwise and a binary variable yik which is
1 if truck k visits node i and 0 otherwise.
We want to minimize the total cost, that is
P PK
min (i,j)∈A k=1 cijk xijk .

Every customer (but not the depot) must be visited by one truck:
PK
k=1 yik = 1 i ∈ N, i ̸= 0.

On the other hand, all the trucks must pass by the depot:

y0k = 1 k = 1, 2, ..., K.

We make sure that node i has one incoming and one outgoing arc traversed by vehicle
k if this node is visited by vehicle k:
P
x = yik i ∈ N, k = 1, 2, ..., K,
Pj∈N \{i} ijk
j∈N \{i} xjik = yik i ∈ N, k = 1, 2, ..., K.

The length of the tour should not exceed the given threshold:
P
(i,j)∈A ℓijk xijk ≤ Lk k = 1, 2, ..., K.

Also, no truck should be allowed to make subtours:


P P
i∈S j∈N \S xijk ≥ yvk S ⊂ N \ {0} : 2 ≤ |S| ≤ n − 1, v ∈ S, k = 1, 2, ..., K.

2
If a customer v in subset S is visited by truck k, then as the depot is in the set N \ S,
there should be at least one arc going from set S to N \ S to ensure the connectivity
of the tour.
Finally, all the variables are binary:

xijk ∈ {0, 1} (i, j) ∈ A, k = 1, 2, ..., K,


yik ∈ {0, 1} i ∈ N, k = 1, 2, ..., K.

3. Consider an instance of the symmetric TSP problem with eight cities (i.e., N =
{1, . . . , 8}) where the distance between every two cities i, j ∈ N is defined by the
shortest path length between nodes i and j in the following graph:

1 1 2 1 3 1 4

1 1

5 1 6 1 7 1 8

For example, the distance between cities 1 and 2 equals one, whereas the distance
between cities 4 and 5 equals four.

a) Show that the double tree heuristic could result in the tour (1, 2, 3, 4, 5, 6, 7, 8, 1)
for this instance
b) What is the ratio between the length of this tour and the minimum tour length?
c) Can you generalize the example above to show that, as the number of cities n
increases, the ratio between the length of the tour obtained by the double tree
heuristic and the minimum tour length converges to two?

Solution:
a) A possible minimum spanning tree for the graph defining the TSP instance is as
follows:
1 2 3 4

5 6 7 8

Duplicating every edge then leads to the graph


1 2 3 4

5 6 7 8

3
for which (1, 2, 3, 4, 3, 2, 1, 5, 6, 7, 8, 7, 6, 5, 1) forms a Eulerian cycle. After short-
cutting, we obtain the tour (1, 2, 3, 4, 5, 6, 7, 8, 1):

1 2 3 4

5 6 7 8

b) The tour (1, 2, 3, 4, 5, 6, 7, 8, 1) has length z H = 6 × 1 + 2 × 4 = 14. The tour


(1, 2, 3, 4, 8, 7, 6, 5, 1), in turn, has the minimum tour length of z ⋆ = 8 since it only
uses edges of unit length. The ratio thus equals z H /z ⋆ = 14/8.
c) For arbitrary k ∈ N with k ≥ 2, construct an instance with n = 2k cities (i.e.,
N = {1, . . . , 2k}) where the distance between every two cities i, j ∈ N is defined
by the shortest path length between nodes i and j in the following graph:

1 1 2 1 ··· 1 k

1 1

k+1 1 k+2 1 ··· 1 2k

An analogous reasoning as in Question (a) then yields that the double tree heuris-
tic could result in the tour (1, 2, . . . , 2k, 1) with length, when expressed as a func-
tion of k, equal to z H (k) = 2(k − 1) × 1 + 2 × k = 4k − 2. The minimum tour
length expressed as a function of k, on the other hand, equals z ⋆ (k) = 2k. We
therefore obtain that
z H (k) 4k − 2
lim ⋆
= lim = 2.
k→+∞ z (k) k→+∞ 2k

Important remark: This analysis shows that the factor two performance guar-
antee shown in class is asymptotically tight: there exists a class of instances such
that the ratio between the tour length obtained by the double tree heuristic and
the minimum tour length can be made arbitrarily close to two.

4. Consider the following instance of the Traveling Salesman Problem (TSP) with 6 cities,
labeled from A to F , and their respective distances:

Cities A B C D E F
A 0 2 3 4 5 6
B 2 0 2 3 4 5
C 3 2 0 2 3 4
D 4 3 2 0 2 3
E 5 4 3 2 0 2
F 6 5 4 3 2 0

4
a) Starting with the initial tour ABCDEF A, apply a 2-opt move to try and improve
the tour. Show the resulting tour and its total distance.
b) Can you find a lower bound for this instance of the TSP problem?
c) When we solve the assignment relaxation of this problem we get the following
subtours:
A B C D

E F

Which constraints should we add to get rid of these subtours?

Solution:
(a)

• First we remove two arcs to split the tour into two parts. E.g., remove arcs (B,C)
and (E,F).
• Reverse the direction for one of the parts of the tour. E.g., arcs (C,D) and (D,E)
become (D,C) and (E,D) respectively.
• Add two arcs to reconnect the two parts. In this case arcs (B,E) and (C,F).

This results in the tour ABEDCF A with a total distance of 2 + 4 + 2 + 2 + 4 + 6 = 20


Which is not an improvement on the initial solution which had a total distance of
2 + 2 + 2 + 2 + 2 + 6 = 16.
(b) One possibility to obtain a lower bound for this problem is to simply take the cheap-
est edge for each city. For this instance, this results in a LB of 2 + 2 + 2 + 2 + 2 + 2 = 12
(c) There are two options to get rid of these subtours, namely adding the following
connectivity constraints or subour elimination constraints to the assignment formula-
tion.
Connectivity constraints:

xAC + xAD + xAE + xAF + xBC + xBD + xBE + xBF ≥ 1

xCA + xCB + xCE + xCF + xDA + xDB + xDE + xDF ≥ 1


xEA + xEB + xEC + xED + xF A + xF B + xF C + xF D ≥ 1
Subtour elimination constraints:

xAB + xBA ≤ 1

xCD + xDC ≤ 1
xEF + xF E ≤ 1

5
5. Imagine an instance of the TSP with a directed graph G = (N, A) with a distance cij
for every arc (i, j) ∈ A = {(i, j) : i, j ∈ N, i ̸= j}. Assume the TSP tour needs to start
and end at node 1. Now, a city k ∈ N/{1} needs to be visited before city l ∈ N/{1, k}
can be visited. Model this problem.
Solution:
Using the MTZ formulation seen in class, the model would look like this with xij being
a binary variable which is 1 when arc (i, j) is included in the tour and 0 otherwise and
ui corresponding to the order of node i in the tour.
X
min cij xij
(i,j)∈A
X n
s.t. xij = 1 i = 1, . . . , n
j=1:j̸=i
X n
xji = 1 i = 1, . . . , n
j=1:j̸=i

uj ≥ ui + 1 − (n − 1)(1 − xij ) i, j = 2, . . . , n : i ̸= j
2 ≤ ui ≤ n i = 2, . . . , n
ul ≥ uk + 1
xij ∈ {0, 1} (i, j) ∈ A

6. A driver needs to travel with its truck between a set N = {1, . . . , n} of n locations to
deliver a set K = {1, . . . , m} of m packages. Every package k ∈ K has a pick-up point
sk ∈ N and a drop-off point tk ∈ N . Every location in N is either a pick-up or a drop-off
location, so that N = {sk : k ∈ K} ∪ {tk : k ∈ K} and {sk : k ∈ K} ∩ {tk : k ∈ K} = ∅.
The driver is currently in location 0 with an empty truck. Before being able to deliver
a package k ∈ K at its drop-off point tk , the driver first needs to collect it at its pick-up
point sk . Additionally, every package k ∈ K has a positive weight wk and P the truck
can carry at most a weight W at a time, where W ≥ maxk∈K wk and W < k∈K wk .
Denote by N̄ = N ∪ {0} the set of all considered locations and, for every i, j ∈ N̄ , let
cij ≥ 0 be the time required to travel from location i to j. The objective is to construct
a tour, starting and ending at location 0, that minimizes the total time required to
deliver all packages, taking into account the precedence constraints between pick-up
and drop-off, as well as the truck’s weight constraint.
Solution:
Using the MTZ formulation seen in class, the model would look like this with xij being
a binary variable which is 1 when arc (i, j) is included in the tour and 0 otherwise and
ui corresponding to the order of node i in the tour. Variable yi is the total weight of
the truck after visiting node i. Notice the similarity between the subtour elimination

6
constraints and the capacity constraints of the truck.
X
min cij xij
(i,j)∈A
X n
s.t. xij = 1 i = 0, . . . , n
j=0:j̸=i
X n
xji = 1 i = 0, . . . , n
j=0:j̸=i

uj ≥ ui + 1 − (n)(1 − xij ) i, j = 1, . . . , n : i ̸= j (∗)


2 ≤ ui ≤ n + 1 i = 1, . . . , n
utk ≥ usk + 1 ∀k ∈ K
ysk ≥ yi + wk − W (1 − xisk ) ∀k ∈ K, i = 1, . . . , n : i ̸= sk
ytk ≥ yi − wk − W (1 − xitk ) ∀k ∈ K, i = 1, . . . , n : i ̸= tk
wk ≤ ysk ≤ W ∀k ∈ K
0 ≤ ytk ≤ W − wk ∀k ∈ K
xij ∈ {0, 1} (i, j) ∈ A

You might also like