Geometric Matching under Noise: Combinatorial ... - Semantic Scholar

25 downloads 0 Views 314KB Size Report
reduce geometric pattern matching to combinatorial pattern matching. ... Graduate Fellowship and NSF Award CCR-9357849, with matching funds from IBM,.
Geometric Matching under Noise: Combinatorial Bounds and Algorithms Piotr Indyk

Rajeev Motwaniy

Suresh Venkatasubramanianz

Department of Computer Science Stanford University Stanford, CA 94305 findyk,rajeev,[email protected]

Abstract

In geometric pattern matching, we are given two sets of points P and Q in d dimensions, and the problem is to determine the rigid transformation that brings P closest to Q, under some distance measure. More generally, each point can be modelled as a ball of small radius, and we may wish to nd a transformation approximating the closest distance between P and Q. This problem has many applications in domains such as computer vision and computational chemistry In this paper we present improved algorithms for this problem, by allowing the running time of our algorithms to depend not only on n, (the number of points in the sets), but also on , the diameter of the point set. The dependence on  also allows us to e ectively process point sets that occur in practice, where diameters tend to be small ([EVW94]). Our algorithms are also simple to implement, in contrast to much of the earlier work. To obtain the above-mentioned results, we introduce a novel discretization technique to reduce geometric pattern matching to combinatorial pattern matching. In addition, we address various generalizations of the classical problem rst posed by Erdos: \Given a set of n points in the plane, how many pairs of points can be exactly a unit distance apart?". The combinatorial bounds we prove enable us to obtain improved results for geometric pattern matching and may have other applications.

1 Introduction Geometric point set matching in two and three dimensions is a well-studied family of problems with application to areas such as computer vision [MNL98], pattern recognition [CGH+ 93, HKK92] and computational chemistry [FHK+ 96, FKL+ 97, NFWN94]. Given some choice of a space G of transformations and a distance measure d(P; Q) for two point sets P and Q in d-dimensional Euclidean space, we can formulate the basic problem as follows: Determine the transformation T 2 G that brings P closest to Q, i.e that minimises d(T(P); Q). More formally, Problem 1.1 (Pattern Matching (PM)) Given  > 0, and point sets P and Q, where jP j = k and jQj = n with k  n, nd a transformation T 2 G for which d(T(P); Q)  . A generalized version of this where we require only that a portion of P is near some portion of Q, is:  Supported by a Stanford Graduate Fellowship and NSF Award CCR-9357849, with matching funds from IBM, Mitsubishi, Schlumberger Foundation, Shell Foundation, and Xerox Corporation. y Supported by an Alfred P. Sloan Research Fellowship, an IBM Faculty Partnership Award, an ARO MURI Grant DAAH04-96-1-0007, and NSF Young Investigator Award CCR-9357849, with matching funds from IBM, Mitsubishi, Schlumberger Foundation, Shell Foundation, and Xerox Corporation. z Supported in part by a grant from P zer Central Research.

1

2

Problem 1.2 (Largest Common Point-set (LCP)) Given  > 0, K > 0, and point sets P and Q of size k and n, nd a transformation T 2 G and a set P 0  P of size jP 0j  K such that jd(T(P 0); Q)j  . In this paper, we will restrict ourselves to point sets in 0, and a set of n points in the plane with minimum distance   at least 1, the number of pairs (i; j) such that d(pi ; pj ) lies in the range [t; t + 1] is at most n2=4 , provided n is suciently large. They also show that this bound is tight for suciently large t. However, this requires t = (n2 ).

Related problems were considered by Valtr [Val96] who investigated bounds on the number of approximate incidences between familiespof well-separated lines and points; assuming that the point sets are dense, i.e., their diameter is O( n), he showed that several key results developed for the exact incidence model have counterparts in the approximate setting. In the sequel we use B(p; r) to denote a 2 or 3-dimensional ball of radius r centered at p. We also use R(p; r1; r2) to denote a 2 or 3-dimensional annulus B(p; r2) ? B(p; r1). For a point p, let Nt(p) = P \ R(p; t; t + ). We denote a set of points as  -separated if the minimum inter-point distance in this set is .

3.1 Noisy Distances in Two Dimensions

We extend and generalize the bound given by [EMPS91], obtaining the following result: Theorem 3.2 Given  > 1; t > 1, and a set of n 1-separated points in the plane, the number of pairs (i; j) such that d(pi; pj ) lies in the range [t; t + ] is O((n4t)1=3 ). The following facts are well-known. However, in the absence of a reference, we supply proofs in appendix A. Fact 3.1 For any n, there exists a set of n 1p-separated points in the plane such that the number of distance pairs in the interval [t; t + 1] is (n t).

Fact 3.2 Given ; l > 1 and two points p and q in the plane such that d(p; q) = d and 1  d < 2l, 2 the number of 1-separated p points whose distance from p and q lies in the interval [l; l +] is O( l=d) 2 when d  l, and O( l=(2l ? d)) when l < d  2l. Our main lemma bounds the number of distance intervals induced by a single point.

Lemma 3.1 Let P be a 1-separated set of points in the plane. Given  > 1 and t, there exists a point p 2 P such that Nt (p) = O((nt)1=3 log n). Proof : Let f be a parameter such that for all points p 2 P, Nt(p)  f. We show that f = O((nt)1=3 log n). Take any point p 2 P. As jNt(p)j  f, there must be a segment Sp of R(p; t; t+) subtending an angle =3 such that jSp \ P j = u  f=6. Let q1; q2; : : :; qu be the members of Sp ,

ordered in clockwise fashion around p. Notice that the distance between any pair qi and qj is at most t. Partition this sequence into subsequences S1 ; S2 ; : : :; Sk of size l. Let q10 ; q20 ; : : :; qk0 be the subsequence formed by taking the rst member of each Si , for 1  i  k, and let Ni = Nt(qi0 ). Note that (1) lk  f By Fact 3.2, two points at distance l  t can have at most O(2t=l) common neighbors in the distance range [t; t + ]. We can approximate arc lengths of a circle by a straight line with only a

5 constant factor error, which implies that for some c and for 1  j < i  k, jNj \ Ni j  c3t=(l(i ? j)). Now, i?1 i?1 3 3 3 X X jNj \ Ni j  c (i ? tj)l = c  l t Hi  c  t logn l

j =1 j =1 th where Hi is the i harmonic number. Note that i  n. The total contribution of [j 1 such that l = O(n2 )p, there exists a point set P and a triangle  with the largest side length l such that HP1 () = (n2 l).

4 Alignment-based Schemes We present alignment-based schemes for PM and LCP that utilize the combinatorial bounds of the previous section. Let p1; p2; q1; q2 be any points. Then for any  > 0, we de ne T (p1 ; p2; q1; q2) = fT jdH (fT(p1 ); T(p2)g; fq1; q2g)  g S (p1 ; p2; q1; q2) = f(T(p1 ); T(p2))jT 2 T (p1; p2; q1; q2)g Both T and S are in nite subsets of the transformation space. The following proposition (in the spirit of [HS94]) shows that this space can be approximated by a small set of transformations.

6

Proposition 4.1 For any S = S (p1 ; p2; q1; q2) and > 0, there exists S   S of cardinality O(1= 3 ) such that for any (s1 ; s2) 2 S , there exists (s1 ; s2 ) 2 S  with dH (fs1 ; s2g; fs1 ; s2 g)  .

 (p1 ; p2; q1; q2). Such a set S  is denoted by S ;

Let d = dH , and let = =4. The algorithm is as follows: Algorithm 2D Alignment: 1. Compute a diameter pair p1; p2 of P. 2. Find the set A of all pairs (q1 ; q2) of points in Q such that kp1 ? p2 k ? 2  kq1 ? q2 k  kp1 ? p2k + 2.  (p1 ; p2; q1; q2)g. 3. Construct T = [(q1 ;q2 )2A fT0 (p1; p2; s1 ; s2)j(s1 ; s2 ) 2 S ; 4. Search for T  2 T such that dH (T  (P); Q)  (1 + 3 ). Lemma 4.1 Algorithm 2D Alignment is a -approximation algorithm for PM. Proof : Assume that there exists a transformation T such that dH (T(P); Q)  . Let p1; p2 be the diameter points found by the algorithm. Let s1 = T(p1 ) and s2 = T(p2) and let q1 ; q2 2 Q be points  (p1 ; p2; q1; q2) we know that there such that d(si ; qi)   for i = 1; 2. By the de nition of S  = S ;       exists (s1 ; s2 ) 2 S such that dH (fs1 ; s2 g; fq1; q2g)  . Let T be the transformation which maps (p1 ; p2) to (q1; q2). Consider any point p 2 P. We need to estimate d(T(p); T (p)). We represent T  as R  I  T, where I is a translation which moves s1 to s1 , and R is a rotation centered at s1 which moves I(s2 ) to s2 . Then d(T(p); T  (p))  d(T(p); (I  T)(p)) + d((I  T)(p); (R  I  T)(p))  d(s1; I(s1 )) + d(I(s2 ); s2 )  d(s1; s1 ) + (d(I(s2 ); s2 ) + d(s2 ; s2 ))  3   :  Therefore d(T (p); Q)  d(T(p); Q) + d(T(p); T  (p))   +  = (1 + ), thus T  gives the desired approximate mapping. It is straightforward to check that our algorithm nds such T  . Lemma 4.2 Algorithm 2D Alignment can be implemented to run in time !!  2 4=31=3 log n; n2) min(n  O k  min ; logn 3 for any   1 and  1, where  is the diameter of P . For  < 1 the running time is as for  = 1; similarly for > 1. Proof : Consider the complexity of each step of the algorithm: Step 1: Can be performed in time O(n logn) using the standard algorithm [PS85] Step 2: Let r = d(p1; p2). We need to nd A = [q12Q f(q1; q2)jq2 2 Q \ R(q1; r ? 2; 4)g. If   n2 then we employ the following bucketing pscheme. Let G denote applanar grid consisting of rectangular cells of width 4 and height r. For each i = 0; : : :; r we de ne Gi to be the grid G rotated by an angle 2ipr . Notice, that for any point q the ring R(q; r ? 2; 4) can be covered by O(pr) grid cells from G0 ; : : :; Gr (this can be proved similarly to Fact 3.2). During the preprocessing for all G0; : : :; Gpr and all q 2 Q we store q at the grid cell of all Gi containing q (usingphashing). Then, in order to compute Q \ R(q; r ? 2; 4) we retrieve the contents of the O( r) buckets covering R(q; r ? 2; 4). The total complexity of this step can be bounded by the total number of the points retrieved (which is O(min(np4=3 1=3 log n; n2)) by Theorem 3.2) plus the total number ofp buckets accessed (which is O(n )) plus the cost of the preprocessing (which is again O(n )). If  > n2, then we can compute A by computing all n2 pairwise distances in time p O(n2). 2 4 = 3 1 = 3 Therefore, Step 2 can be implemented to run in O(min(n ; n  log n + n )) time, which is O(min(n2 ; n4=31=3 log n)).

7

Steps 3/4: In these steps, we perform at most O(min(n4=31=3 logn; n2)= 3) computations of dH (T(P); Q). Each computation requires k comparisons of dH (T(p); Q) to (1+3 ). It is easy to perform this comparison in O(logn) using a Voronoi diagram. One can however achieve constant time per query as follows. Impose a uniform grid of side . For each q 2 Q we store it in all grid cells intersecting B(q; (1 + 3 )). This takes O(n= 2 ) time which is subsumed by the complexity of searching T . In order to verify if dH (p; Q)  (1 + ), it is sucient if the grid containing p contains any q.

We can prove similar bounds for the case of PM/LCP in three dimensions, using our results from Section 3.2. We present the result here, deferring the details to an extended version of the paper.

Theorem 4.2p ?approximate PM in three dimensions can be solved, for all  > 1;  1, in time  3  2 : 25 2 : 5 O(k max(n ; n )  = 6 ).

5 Concentric Pattern Matching The subset matching problem is an important problem in combinatorial pattern matching and is de ned as follows: Subset Matching: Let  be a nite alphabet. Given a text string t[0; : : :; n ? 1] and a pattern string p[0; : : :; m ? 1] such that for all i and j, t[i]; p[j]  , return a binary array o[0; : : :; n ? 1] such that o[i] = 1 if and only if p[j]  t[i + j mod n] for all j 2 f0; : : :; m ? 1g. Recent work of Cole and Hariharan [CH97] showed that this problem can be solved in (randomized) O(n log3 m) time. Cole, Hariharan, and Indyk [CHI99] have shown that the above algorithm can be derandomized to run in O(n log3 m) time. We present Algorithm 2D Concentric Pattern Matching which solves the approximate noisy pattern matching problem in almost-quadratic time by reducing it to multiple instances of the subset matching problem. The basic idea of the algorithm is as follows. From earlier remarks we can assume that the rigid transformation to be computed can be expressed as a composition of a translation and a rotation. 1. Choose an arbitrary point p in P and translate it to all points in B(q; ), for all q 2 Q. Using the same technique as in Section 4, we can replace this in nite space of translations by a discrete set. 2. For each such alignment, subdivide the plane into concentric rings around p, of increasing radius. Each ring will yield one instance of a subset matching problem. 3. Further subdivide each ring concentrically and radially into cells of xed size. Since the point set is 1-separated, this implies that each cell contains at most one point, for appropriate choice of constants. 4. For any ring, all the cells at a xed distance from the center have the same identi er. Construct a text string made up of identi ers of cells that contain points of Q, where each position in the string corresponds to the set of all such cells that lie along the same radial line. Similarly construct a pattern string using points of P. Each match of text and pattern corresponds to a rotational shift of the corresponding ring. It is now easy to see that there exists a rotation matching P approximately into Q if there exists a single rotational shift that corresponds to a pattern match for each ring. We now present the algorithm in more detail. (1) Choose an arbitrary point (say p) from P. For each q 2 Q align p to a set of O(1= 2) points spaced uniformly inside the disk of radius  centered at q; this is done similarly as in Algorithm 2d Alignment. For each such translation T, move the points P according to T; for simplicity we still refer to T(P) as P.

8

p

γ

ε 2 i ε 2 i+1

Figure 2: The grid decomposition

(2) In the next step, split the plane into l = O(log) concentric rings R1; : : :; Rl centered at p (see Figure 2); note that R1 is a full disk. The inner radius of the i-th ring (for i  2) is equal to 2i?1, the outer radius (for i  1) is ri = 2i. For each ring Ri , let Ii be the (in nite) set of rotations which brings P \ Ri within Hausdor distance  of Q \ (Ri?1 [ Ri [ Ri+1). Clearly, P is within Hausdor distance  of Q under rotation i I1 \ : : : \ Il 6= ;; this follows from the fact that a disk of radius  intersects at most two rings. Therefore it is sucient to compute the sets I1 ; : : :; Il and nd their intersection. Each Ii can be represented as a nite union of intervals. In order to solve the approximate matching problem, we approximate the Ii as follows: the endpoints of the intervals in each Ii restricted to multiples of i = =2i , for > 0 speci ed later. Denote the approximate intervals by I~i . Include an interval [j i ; (j + 1) i] in I~i if Ii \ [j i ; (j + 1) i] 6= ;; we call such an interval important. Notice that rotation of P \ Ri by angle i changes the position of each point in P \ Ri by at most 2i i = . Therefore, we can ensure that all important intervals are contained in I~i by including all intervals [j i; (j +1) i] such that rotating Pi = P \ Ri by both angles j i and (j +1) i results in a set which is within Hausdor distance  + from Qi = Q \ (Ri?1 [ Ri [ Ri+1 ). This admits some false matches, but as we explain below, the error they induce is bounded. (3) To nd all such intervals, check for each angle j i if Pi0  Si, where the set Pi0 is obtained by rotating Pi by j i and Si = [q 2Qi B(q0 ;  + ). Partition each Ri into 2= i sectors, the sectors being partitioned further by 2i = uniformly placed concentric circles (Figure 2). We denote the set of grid cells obtained from the ring Ri by Gi ; the union of all Gi 's (i.e., the whole partition) is denoted by G. For any point x, let G(x) be the cell of G to which x belongs (ties are broken arbitrarily); the function G can be extended p to sets of points in a natural way. Each grid cell has diameter c , for c > 0 with value near 2. (4) Now, for each angle j i , check if G(Pi0)  G(Si ) for the set Pi0 obtained by rotating Pi by an angle j i . This condition clearly implies that Pi0  Si ; although it also introduces false matches, the error can be bounded as claimed. Notice however, that rotation of Pi by i results in \shifting" the set G(Pi) by one position in Gi . Therefore, it is sucient to check (for all shifts) if the shifted set G(Pi) belongs to G(Si ). This can be done using the subset matching algorithm as follows. De ne a signature of a grid cell to be its distance to the origin point p; note that all grids from one sector of a ring Ri have di erent signatures, while the signatures of cells from di erent sectors can be equal. De ne the pattern p to be a sequence of sets p[0]; p[1]; ::: such that each set p[j] contains signatures of grid cells from G(Pi) belonging to the jth sector of Ri (the rst sector is chosen arbitrarily). The text t is constructed analogously to G(Si ). It is easy to check that the subset matching algorithm 0

9 nds the desired shift. By the above discussion it follows that whenever there is an angle  such that rotating P by  results in a set P 0 within distance  to Q, the intersection I~1 : : : I~l will be non-empty. On the other hand, we know that for any q0 2 Q the distance from q0 to any point in G(B(q0 ;  + )) is at most  + (1 + c) . Therefore, a false match rotation occurs only if it brings P with distance  + (1 + c) to Q; for sucient , this distance can be made less than . This scheme constructs l = log  instances of the subset matching problem. Each instance is drawn from an alphabet of size O(= ). The pattern (and text) lengths are O(2i = ) = O(= ). From this, and the above algorithm, we obtain the following theorem: Theorem 5.1 2D Concentric Pattern Matching is a -approximation algorithm for the PM problem,  + n2 ) log3 n  log) time, for any  1. for suitable = ( ) . It can be implemented in O(n(  For > 1 the running time is as for = 1.

6 Other Results In this section we brie y describe the other results presented in Tables 1 and 2. Consider rst the two-dimensional case. The bounds for pattern matching under the Hausdor measure follow from the previous section. The algorithm for pattern matching under the bottleneck measure is obtained via alignment; the k1:5 factor is the time needed for match veri cation of a transformation T obtained from alignment [EI96]. In order to solve LCP we employ a voting scheme similar to the Hough transform [Bal81]. First, we discretize the rotation space, obtaining O() di erent angles. Then, for each angle we enumerate all pairs p 2 P and q 2 Q. Each such pair \votes" for a translation moving p to q. At the end we count the number of votes for each (rotation,translation) pair and output all pairs with more than K votes. For the bottleneck measure, we again employ the bipartite matching algorithm. In three dimensions, the bounds are obtained in a similar way. The only di erence is that we have additional freedom in designing algorithms for PM under the Hausdor measure. Let p1; p2 2 P. We can either align p1 to all q 2 Q, enumerate one of the angular coordinates, and apply twodimensional subset matching; or align p1 ; p2 to all pairs q1 ; q2 2 Q and apply 1-dimensional subset matching; or align all matching triangles. The corresponding bounds follow.

Sum Measures. We brie y describe how to extend our PM and LCP results to the -Hausdor

measure; again, the -bottleneck measure can be computed using the bipartite matching algorithm. Consider any transformation T. Suppose that for any  we know the number f() of points from T(P) which are within distance  of Q. Assume for simplicity that all distances from p 2 P to Q are distinct. De ne f ?1 (i) to be the \inverse" of f, i.e., the function which when given a number i 2 f0; : : :; ng returns the smallest  such that f() = i. Then it is easy to see that the Pk -Hausdor distance between T(P) and Q is equal to i=1 f ?1 (i). Similarly, we can compute an approximation of that distance if we know an approximation of f, i.e., a function f~ such that ~ 2 ff(); : : :; f((1+ )) g, for some > 0. Such an approximation can be obtained by solving a f() logarithmic number of instances of approximate LCP between T(P) and Q under Hausdor measure for  = 1; (1 + ); (1 + )2 ; : : :;  and = (). Thus, we can obtain an approximation of the Hausdor for a xed transformation T. However, our Hough-transform-based algorithm computes the LCP for the whole (properly discretized) space of transformations. Therefore we can choose the one which minimizes the distance value, obtaining an approximate solution for PM under Hausdor measure. An algorithm for LCP under the same measure can be similarly obtained. The technique of using the values of \max-measures" to approximate the values of sum measures turns out to be useful in a di erent context. Consider the following weighted k-mismatches problem posed by Muthukrishnan [Mut95]): given a text t = t[1 : : :n] and a pattern p = p[1 : : :m] over an alphabet ), a P real parameter , and a weight function f :    ! d(R; R ) > r 0

14 Since (R; R0) is unimodal with a minimum at d(R; R0) = r, we maximize (R) by locating R0 maximally (with respect to ) around R. 0 Let R1 = fR0 2 Rp jd(R; R0) P rgandR2 = fR0 2 Rp jr  d(R; PR ) < 2rg, and then (R) = 1 (R) + 2 (R) where 1(R) = R 2R1 (R; R0) and 2 (R) = R 2R2 (R; R0). Note that if d(R; R0) > 2r, then R and R0 do not intersect. Let  = maxR 2R1 d(R; R0); similarly, let  = maxR 2R2 2r ? d(R; R0). Lemma B.2  = O(min(r; pn= )) and  = O(2 =r). Proof : Clearly,   r. All tori centers arep 1= ?separated, hence the number of tori R 2 R1 is O(2 2). But jR1j  n, implying that   n= . Similarly,   r. The area of the torus of inner radius 2r ?  and outer radius 2r is O(r). As before, since tori centers are 1= ?separated, this implies that jR2 j = O(r 2)  n which yields  = O(n=r 2). Consider any interval I = [i; i + 1]. All the tori centers are separated by 1= , therefore jfR0jd(R; R0) 2 I gj is O(i 2 ). Using this, and substituting for (R; R0) we can write: 0

0

0

0

1 (R)  2(R) 

 X i=1

2X r?1

i 2 min(3r=i; f);

i 2 min(f; 3

i=2r? 2 2 O( f ) r > f=3 Lemma B.3 (R) = O( 2 r3) r  f=3 Proof : Case 1 [r  f=3 ].

r



1 (R)  2 (R)  Let j = r ? i=2.

 X

r r ? i=2 ):

2r3 = 2r3

i=1 2X r?1

r i 23 r ?ri=2 i=2r?

=2 pr 2 3 X rp? j 2 (R)  2  j j =1=2 =2 X

 2r3=2 23

p

1= j

j =1=2 Z =2

= O(r3=2 2 3

pdjj )

p1=2 3 = 2 2 3 = O(r  ) p = O( 23 r r) = O( 2r3 ) from Lemma B.2 Case 2 [f=3  r > f=3]. Let = 3r=f. From above, we know that 1 <  . 1 (R) 

X

2if +

 X

2 3 r

i= 2 2  [ f=2 + 3(r ? r)]  2 3(r ? r=2) since f = 3r. = O( 2 r3) as   i=1

15 Applying the change of variable j = r ? i=2 as above, we obtain

Let = 6r=f 2 . We get

r =2 X 3 2 2 (R)  2 (r ? j) min(f;  rj ) j =1 r =2 X  2 r min(f; 3 rj ) j =1

2 (R)  2 r[ f + 3

=2 r X r j =

= O( 2 r[ f + 3

Z

j]

=2 r r

j dj]) = O( 2 r[ f +  ( r ? p r)]) = O( 2 r( f + 23( ? p r))) from Lemma B.2 = O( 2 r3) as f = 3p r Case 3 [f=3  q r]. Since f=3  r; min(f; 3r=i) = f 8i  . Hence, 1 (R) = O( 2f2 ). In 3 addition, min(f;  jr ) = f 8j  2 =r = (). Therefore, 2(R) = O( 2f2 ). Putting it all together: (R) is the total number of points that torus R can share with all other tori. Assume that k such tori suce to ensure that all tori contain f points each. This implies that k maxR2R (R)  f n by the Pigeon-hole Principle. In addition, we know that kf  n, since each torus has f points in it. These two inequalities give us an upperpbound on f. p Case 1 [r > cl= ]. (R) p = O(lp n3). Therefore, we have kl nn3=n  f and kf  n. The two inequalities yield f  l3 n. This yields I(Rp ; P) = nf = O(n1:25l0:5 3, which gives H  () = O(n2:25l0:5 4) Case 2 [r  cl= ]. There are two sub-cases to consider: p Sub-case 1 [f=3  r]. f  k3 2r=n, and f  n=k. Combining these yields f  r3 . Sub-case 2 [f=3 < r]. As before, the calculation yields f  22. This yields p f=3  r ) f  r3 f=3 < r ) f  22 pn= ) from Lemma B.2. where  = min(r; p (a). r  n= ;  = r In this case, the twopconditions collapse to f  r3=2  pn3=2. p (b) r > n= ;  = n= Let y = r3. Substituting  = pn= in the above conditions, and replacing r3 by y, we obtain

3p

q p p f  y= n ) f  y n; p f < y= n ) f  n: p p p 3=2 For y  n3=2, we have y=pn  ypn  n. For y  y n  y=pn. p np we have n  3 Therefore, from the above conditions p p we obtain f = min( y n; n). Since r  cl= ; y = O(l ) which implies that f = O(min( l3 n; n)).

Thus, we obtain H  () = O(min(max(n2:25l0:5 ; n2:5)5=2; n3)).

Suggest Documents