2.2. Show that this algorithm has an approximation ratio √2. More specifi- cally: The point found by the algorithm has a weighted sum of Euclidean(!) distances that is at most √2 times the optimal sum.

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter7: Analytic Trigonometry
Section7.6: The Inverse Trigonometric Functions
Problem 94E
icon
Related questions
Question

I need help to solve the question 2.2 in the following exercise , I add my solution for 2.1 it might help . 

This problem is at least not very easy to solve exactly. In the following
we therefore propose a rough but rather quick and simple approximation
algorithm: Instead of the Euclidean distance, take the Manhattan distance
and minimize
n
Σwi · (|x − xi| + |y − Yi|).
i=1
2.1. Explain how the point that minimizes the weigthed sum of Manhattan
distances can be found in polynonial time. That is: Sketch an algorithm,
argue why it is correct, and explain your time bound. Try to keep the time
bound as low as possible.
2.2. Show that this algorithm has an approximation ratio √√2. More specifi-
cally: The point found by the algorithm has a weighted sum of Euclidean(!)
distances that is at most √2 times the optimal sum.
Advice: In 2.1, split the problem in two “independent” one-dimensional
problems, that is, work separately in x- and y-direction. To get a correct
idea where to find the optimal coordinate x (and y), it might be good to
study examples with very small n first. In 2.2, first write down in general
terms what the approximation ratio of the proposed algorithm is, then do
the necessary geometry. Finally check whether you have really achieved the
goal of proving the claimed approxiamtion ratio. (It is easy to forget this
goal and stop half-way.)
Transcribed Image Text:This problem is at least not very easy to solve exactly. In the following we therefore propose a rough but rather quick and simple approximation algorithm: Instead of the Euclidean distance, take the Manhattan distance and minimize n Σwi · (|x − xi| + |y − Yi|). i=1 2.1. Explain how the point that minimizes the weigthed sum of Manhattan distances can be found in polynonial time. That is: Sketch an algorithm, argue why it is correct, and explain your time bound. Try to keep the time bound as low as possible. 2.2. Show that this algorithm has an approximation ratio √√2. More specifi- cally: The point found by the algorithm has a weighted sum of Euclidean(!) distances that is at most √2 times the optimal sum. Advice: In 2.1, split the problem in two “independent” one-dimensional problems, that is, work separately in x- and y-direction. To get a correct idea where to find the optimal coordinate x (and y), it might be good to study examples with very small n first. In 2.2, first write down in general terms what the approximation ratio of the proposed algorithm is, then do the necessary geometry. Finally check whether you have really achieved the goal of proving the claimed approxiamtion ratio. (It is easy to forget this goal and stop half-way.)
2.1 The task requires finding a point (x,y) that minimizes that weighted sum of
Manhattan distances from a set of points with given Cartesian coordinates (xi, yi) and
positive weight wi.
To solve this in polynomial time, we can take advantage of the linearity of the
Manhattan distance in each coordinate direction. This means we can find the optimal
coordinates independently.
Firstly, we separate the problem into one-dimensional problems, one for the x-
coordinates and one for the y-coordinates.
For x-coordinates we sort the points by their x-coordinate, and we calculate a weighted
median that minimize the sum of weighted absolute differences Σï=₁ w₁|x − x¡]. This
can be done by accumulating the weights from one end and finding the point where the
sum of the weights before it is as close as possible to sum of weights after it, we repeat
the same for the y-coordinates.
The algorithm works correctly because the weighted median minimizes the sum of
weighted absolute distances in one dimension. This is de to the fact that any weighted
side that it would decrease on the lighter side.
The sorting step can be done in O(n log n) time.
Finding the weighted median can be done in O(n) time after sorting, hence the total
time complexity is O(n log n) due to the sorting step.
Transcribed Image Text:2.1 The task requires finding a point (x,y) that minimizes that weighted sum of Manhattan distances from a set of points with given Cartesian coordinates (xi, yi) and positive weight wi. To solve this in polynomial time, we can take advantage of the linearity of the Manhattan distance in each coordinate direction. This means we can find the optimal coordinates independently. Firstly, we separate the problem into one-dimensional problems, one for the x- coordinates and one for the y-coordinates. For x-coordinates we sort the points by their x-coordinate, and we calculate a weighted median that minimize the sum of weighted absolute differences Σï=₁ w₁|x − x¡]. This can be done by accumulating the weights from one end and finding the point where the sum of the weights before it is as close as possible to sum of weights after it, we repeat the same for the y-coordinates. The algorithm works correctly because the weighted median minimizes the sum of weighted absolute distances in one dimension. This is de to the fact that any weighted side that it would decrease on the lighter side. The sorting step can be done in O(n log n) time. Finding the weighted median can be done in O(n) time after sorting, hence the total time complexity is O(n log n) due to the sorting step.
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Calculus For The Life Sciences
Calculus For The Life Sciences
Calculus
ISBN:
9780321964038
Author:
GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.
Publisher:
Pearson Addison Wesley,
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell