0% found this document useful (0 votes)
76 views20 pages

2 Bitonic 肖江

The document describes the bitonic tour problem, which is a simplified version of the traveling salesman problem where the tour must start at the leftmost point, go right to the rightmost point, then left back to the start. It can be solved in polynomial time using a dynamic programming algorithm that runs in O(n^2) time by building up optimal tours incrementally from left to right. The algorithm maintains arrays to store the shortest path between all pairs of points seen so far.

Uploaded by

EEEE
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)
76 views20 pages

2 Bitonic 肖江

The document describes the bitonic tour problem, which is a simplified version of the traveling salesman problem where the tour must start at the leftmost point, go right to the rightmost point, then left back to the start. It can be solved in polynomial time using a dynamic programming algorithm that runs in O(n^2) time by building up optimal tours incrementally from left to right. The algorithm maintains arrays to store the shortest path between all pairs of points seen so far.

Uploaded by

EEEE
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/ 20

Bitonic Tour Problem

Bitonic Tour Problem

Rivers

Nanjing University

September 15, 2018


Bitonic Tour Problem
What is the Problem
Problem 15-3 Bitonic Tour Problem

In the euclidean traveling-salesman problem, we are given a set


of n points in the plane, and we wish to find the shortest closed
tour that connects all n points. Figure 15.11(a) shows the solution
to a 7-point problem. The general problem is NP-hard, and its
solution is therefore believed to require more than polynomial time
(see Chapter 34).
J. L. Bentley has suggested that we simplify the problem by
restricting our attention to bitonic tours , that is, tours that start
at the leftmost point, go strictly rightward to the rightmost point,
and then go strictly leftward back to the starting point.Figure
15.11(b) shows the shortest bitonic tour of the same 7 points. In
this case, a polynomial-time algorithm is possible.
Describe an O(n2 )-time algorithm for determining an optimal
bitonic tour. You may assume that no two points have the same
x-coordinate and that all operations on real numbers take unit
time. ( Hint: Scan left to right, maintaining optimal possibilities
for the two parts of the tour.)
Bitonic Tour Problem
What is the Problem
Problem 15-3 Bitonic Tour Problem

J. L. Bentley has suggested that we simplify the problem by


restricting our attention to bitonic tours , that is, tours that start
at the leftmost point, go strictly rightward to the rightmost point,
and then go strictly leftward back to the starting point.Figure
15.11(b) shows the shortest bitonic tour of the same 7 points. In
this case, a polynomial-time algorithm is possible.
Describe an O(n2 )-time algorithm for determining an optimal
bitonic tour. You may assume that no two points have the same
x-coordinate and that all operations on real numbers take unit
time. ( Hint: Scan left to right, maintaining optimal possibilities
for the two parts of the tour.)
Bitonic Tour Problem
What is the Problem
Problem 15-3 Bitonic Tour Problem

Restricting our attention to bitonic tours


Tours that start at the leftmost point, go strictly rightward to the
rightmost point, and then go strictly leftward back to the starting
point.
Describe an O(n2 )-time algorithm for determining an optimal
bitonic tour.

Figure: Tour Figure: Bitonic Tour


Bitonic Tour Problem
What is the Problem
A Few More Details

You may assume that no two points have the same x-coordinate
and that all operations on real numbers take unit time.

Hint: Scan left to right, maintaining optimal possibilities for the


two parts of the tour.
Bitonic Tour Problem
What is the Problem
What does ‘Bitonic’ mean?

What does ‘Bitonic’ mean?


Bitonic Tour Problem
What is the Problem
What does ‘Bitonic’ mean?

What does ‘Bitonic’ mean?

Bitonic
(computing theory, of a sequence) Having the property
x0 ≤ · · · ≤ xk ≥ · · · ≥ xn−1 for some k, 0 ≤ k < n, or being a
circular shift of such a sequence.
Bitonic Tour Problem
What is the Problem
The Problem

A set of points {p1 , p2 , . . . , pn }


Bitonic Tour Problem
What is the Problem
The Problem

A set of points {p1 , p2 , . . . , pn }


The shortest bitonic path Pi,j , where i ≤ j, includes all points
p1 , p2 , . . . , pj ; it starts at some point pi , goes strictly left to point
p1, and then goes strictly right to point pj .
Bitonic Tour Problem
What is the Problem
The Problem

A set of points {p1 , p2 , . . . , pn }


The shortest bitonic path Pi,j , where i ≤ j, includes all points
p1 , p2 , . . . , pj ; it starts at some point pi , goes strictly left to point
p1, and then goes strictly right to point pj .
Pn,n
Bitonic Tour Problem
What is the Problem
The Problem

A set of points {p1 , p2 , . . . , pn }


The shortest bitonic path Pi,j , where i ≤ j, includes all points
p1 , p2 , . . . , pj ; it starts at some point pi , goes strictly left to point
p1, and then goes strictly right to point pj .
Pn,n =Pn−1,n + ln−1,n
Bitonic Tour Problem
What is the optimal-substructure?
Two Cases

Optimal Substructure
Pi,j (i < j) is the shortest bitonic tour.
(1). i < j − 1, remove the line pj−1 pj , it becomes Pi,j−1 .
(2). i = j − 1. let k be the predecessor of pj . Remove pk pj and it
becomes Pk,j−1 .
Bitonic Tour Problem
What is the optimal-substructure?
Case 1: i < j − 1

Case 1: i < j − 1
i < j − 1. But Pi,j includes all points p1 , . . . , pj−1 , pj . pj−1 is the
predecessor of pj .
cut-and-paste
Bitonic Tour Problem
What is the optimal-substructure?
Case 2: i = j − 1

Case 2: i = j − 1
i = j − 1. pj must have a predecessor pk (1 ≤ k ≤ j − 2).
cut-and-paste
Bitonic Tour Problem
What is the optimal-substructure?
Case 2: i = j − 1

Case 2: i = j − 1
i = j − 1. pj must have a predecessor pk (1 ≤ k ≤ j − 2).
cut-and-paste
Why Pk,j−1 ? Why not Pj−1,k ?
Bitonic Tour Problem
What is the optimal-substructure?
Recursive formula


l[1, 2]
 i = 1 and j = 2
P[i, j] = P[i, j − 1] + l[j − 1, j] i <j −1

min1≤k≤j−2 P[k, j − 1] + l[k, j] i =j −1

Bitonic Tour Problem
What is the optimal-substructure?
Recursive formula


l[1, 2]
 i = 1 and j = 2
P[i, j] = P[i, j − 1] + l[j − 1, j] i <j −1

min1≤k≤j−2 P[k, j − 1] + l[k, j] i =j −1

j
X
P[1, j] = P[k − 1, k]?
k=2
Bitonic Tour Problem
What is the pseudocode?
EUCLIDEAN-TSP

EUCLIDEAN-TSP(p)
1 Sort(p)
2 let b[1..n, 2..n] and r [1..n − 2, 3..n] be new arrays
3 b[1, 2] = Len(p[1], p[2])
4 for j = 3 to n
5 for i = 1 to j − 2
6 b[i, j] = b[i, j − 1] + Len(pj−1 , pj )
7 r [i, j] = j − 1
8 b[j − 1, i] = ∞
9 for k = 1 to j − 2
10 q = b[k, j − 1] + Len(pk , pj )
11 if q < b[j, j − 1]
12 b[j − 1, j] = q
13 r [j − 1, j] = k
14 b[n, n] = b[n − 1, n] + Len(pn−1 , pn )
15 return b and r
Bitonic Tour Problem
What is the pseudocode?
PRINT-TOUR and PRINT-PATH

PRINT-PATH(r , i, j)
1 if i < j
PRINT- 2 k = r [i, j]
TOUR(r,n) 3 if k 6= i
1 print p[n] 4 print p[k]
2 print p[n − 1] 5 if k > 1
3 k = r [n − 1, n] 6 PRINT-PATH(r , i, k)
4 PRINT-PATH 7 else
5 (r , k, n − 1) 8 k = r [j, i]
6 print p[k] 9 if k > 1
10 PRINT-PATH(r , k, j)
11 print p[k]
Bitonic Tour Problem
Thank-You

You might also like