Sie sind auf Seite 1von 29

Parametric Search

What it is and how to make it practical

Presented by
Indranil Nandy

Guided by
Prof. Arijit Bishnu

1
Linear Search
Binary Search
Hashing
.
.
.
Parametric Search
-what it is

2
Parametric Search

optimization technique developed by Megiddo in the late 1970s and


early 1980s

has become an important tool for solving many geometric


optimization queries efficiently

3
What is Parametric
Search?
Parametric search can be defined as follows :

Assume that we have a decision problem


P(t) that is monotonous in t. Our task is to
find t(=t*), the maximum value of t for which
P(t) is true.

17 th Oct,2006 4
What is monotonous function?
 if P(t0) is true, then P(t) is true for all t <= t0.
 if P(t0) is false, then P(t) is false for all t => t0.
Let, us give an example. Look at the following fig.

>=t*
f o r t
A f alse
i s
P(t)
t = t*
q(t)
t*
t=0 0< =t<= B
for
i s t rue
(starting point) P(t)
q(t) : parametric equation of the ray
P(t) : whether q(t) lies on the left of AB
So, P(t) is a monotonous function
89
17 th Oct,2006 5
So how to find t* ?
 We will find t* with the technique called Parametric
Searching.
 For Parametric Searching to be used it must have the
following property :
 we have an algorithm As that solves the
decision problem P, and that can determine for any input
value t whether t < t*, t = t*, or t > t* [It may seem
strange that we do not know t*,then how to compare any
given input with t*…mainly the equality test? Think for the
previously given example, there if we know the equation of
AB then it is possible to say for any t whether q(t) is on AB
(i.e.t=t*) or it lies on the left (i.e. t<t*) or on the
right(t>t*),though we do not know t*!!]
 the flow of control of As depends on
comparisons
17 th Oct,2006 6
Let, the domain of t is (-¥,¥) where ¥ may
be ∞.
We can assume any value Δ from the
domain to be approximated as t* and we
can check if it is really t* or less than or
greater than with the known algorithm As for
the decision problem
But if it solves our problem?
No, there are infinitesimal points in the
domain
So, what will we do?
7
How to find t*?
 We will use this algorithm for the decision problem
but slightly changed.
 At every iteration if we can reduce the interval in
which t lies then eventually we can get t* from a
sufficient small interval
 Our implementation will do that exactly by using
the decision problem algorithm and finally we will
get t* as a by-product of running our algorithm, say
AGs ,generic As algorithm.

17 th Oct,2006 8
How does our algorithm AGS work?
 The input to AG is Δ assumed as an approximation of t*
S

 AG will simulate As on Δ
S

 Now control flow of As depends on comparisons, so the


quantities that arise in this simulation are going to be
rational functions in t*
 Now the comparison of two rational bounded functions of t*
can be reduced to testing
the sign of a single suitable polynomial function f(x
) at the value t*
 In the process of testing the sign of f(x), we will actually
reduce the searching interval for t* as a by-product
 Eventually either we will get t* or a sufficient small interval
(u,v) for t* so that it can be approximated by some function
ψ(u,v) [Actually ψ depends on the application for which
parametric searching is used.
17 th Oct,2006 9
Rational bounded function :

 A rational function is the ratio of two


polynomial functions
 A rational function is bounded if both the
numerator and the denominator are
polynomials of bounded degree

17 th Oct,2006 10
How to check the sign of a bounded degree
polynomial function f(t) at t = a?
 f(t) is a bounded degree polynomial
function,so all roots of f(t) can be found in
O(1) time by using some numerical methods
e.g. Newton’s approximation. Let those be
a0,a1,….,ak.
 So f(t) can be expressed as below :

f(t) = (t - a0)(t – a1)…(t - ak)


 Now, clearly from the above equation sign
of f(a) can be found
17 th Oct,2006 11
Graphical representation of the control flow of our algorithm AGS

Reduced to the comparison Reduced to test the


of two rational bounded sign of a bounded poly
functions f(x) at x=t*
Δ as an approx of t*

Reduced interval for t*


(as a by-product) t* found and the
I = I ∩ (ri ,ri+1) Execution aborted
since As is
simulated on the
input
From the sign of the
Take any value Δ as the
polynomial the outcome
approximation for t* from
of the comparison is
the reduced interval I
obvious

17 th Oct,2006 12
f(x) Newton’s Approximation

Roots of f(x)

As As As As

Find ri and ri+1 such that


ri<=t*<=ri+1

Evaluate f(x) for any value x Y N


ri < x < ri+1 t* t* found
found

sign of
f(x) at
17 th Oct,2006 X=t* 13
What is the running time of AG ? S

Look again at the graphical representation of our algorithm As. Except


for the block of testing the sign of f(x) at x=t*,other blocks will take
constant order of time. So the running time of As depends on the
running time of that block.

14
What is the running time?
Now what is the running time of this block?
Let, running time of As is : Ts
No of comparisons made by As (totally in all iterations) : Cs

( 1)
O f or
T s) lock
O( h b
c
ea

( 1)
O

15
 So the running time of AG is O(TSCS)
S

 How can it be improved?


 At each iteration, we were doing comparison for each of
the roots of f(x), this number can be minimised
 First sort the roots
 Then starting from the lowest valued root proceed until P(t)
(say at t = tx) is false
 As P is monotonous, for Ұt((t<tx) → P(t)) and Ұt((t=>tx) →
~P(t))
 So t* must be in between tx and tx-1 and we need not
check the remaining roots
 This can be furthur improved by using binary search
technique on the roots to take it for comparison. The
median of the roots are found by some linear-time median
find algorithm

17 th Oct,2006 16
 Actually to speed up the execution, our algorithm
AG is replaced with the parallel version Ap
S

 Ap uses P processors and runs Tp parallel steps


 Then each parallel step invokes at least P
independent comparisons
 The cost of simulating a parallel step of Ap is P +
TslogP
 So, total cost (for Tp parallel steps) is :
Tp ( P + TslogP )
 In most cases the second term dominates

17 th Oct,2006 17
Cost of simulating a parallel step of
Ap is : P + TslogP
∆1 ∆2 ∆3 ∆4

As As As As

∩ ∩

logP steps
Each step
cost Ts

17 th Oct,2006 18
 The running time of the previous block is :
P +TslogP

 Now if the previous block runs for Tp times


i.e., total Tp parallel steps then total cost will
be Tp( P + TslogP)

17 th Oct,2006 19
RAM Model
 Two optimized algorithms for parametric searching
named as COLE’s optimization.
 One of these algorithms works under the CREW
PRAM model of parallel computation, and the
constants in the running time are small. However,
it does not meet the conditions for applying Cole’s
optimization.
 The other one works under the EREW PRAM
model; it is more complex than the first algorithm,
but Cole’s optimization can be applied to it.

17 th Oct,2006 20
How is it made practical?
 In practical, there are many applications of parametric
searching (specially in geometrical optimization
techniques), such as :
 spanning tree and scheduling problems studied by
Megiddo
 the slope-selection problem
 the Fr´echet-distance problem
 the bottleneck-distance problem
 the problem of the minimum Hausdorff distance
 the “median-of-lines”-problem
 problem of finding the minimum diameter of a
set of moving points

 Here, we will discuss, much briefly, the solution of the “mutual


visibility problem among spheres” using parametric searching

17 th Oct,2006 21
Mutually Visibility problem among Sphers

 Let S = {S1,S2,…, Sn) be a given set of n spheres in


RxRxR, all with the same radius. Let ci denotes the center
of Si, for i = 1,…., n. We say that two spheres Si and Sj are
mutually visible if the line segment connecting ci with cj
does not intersect any other sphere. We say that S is
completely mutually visible if every pair of spheres in S is
mutually visible.
 Our problem is: “Given a set P of n points in RxRxR,
we wish to determine the largest possible common radius r
such that the set of n spheres of radius r, centered at the
given points, is completely mutually visible."

17 th Oct,2006 22
 In order to employ the parametric searching technique,
we solve the following fixed-size decision problem:
“Given a set of n spheres with the same radius r,
determine if it is completely mutually visible".
We use the following simple scheme. For each of the
spheres Si, we compute the visibility map of all the other
spheres, as viewed from its center ci. We then check that
all the centers are visible from ci. This is true for each of
the n visibility maps, if and only if the set of spheres is
completely mutually visible.
 we will use the following interesting property :
Lemma : Let S be a collection of n congruent
(nonintersecting) spheres in 3-space, and let p be a point
outside the spheres. If the centers of all spheres are visible
from p then the complexity of the visibility map of the
spheres, as seen from p, is O(n).

17 th Oct,2006 23
 The idea is now to compute the visibility map of the
spheres from each center ci, using the output sensitive
hidden surface removal algorithm. The algorithm runs in
time O((n+k) log n), where k is the combinatorial
2

complexity of the visibility map.

 If the algorithm runs for too long, we stop it and


conclude, in view of the preceding lemma, that not all
centers are visible from ci. Otherwise the algorithm
terminates and then we check whether all centers are
indeed visible. This takes, over all visible maps, a total time
of O(n log n).
2 2

 Based on this sequential algorithm , we can develop a


parallel algorithm whose running time is O(log n) using
2

O(n log n + k) processors.

17 th Oct,2006 24
Why parametric searching?
It is a powerful and ingenious tool for solving
efficiently a variety of optimization problems

Many problems of this kind, which can be


easily attacked by the technique, are either solved
by more complicated and more ad-hoc techniques,
or are simply left unsolved.

17 th Oct,2006 25
Drawbacks
It requires the design of an efficient parallel
algorithm for the generic version of the decision
problem, which is not always easy

The algorithm is rather complex and the


constants hidden in the O-notation are very large

17 th Oct,2006 26
References
 P. K. Agarwal and M. Sharir : efficient algorithms for
geometric optimization. ACM Comput. Surv.,1998.

 N. Megiddo. : Combinatorial optimization with rational


objective functions. Math. Oper. Res.,1979.

 P.K. Agarwal, M. Sharir and S. Toledo : Applications of


parametric searching in geometric optimization,
manuscript, 1991.

17 th Oct,2006 27
17 th Oct,2006 28
17 th Oct,2006 29

Das könnte Ihnen auch gefallen