Local Search Heuristics for Facility Location Problemsrohitk/research/kmed-slides.pdf ·...
Transcript of Local Search Heuristics for Facility Location Problemsrohitk/research/kmed-slides.pdf ·...
Local Search Heuristics forFacility Location Problems
Rohit Khandekar
Dept. of Computer Science and Engineering,
Indian Institute of Technology Delhi
Joint work with: Vijay Arya, Naveen Garg, Vinayaka Pandit
Kamesh Munagala, Adam Meyerson
Departmental Seminar – p.1/43
Outline
Define the k-median problem
Simple local search algorithm
Analysis
Generalization
Departmental Seminar – p.2/43
The k-median problem
We are given n points in a metric space.
Departmental Seminar – p.3/43
The k-median problem
We are given n points in a metric space.
uv
w
d
�
w � v �
d
�
u � w ��
d
�
u � w � �
d
�
w � v �
d
�
u � v � �0 � d
�
u � u � 0 � d
�
u � v � d �
v � u �
Departmental Seminar – p.4/43
The k-median problem
We are given n points in a metric space.
Departmental Seminar – p.5/43
The k-median problem
We are given n points in a metric space.
We want to identify k “medians” such that the sum of distances of
all the points to their nearest medians is minimized.Departmental Seminar – p.6/43
The k-median problem
We are given n points in a metric space.
We want to identify k “medians” such that the sum of lengths of all
the red segments is minimized.Departmental Seminar – p.7/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A brief bio-sketch of the k-median problem
NP-hard
Known to OR community since 60’s.
Used for locating warehouses, manufacturing plants, etc.
Used also for clustering, data mining.
Received the attention of the Approximation algorithmscommunity in early 90’s.
Various algorithms via LP-relaxation, primal-dual scheme,etc.
Departmental Seminar – p.8/43
A local search algorithm
Start with any set of k medians.
Departmental Seminar – p.9/43
A local search algorithm
Start with any set of k medians.
Departmental Seminar – p.9/43
A local search algorithm
Identify a median and a point that is not a median.
Departmental Seminar – p.10/43
A local search algorithm
And SWAP tentatively!
Departmental Seminar – p.11/43
A local search algorithm
Perform the swap, only if the new solution is “better” (has lesscost) than the previous solution.
Stop, if there is no swap that improves the solution.
Departmental Seminar – p.12/43
A local search algorithm
Perform the swap, only if the new solution is “better” (has lesscost) than the previous solution.
Stop, if there is no swap that improves the solution.
Departmental Seminar – p.12/43
The algorithm
Algorithm Local Search.
1. S any k medians
2. While
�
s � S and s
� � S such that,cost
�
S � s �
s
���
cost�
S�
,do S S � s �
s
3. return S
Departmental Seminar – p.13/43
The algorithm
Algorithm Local Search.
1. S any k medians
2. While
�
s � S and s
� � S such that,cost
�
S � s �
s
��� �1 � ε �
cost
�
S
�
,do S S � s �
s
3. return S
Departmental Seminar – p.14/43
Main theorem
The local search algorithm described above computes asolution with cost (the sum of distances) at most 5 timesthe minimum cost.
Korupolu, Plaxton, and Rajaraman (1998) analyzed avariant in which they permitted adding, deleting, andswapping medians and got 3 5 ε approximation bytaking k 1 ε medians.
Departmental Seminar – p.15/43
Main theorem
The local search algorithm described above computes asolution with cost (the sum of distances) at most 5 timesthe minimum cost.
Korupolu, Plaxton, and Rajaraman (1998) analyzed avariant in which they permitted adding, deleting, andswapping medians and got
�3
�
5
�
ε
�
approximation bytaking k
�
1
� ε �
medians.
Departmental Seminar – p.15/43
Some notation
S j
js
S � � �
S
� � k NS
�
s
�
cost�
S� � the sum of lengths of all the red segments
�
Departmental Seminar – p.16/43
Some more notation
� �
O
� � k
NO
�o
�
O � �
o
Departmental Seminar – p.17/43
Some more notation
NO
�o
�
o
s1s2
s4 s3
Nos1
Nos4
Nos3
Nos2
Nos
NO
�
o
���
NS
�
s
�
Departmental Seminar – p.18/43
Local optimality of S
Since S is a local optimum solution,
We have,
cost S s o cost S for all s S o O
We shall add k of these inequalities (chosen carefully) toshow that,
cost S 5 cost O
> >
Departmental Seminar – p.19/43
Local optimality of S
Since S is a local optimum solution,
We have,
cost
�
S � s �
o
� �
cost
�
S
�
for all s � S � o � O �
We shall add k of these inequalities (chosen carefully) toshow that,
cost S 5 cost O
> >
Departmental Seminar – p.19/43
Local optimality of S
Since S is a local optimum solution,
We have,
cost
�
S � s �
o
� �
cost
�
S
�
for all s � S � o � O �
We shall add k of these inequalities (chosen carefully) toshow that,
cost
�
S
� �5 � cost
�
O
�
> >
Departmental Seminar – p.19/43
Capture
NO
�o
�
o
s1s2
s4 s3
Nos1
Nos4
Nos3
Nos2
We say that s � S captures o � O if
�No
s
����
NO
�
o
� �
2
�
Capture graphDepartmental Seminar – p.20/43
A mapping π
NO
�o
�
o
s1s2
s4 s3
Nos1
Nos4
Nos3
Nos2
We consider a permutation π : NO
�o
� � NO
�
o
�
that satisfies thefollowing property:
if s does not capture o then a point j � Nos should get mapped
outside Nos .
Departmental Seminar – p.21/43
A mapping π
NO
�o
�
o
s1s2
s4 s3
Nos1
Nos4
Nos3
Nos2
We consider a permutation π : NO
�o
� � NO
�
o
�
that satisfies thefollowing property:
if s does not capture o then a point j � Nos should get mapped
outside Nos .
Departmental Seminar – p.22/43
A mapping π
NO
�o
�
o
s1s2
s4 s3
Nos1
Nos4
Nos3
Nos2
i
�
l
2�
NO�
o� � � l
i l21
πDepartmental Seminar – p.23/43
Capture graph
O
S
l
!
l
2
Construct a bipartite graph G �O � S � E �
where there is an edge�
o � s �
if and only if s � S captures o � O.
Capture
Departmental Seminar – p.24/43
Swaps considered
O
S
l
!
l
2
“Why consider the swaps?”
Departmental Seminar – p.25/43
Swaps considered
O
S
l
!
l
2
“Why consider the swaps?”
Departmental Seminar – p.25/43
Properties of the swaps considered
O
S
l
!
l
2
If
"
s � o #
is considered, then s does not capture any o
� o.
Any o O is considered in exactly one swap.
Any s S is considered in at most 2 swaps.
Departmental Seminar – p.26/43
Properties of the swaps considered
O
S
l
!
l
2
If
"
s � o #
is considered, then s does not capture any o
� o.
Any o � O is considered in exactly one swap.
Any s S is considered in at most 2 swaps.
Departmental Seminar – p.26/43
Properties of the swaps considered
O
S
l
!
l
2
If
"
s � o #
is considered, then s does not capture any o
� o.
Any o � O is considered in exactly one swap.
Any s � S is considered in at most 2 swaps.
Departmental Seminar – p.26/43
Focus on a swap
$
s % o
&
os
Consider a swap
"s � o #
that is one of the k swaps defined above.
We know cost�
S � s �o
� �
cost
�
S
�
.
Departmental Seminar – p.27/43
Upper bound on cost
'
S ( s o
)
In the solution S � s �
o, each point is connected to theclosest median in S � s �
o.
cost S s o is the sum of distances of all the points totheir nearest medians.
We are going to demonstrate a possible way of connectingeach client to a median in S s o to get an upper boundon cost S s o .
Departmental Seminar – p.28/43
Upper bound on cost
'
S ( s o
)
In the solution S � s �
o, each point is connected to theclosest median in S � s �
o.
cost
�
S � s �
o
�
is the sum of distances of all the points totheir nearest medians.
We are going to demonstrate a possible way of connectingeach client to a median in S s o to get an upper boundon cost S s o .
Departmental Seminar – p.28/43
Upper bound on cost
'
S ( s o
)
In the solution S � s �
o, each point is connected to theclosest median in S � s �
o.
cost
�
S � s �
o
�
is the sum of distances of all the points totheir nearest medians.
We are going to demonstrate a possible way of connectingeach client to a median in S � s �
o to get an upper boundon cost
�
S � s �
o
�
.
Departmental Seminar – p.28/43
Upper bound on cost
'
S ( s o
)sNO
�
o
�
o
Points in NO
�
o
�
are now connected to the new median o.
Departmental Seminar – p.29/43
Upper bound on cost
'
S ( s o
)sNO
�
o
�
o
Thus, the increase in the distance for j � NO
�
o
�
is at most
O j
� S j �
Departmental Seminar – p.30/43
Upper bound on cost
'
S ( s o
)sNO
�
o
�
o
j
Consider a point j � NS
�s
�*
NO
�
o
�
.
Departmental Seminar – p.31/43
Upper bound on cost
'
S ( s o
)sNO
�
o
�
o
j
π
�
j
� s
+
Consider a point j � NS
�s
�*
NO
�
o
�
.
Suppose π�
j� � NS
�s
�
. (Note that s
� s.)
Departmental Seminar – p.32/43
Upper bound on cost
'
S ( s o
)sNO
�
o
�
o
j
π
�
j
� s
+
Consider a point j � NS
�s
�*
NO
�
o
�
.
Suppose π�
j� � NS
�s
�
. (Note that s
� s.)
Connect j to s
now.
Departmental Seminar – p.33/43
Upper bound on cost
'
S ( s o
)j
s
+π
�
j
�
Sπ
,
j
-Oπ
,
j
-
O j
o
+
New distance of j is at most O j
�
Oπ
.
j
/ �
Sπ
.
j
/ .
Therefore, the increase in the distance for j NS s NO ois at most
O j Oπ j Sπ j S j
Departmental Seminar – p.34/43
Upper bound on cost
'
S ( s o
)j
s
+π
�
j
�
Sπ
,
j
-Oπ
,
j
-
O j
o
+
New distance of j is at most O j
�
Oπ
.
j
/ �
Sπ
.
j
/ .Therefore, the increase in the distance for j � NS
�
s
� *
NO
�
o
�
is at mostO j
�
Oπ
.
j
/ �
Sπ
.
j
/ � S j �
Departmental Seminar – p.34/43
Upper bound on the increase in the cost
Lets try to count the total increase in the cost.
Points j NO o contribute at most
O j S j
Points j NS s NO o contribute at most
O j Oπ j Sπ j S j
Thus, the total increase is at most,
∑j NO o
O j S j ∑j NS s NO o
O j Oπ j Sπ j S j
Departmental Seminar – p.35/43
Upper bound on the increase in the cost
Lets try to count the total increase in the cost.
Points j � NO
�
o
�
contribute at most
�
O j
� S j
� �
Points j NS s NO o contribute at most
O j Oπ j Sπ j S j
Thus, the total increase is at most,
∑j NO o
O j S j ∑j NS s NO o
O j Oπ j Sπ j S j
Departmental Seminar – p.35/43
Upper bound on the increase in the cost
Lets try to count the total increase in the cost.
Points j � NO
�
o
�
contribute at most
�
O j
� S j
� �Points j � NS
�
s
� *
NO
�
o
�
contribute at most
�
O j
�
Oπ
.j
/ �Sπ
.j
/ � S j
� �
Thus, the total increase is at most,
∑j NO o
O j S j ∑j NS s NO o
O j Oπ j Sπ j S j
Departmental Seminar – p.35/43
Upper bound on the increase in the cost
Lets try to count the total increase in the cost.
Points j � NO
�
o
�
contribute at most
�
O j
� S j
� �Points j � NS
�
s
� *
NO
�
o
�
contribute at most
�
O j
�
Oπ
.j
/ �Sπ
.j
/ � S j
� �
Thus, the total increase is at most,
∑j 0NO
.
o
/�
O j
� S j� � ∑
j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �
Sπ
.
j
/ � S j
� �
Departmental Seminar – p.35/43
Upper bound on the increase in the cost
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.j
/ �Sπ
.j
/ � S j
�
cost S s o cost S
0
Departmental Seminar – p.36/43
Upper bound on the increase in the cost
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.j
/ �Sπ
.j
/ � S j
�
�
cost
�
S � s �
o
� � cost�
S
�
0
Departmental Seminar – p.36/43
Upper bound on the increase in the cost
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.j
/ �Sπ
.j
/ � S j
�
�
cost
�
S � s �
o
� � cost�
S
�
�0
Departmental Seminar – p.36/43
Plan
We have one such inequality for each swap
"
s � o #.
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
There are k swaps that we have defined.
O
S
l
l 2
Lets add the inequalities for all the k swaps and see whatwe get!
Departmental Seminar – p.37/43
Plan
We have one such inequality for each swap
"
s � o #.
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
There are k swaps that we have defined.
O
S
l
l 2
Lets add the inequalities for all the k swaps and see whatwe get!
Departmental Seminar – p.37/43
Plan
We have one such inequality for each swap
"
s � o #.
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
There are k swaps that we have defined.
O
S
l2
l
3
2
Lets add the inequalities for all the k swaps and see whatwe get!
Departmental Seminar – p.37/43
Plan
We have one such inequality for each swap
"
s � o #.
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
There are k swaps that we have defined.
O
S
l2
l
3
2
Lets add the inequalities for all the k swaps and see whatwe get!
Departmental Seminar – p.37/43
The first term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
Note that each o O is considered in exactly one swap.Thus, the first term added over all the swaps is
∑o O
∑j NO o
O j S j
∑j
O j S j
cost O cost S
Departmental Seminar – p.38/43
The first term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
Note that each o � O is considered in exactly one swap.
Thus, the first term added over all the swaps is
∑o O
∑j NO o
O j S j
∑j
O j S j
cost O cost S
Departmental Seminar – p.38/43
The first term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
Note that each o � O is considered in exactly one swap.Thus, the first term added over all the swaps is
∑o 0O
∑j 0NO
.o/
�O j
� S j
�
∑j
O j S j
cost O cost S
Departmental Seminar – p.38/43
The first term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
Note that each o � O is considered in exactly one swap.Thus, the first term added over all the swaps is
∑o 0O
∑j 0NO
.o/
�O j
� S j
�
∑j
�O j
� S j
�
cost O cost S
Departmental Seminar – p.38/43
The first term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/ 1
NO
.
o
/�
O j
�
Oπ
.
j
/ �Sπ
.j
/ � S j
� �
0 �
Note that each o � O is considered in exactly one swap.Thus, the first term added over all the swaps is
∑o 0O
∑j 0NO
.o/
�O j
� S j
�
∑j
�O j
� S j
�
cost
�
O
� � cost
�
S
� �
Departmental Seminar – p.38/43
The second term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
� �
0 �
Note thatO j Oπ j Sπ j S j
ThusO j Oπ j Sπ j S j 0
Thus the second term is at most
∑j NS s
O j Oπ j Sπ j S j
Departmental Seminar – p.39/43
The second term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
� �
0 �
Note thatO j
�
Oπ
.
j
/ �
Sπ
.j
/ �S j �
ThusO j Oπ j Sπ j S j 0
Thus the second term is at most
∑j NS s
O j Oπ j Sπ j S j
Departmental Seminar – p.39/43
The second term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
� �
0 �
Note thatO j
�
Oπ
.
j
/ �
Sπ
.j
/ �S j �
ThusO j
�
Oπ.
j/ �
Sπ
.j
/ � S j
�
0 �
Thus the second term is at most
∑j NS s
O j Oπ j Sπ j S j
Departmental Seminar – p.39/43
The second term 4 4 4
∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
� �
0 �
Note thatO j
�
Oπ
.
j
/ �
Sπ
.j
/ �S j �
ThusO j
�
Oπ.
j/ �
Sπ
.j
/ � S j
�
0 �
Thus the second term is at most
∑j 0NS
.s
/�
O j
�
Oπ
.
j
/ �
Sπ
.
j
/ � S j
� �
Departmental Seminar – p.39/43
The second term 4 4 4
Note that each s � S is considered in at most two swaps.
Thus, the second term added over all the swaps is at most
2 ∑s S
∑j NS s
O j Oπ j Sπ j S j
2 ∑j
O j Oπ j Sπ j S j
2 ∑j
O j ∑j
Oπ j ∑j
Sπ j ∑j
S j
4 cost O
Departmental Seminar – p.40/43
The second term 4 4 4
Note that each s � S is considered in at most two swaps.
Thus, the second term added over all the swaps is at most
2 ∑s 0S
∑j 0NS
.
s
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
�
2 ∑j
O j Oπ j Sπ j S j
2 ∑j
O j ∑j
Oπ j ∑j
Sπ j ∑j
S j
4 cost O
Departmental Seminar – p.40/43
The second term 4 4 4
Note that each s � S is considered in at most two swaps.
Thus, the second term added over all the swaps is at most
2 ∑s 0S
∑j 0NS
.
s
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
�
2 ∑j
�
O j
�
Oπ.
j/ �
Sπ
.
j
/ � S j
�
2 ∑j
O j ∑j
Oπ j ∑j
Sπ j ∑j
S j
4 cost O
Departmental Seminar – p.40/43
The second term 4 4 4
Note that each s � S is considered in at most two swaps.
Thus, the second term added over all the swaps is at most
2 ∑s 0S
∑j 0NS
.
s
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
�
2 ∑j
�
O j
�
Oπ.
j/ �
Sπ
.
j
/ � S j
�
2 ∑j
O j� ∑
jOπ
.
j
/ � ∑j
Sπ
.
j
/ � ∑j
S j
4 cost O
Departmental Seminar – p.40/43
The second term 4 4 4
Note that each s � S is considered in at most two swaps.
Thus, the second term added over all the swaps is at most
2 ∑s 0S
∑j 0NS
.
s
/�
O j
�
Oπ
.
j
/ �
Sπ.
j/ � S j
�
2 ∑j
�
O j
�
Oπ.
j/ �
Sπ
.
j
/ � S j
�
2 ∑j
O j� ∑
jOπ
.
j
/ � ∑j
Sπ
.
j
/ � ∑j
S j 4 � cost
�
O
� �
Departmental Seminar – p.40/43
Putting things together
0
� ∑5
s 6o 7 ∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j�
Oπ
.j
/ �
Sπ
.
j
/ � S j
�
cost O cost S 4 cost O
5 cost O cost S
Therefore,cost S 5 cost O
Departmental Seminar – p.41/43
Putting things together
0
� ∑5
s 6o 7 ∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j�
Oπ
.j
/ �
Sπ
.
j
/ � S j
�
� 8
cost
�
O
� � cost
�
S
�9 � 84 � cost
�
O
�9
5 cost O cost S
Therefore,cost S 5 cost O
Departmental Seminar – p.41/43
Putting things together
0
� ∑5
s 6o 7 ∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j�
Oπ
.j
/ �
Sπ
.
j
/ � S j
�
� 8
cost
�
O
� � cost
�
S
�9 � 84 � cost
�
O
�9
5 � cost
�O
� � cost
�
S
� �
Therefore,cost S 5 cost O
Departmental Seminar – p.41/43
Putting things together
0
� ∑5
s 6o 7 ∑j 0NO
.
o
/�
O j
� S j
� � ∑j 0NS
.
s
/1
NO
.
o
/�
O j�
Oπ
.j
/ �
Sπ
.
j
/ � S j
�
� 8
cost
�
O
� � cost
�
S
�9 � 84 � cost
�
O
�9
5 � cost
�O
� � cost
�
S
� �
Therefore,cost
�S
� �5 � cost
�
O
� �
Departmental Seminar – p.41/43
A tight example
22
0 0
22
0 0
�
k : 1 �
2
�
k
�
1
�
2
22
0 0
1 1 1
11
1
�
k : 1 �; ; ;
O
S
; ; ;
cost S 4 k 1 2 k 1 2 5k 3 2
cost O 0 k 1 2 k 1 2
Departmental Seminar – p.42/43
A tight example
22
0 0
22
0 0
�
k : 1 �
2
�
k
�
1
�
2
22
0 0
1 1 1
11
1
�
k : 1 �; ; ;
O
S
; ; ;
cost
�
S
� 4 � �k � 1 � �
2
� �
k
�
1
� �
2 �
5k � 3 � �
2
cost O 0 k 1 2 k 1 2
Departmental Seminar – p.42/43
A tight example
22
0 0
22
0 0
�
k : 1 �
2
�
k
�
1
�
2
22
0 0
1 1 1
11
1
�
k : 1 �; ; ;
O
S
; ; ;
cost
�
S
� 4 � �k � 1 � �
2
� �
k
�
1
� �
2 �
5k � 3 � �
2
cost
�
O
� 0 � �k
�
1
� �
2 �
k
�
1
� �
2
Departmental Seminar – p.42/43
Doing multiple swaps
Doing single swaps yields 5 approximation.
Doing p-way swaps yields 3 2 p approximation.
Departmental Seminar – p.43/43
Doing multiple swaps
Doing single swaps yields 5 approximation.
Doing p-way swaps yields
�
3
�2
�p
�approximation.
Departmental Seminar – p.43/43