convex hulls קְמוֹר

57
CONVEX HULLS ר ר רר ר ר אאא א' אאא אאאאא28.11.2011 1

Upload: mateja

Post on 07-Jan-2016

61 views

Category:

Documents


6 download

DESCRIPTION

CONVEX HULLS קְמוֹר. חלק א'. עדי אונגר 28.11.2011. נושאי השיעור. הגדרות בסיסיות THE INCREMENTAL ALGORITHM GIFT WRAPPING GRAHAM SCAN. הערות חשובות. בפרק זה נעסוק בקבוצות סופיות של נקודות. קבוצת נקודות אינה בהכרח סדורה. אזור קמוּר – convex region. - PowerPoint PPT Presentation

TRANSCRIPT

Convex hull

CONVEX HULLS ' 28.11.201111 THE INCREMENTAL ALGORITHMGIFT WRAPPINGGRAHAM SCAN2 . 3 .2 . .3 ( ) . , .3 convex region "" .:

4 convex region . . S, S. , ( -S ).4 convex hull S, .

: S . , S , S.5 . .5 - S., S.

S : conv(S)

6 . S. , .6

S S77 ?

.8 ?89 2 , .9 S .

, S .10 . -2 S . . .10 ""? S.

.

111112 a -0 -1 b -1 -0 . a -b.12 convex combination 13 " ", S . 3 .13 - 14 3 , p1 -p2. p3 .1415 . .15161617 -M conv(s) .

171819 -M ( ) -conv(S) n. n=1 . S -n S n . , ( n-1 ) -conv(S) -conv(S) -conv(S).

19202021212222THE INCREMENTAL ALGORITHM2323 ? : conv(S).

, conv(S).24 , .24 , .

, (x,y) .2525 - .

x( ) y ( ) .

.2626

2727 "" k , k+1 .

-x .2828 S S x. x, x.

S .

2929 tangent line P x P. L -P x : L x P L -P x.30

?3131 ?

32 LEFT-OF -RIGHT-OF33

0 c (a,b). " .33 S -x .3 . -S, . , S.34Sort the points of S according to their x-coordinate.The first three of these points determine a triangle, our starting hull.Consider the next point in the ordered set S, add it to the hull, and remove the enclosed non-hull points.Continue this process of adding one point of S at a time until all of S has been processed.

34

3535 3636 ?

. . .37 S -S. .38 S , -a,b .

39 :

x

40GIFT WRAPPING41 . -Gift Wrapping - ' -1970 ( )

41 S, .

4242 . . -S, x. , .

4343 . X. , .44Start with a known point on the hull as an anchor, such as the bottommost point.Comparing angles to all the other points from this anchor, choose the point with the largest angle.Repeat this process, moving around the hull, analogous to the process of winding a string around the point set.

44

4545 4646 47. x . .47 LEFT-OF, RIGHT-OF 48 a b c . b . b.4849 n O(3n)=O(n).49GRAHAM SCAN50 1960 10,000 . -o(n^2) , . 1972 .

50 S, ., .5151 S, (, ). -x ., .5252 - -ab c - . " abc. " " b , b . " " c .

5353

5454 . S x. . .55 S -O(nlogn). " ". ! -O(n) .

" O(nlogn).56565757