Professional Documents
Culture Documents
Ex 12
Ex 12
WI4 131
Kees Roos
Technische Universiteit Delft
Faculteit Electrotechniek, Wiskunde en Informatica
Afdeling Informatie, Systemen en Algoritmiek
e-mail: C.Roos@ewi.tudelft.nl
URL: http://www.isa.ewi.tudelft.nl/roos
November December, A.D. 2004
Course Schedule
1. Formulations (18 pages)
2. Optimality, Relaxation, and Bounds (10 pages)
3. Well-solved Problems (13 pages)
4. Matching and Assigments (10 pages)
5. Dynamic Programming (11 pages)
6. Complexity and Problem Reduction (8 pages)
7. Branch and Bound (17 pages)
8. Cutting Plane Algorithms (21 pages)
9. Strong Valid Inequalities (22 pages)
10. Lagrangian Duality (14 pages)
11. Column Generation Algorithms (16 pages)
12. Heuristic Algorithms (15 pages)
13. From Theory to Solutions (20 pages)
Optimization Group 1
Capter 12
Heuristic Algorithms
Optimization Group 2
Exercise 12.7.1
Apply the dierent heuristics to an instance of STSP with the following distance matrix
_
_
_
_
_
_
_
_
_
- 28 57 72 81 85 80
28 - 28 45 54 57 63
57 28 - 20 3 28 57
72 45 20 - 10 20 72
81 54 3 10 - 22 81
85 57 28 20 22 - 63
80 63 57 72 81 63 -
_
_
_
_
_
_
_
_
_
Pure Greedy Solution: Order the edges according to nondecreasing cost, and seek to use
them in this order.
1
2
3
4 5
6
7
Heuristic tour
#1
step arc length
1 (3,5) 3 accept
2 (4,5) 10 accept
3 (3,4) 20 subtour
4 (4,6) 20 accept
5 (5,6) 22 subtour
6 (1,2) 28 accept
7 (2,3) 28 accept
8 (1,7) 80 forced
9 (6,7) 63 forced
The length of the created tour is z
1
=
3+10+20+28+28+80+63 =
232. The same tour is obtained by us-
ing the insertion heuristic using nearest
neighbor (starting at any node) and far-
thest neighbor (starting at node 3, else
the length becomes 251). The tour is
2-optimal.
Optimization Group 3
Exercise 12.7.1 (other heuristic solution)
_
_
_
_
_
_
_
- 28 57 72 81 85 80
28 - 28 45 54 57 63
57 28 - 20 3 28 57
72 45 20 - 10 20 72
81 54 3 10 - 22 81
85 57 28 20 22 - 63
80 63 57 72 81 63 -
_
_
_
_
_
_
_
Let us solve the assignment relaxation. We use the same technique as in Exercise 4.5.9. We
rst construct a dual feasible solution (since we minimize we invert the weights).
-28 -28 -3 -10 -3 -20 -57
0 - -28 -57 -72 -81 -85 -80
0 -28 - -28 -45 -54 -57 -63
0 -57 -28 - -20 -3 -28 -57
0 -72 -45 -20 - -10 -20 -72
0 -81 -54 -3 -10 - -22 -81
0 -85 -57 -28 -20 -22 - -63
0 -80 -63 -57 -72 -81 -63 -
jN
c
j
x
j
:
jN
a
ij
x
j
1 for i M, x {0, 1}
n
_
_
_
,
where N = {1, . . . , n}, M = {1, . . . , m}, and a
ij
{0, 1} for i M and j N.
Let s
j
be the 0-1 vector consisting of all a
ij
s, i M and S
j
the subset of M which has
s
j
as incidence vector. If x
j
= 1, then all constraints
jN
a
ij
x
j
1 with i S
j
are
satised. In other words, if x
j
= 1 then all elements of the subset S
j
of M are covered.
The contribution to the cost function is c
j
. The cost per covered element is
c
j
|S
j
|
. So we start
by putting x
j
= 1 for the (or an) index j that minimizes
c
j
|S
j
|
. Without loss of generality
we assume that j = 1. Since the elements in S
1
are now covered, we replace each S
j
with
j 2 by S
1
j
= S
j
\ S
1
, and put x
j
= 1 for the (or an) index j 2 that minimizes
c
j
S
1
j
.
Without loss of generality we assume that j = 2. Then we replace each S
j
with j 3 by
S
2
j
= S
1
j
\ S
2
, and put x
j
= 1 for the (or an) index j 2 that minimizes
c
j
S
2
j
, and so on.
We proceed until all elements of M are covered, and put x
j
= 0 for the remaining variables.
Optimization Group 10
Exercise 12.7.4
Consider the problem of nding a maximum cardinality matching in a graph G = (V, E). A
mtching M E is called maximal if M {e} is not a matching for any e E \ M. Let
z be the size of a maximum matching and z
H
the size of a maximal matching. Show that
z
H
1
2
z.
6
5
4
3
2
1
6
5
4
3
2
1
Example of a
maximal matching.
Solution: Let M be a maximum cardinality matching in G.
Then |M| = z. We know that the size of a maximum cardinality
matching is equal to the minimal size of a covering of the edges
by nodes. So any covering of the edges by nodes contains at least
z nodes.
Now consider the end points of the edges in a maximal matching
M
to a matching
M
, we have 2
z, which implies
the desired inequality.
Optimization Group 11
Exercise 12.7.5
Consider the 0-1 knapsack problem:
z = max
_
_
_
n
j=1
c
j
x
j
:
n
j=1
a
j
x
j
b, x {0, 1}
n
_
_
_
with 0 < a
j
b for j N = {1, . . . , n}. Consider a greedy heuristic that chooses the better of the integer
round down of the linear relaxation solution and the best solution in which just one variable is set to 1. Show
that z
G
1
2
z.
Solution: Without loss of generality we assume that the variables are ordered such that
c
j
a
j
is non-increasing.
Let r be the largest index such that
r
j=1
a
j
b. Then the solution of the linear relaxation is given by
x
1
= . . . = x
r
= 1, x
r+1
=
b
r
j=1
a
j
a
r+1
, x
r+2
= . . . = x
n
= 0
whence integer round down of the linear relaxation solution yields the solution x
1
with
x
1
1
= . . . = x
1
r
= 1, x
1
r+1
= . . . = x
1
n
= 0, z
1
= c
T
x
1
=
r
j=1
c
j
.
The best solution x
2
in which just one variable is set to 1 chooses the index k such that c
k
c
j
for all j and
takes x
2
k
= 1 and x
2
j
= 0 for j = k, with value z
2
= c
k
. Note that the value of the linear relaxation solution
provides an upper bouns for z. Hence, using b
r
j=1
a
j
< a
r+1
, we may write
z z =
r
j=1
c
j
+c
r+1
b
r
j=1
a
j
a
r+1
j=1
c
j
+c
r+1
r
j=1
c
j
+c
k
2max
_
_
r
j=1
c
j
, c
k
_
_
= 2z
G
,
proving the desired inequality.
Optimization Group 12