Beruflich Dokumente
Kultur Dokumente
Presented by
Indranil Nandy
Guided by
Prof. Arijit Bishnu
1
Linear Search
Binary Search
Hashing
.
.
.
Parametric Search
-what it is
2
Parametric Search
3
What is Parametric
Search?
Parametric search can be defined as follows :
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
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 :
17 th Oct,2006 12
f(x) Newton’s Approximation
Roots of f(x)
As As As As
sign of
f(x) at
17 th Oct,2006 X=t* 13
What is the running time of AG ? S
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
17 th Oct,2006 16
Actually to speed up the execution, our algorithm
AG is replaced with the parallel version Ap
S
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
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
17 th Oct,2006 21
Mutually Visibility problem among Sphers
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
17 th Oct,2006 24
Why parametric searching?
It is a powerful and ingenious tool for solving
efficiently a variety of optimization problems
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
17 th Oct,2006 26
References
P. K. Agarwal and M. Sharir : efficient algorithms for
geometric optimization. ACM Comput. Surv.,1998.
17 th Oct,2006 27
17 th Oct,2006 28
17 th Oct,2006 29