an arrangement of lines: a(h) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5
TRANSCRIPT
![Page 1: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/1.jpg)
An arrangement of lines: A(H)
112
3
4
5
1
55 5
11
1
1111111111 3455
11111
11
12
3
4
5
![Page 2: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/2.jpg)
Elements of the arrangement
Vertices – intersection of lines
Edges – portions of lines bounded by vertices, except when unbounded at one end
Faces – regions bounded by edges and vertices
![Page 3: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/3.jpg)
Counts of the elements
Number of vertices (V) : n(n-1)/2
Number of edges (E): n^2 (interesting)
Number of faces (F): n^2 – n(n-1)/2 + 1 (follows from the modified Euler formula V-E+F = 1)
![Page 4: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/4.jpg)
Computing an arrangement
We must output a data structure that encapsulates the mutual relationships of the elements (vertices, edges and faces), corresponding to the pictorial representation of an A(H) as in the first slide
EG paper only shows how to traverse A(H)
![Page 5: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/5.jpg)
Sweepline paradigm
The standard sweepline paradigm requires sorting the O(n^2) intersection points
This would require O(n^2 log n) time
![Page 6: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/6.jpg)
Topological sweep
Gets rid of the log n factor, by processing the intersection points without having to sort them !!
It does this at the expense of just O(n) additional space needed by lots of extra book-keeping.
![Page 7: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/7.jpg)
A partial order
We can define the following partial order on elements of the arrangement
An element A is above element B if A is above B at every vertical line that intersects both A and B
The above relationship is acyclic The inverse of above is below
![Page 8: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/8.jpg)
Consequences
There exists a unique element in A(H) that is not below any other and a unique element that is not above any other.
These are called respectively the top-most and the bottom-most element
Prove uniqueness from the acyclicity of the above partial order
![Page 9: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/9.jpg)
Cuts
A cut is a sequence of edges (c1, c
2, ...,c
n),
one from each line of A(H), such that for each i (1.. n-1) there is a (unique) face f
i such that c
i
is above fi , and c
(i+1) is below f
i
c1 is below the top-most face and c
n is above
the bottom-most face
![Page 10: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/10.jpg)
A cut – pictorially
c1c2
c3
c4
c5
![Page 11: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/11.jpg)
Ordering the cuts
A cut C is is to the left of a cut C' if for each line l in A(H), c
i on l from C is to the left of or
identical with cj from C' on l
Thus there is a lefmost cut and a rightmost one
![Page 12: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/12.jpg)
Important Fact
In a given cut there exists an i such that ci
and c(i+1)
have a common right end-point The so-called topological sweep exploits this
to move from the leftmost cut to the rightmost one in a series of elementary moves
In each such move, the topological line moves across such a common right end-point
We demonstrate this on the example arrangement in the next few slides
![Page 13: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/13.jpg)
Sweeping the arrangement
The leftmost cut
![Page 14: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/14.jpg)
Sweeping A(H) : 1st elementary move
![Page 15: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/15.jpg)
2nd elementary move
![Page 16: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/16.jpg)
3rd elementary move
![Page 17: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/17.jpg)
4th elementary move
![Page 18: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/18.jpg)
5th elementary move
![Page 19: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/19.jpg)
6th elementary move
![Page 20: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/20.jpg)
7th elementary move
![Page 21: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/21.jpg)
8th elementary move
![Page 22: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/22.jpg)
9th elementary move
![Page 23: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/23.jpg)
10th elementary move
The rightmost cut
![Page 24: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/24.jpg)
Representing a cut
A cut is represented by an array C[1..n], where each C[i] = ( λi, ρi , µi), representing respectively the index of the line that defines the left and right end-point of the edge c i and the index of the line on which it lies
![Page 25: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/25.jpg)
From one cut to the next..
This is done in an elementary step An elementary step is one in which the
topological sweep moves across an intersection defined by c
i and c
(i+1) for some i in
the current cut Such an i always exists except when the cut is
the rightmost one
![Page 26: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/26.jpg)
Implementing an elementary move
An elementary move is implemented with the help of two data structures derived from a cut C – namely the upper horizon tree T+(C) and the lower horizon tree T-(C)
![Page 27: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/27.jpg)
Upper horizon tree
![Page 28: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/28.jpg)
Lower horizon tree
![Page 29: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/29.jpg)
Initializing the horizon trees
![Page 30: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/30.jpg)
Data Structures for horizon trees
An array HTU[1..n] for the upper horizon tree, where HTL[i] = (λi, µi), where λi (µi ) is the index of the line that defines the left (right) end point of the segment from li that belongs to the upper horizon tree
λi = -1 if segment left-unbounded and µi = 0 if right-unbounded
A similar definition for HTL[1..n]
![Page 31: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/31.jpg)
Initializing HTU (and HTL similarly)
![Page 32: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/32.jpg)
Updating HTU (and similarly HTL)
![Page 33: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/33.jpg)
Example HTU[1..5]
HTU[1]= (-1,2)HTU[2]= (-1,5)HTU[3]= (5,4)HTU[4]= (5,0)HTU[5]= (3,0)
![Page 34: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/34.jpg)
Example HTL[1..5]
HTL[1]= (-1,0)HTL[2]= (-1,1)HTL[3]= (5,1)HTL[4]= (5,3)HTL[5]= (3,1)
![Page 35: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/35.jpg)
Data Structures for horizon trees
Array M[1..n] stores the index of the line on which ci lies
Array N[1..n] stores the description of a cut; N[i] = (λi, µi), where λi (µi ) is the index of the line that defines the left-end (right-end) of ci
N[1..n] can be obtained from HTL[1..n], HTU[1..n] and M[1..n]
![Page 36: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/36.jpg)
Example N[1..5]
M[1..5] = [1,2, 5, 3, 4] (slide 32) This gives: N[1..5] = [(-1,2), (-1,1), (3,1),
(5,4),(5,3)]
![Page 37: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/37.jpg)
Data Structures for horizon trees
Finally, we have a stack I that stores the indices i such that ci and c(i+1) have a common right end-point.
This is obtained from N[1..n] by examining pairs of entries in N[1..n] and checking if µi =
µi+1 + 1, for i= 1, .., n-1, and stacking the i for which the above holds
![Page 38: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/38.jpg)
Example I
I=[1,4 …….., for the example N[1..5]
![Page 39: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/39.jpg)
Updating HTU (and similarly HTL)
![Page 40: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/40.jpg)
Updating all the other data structures
It is easy to update M[1..n] N[i] = HTL[M[i]] ∩ HTU[M[i]] From N[i] we can update the stack I
![Page 41: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/41.jpg)
Analysis
The analysis shows that the cost of traversing the bays associated with a fixed line l is O(n) and hence O(n2) for all n lines.
![Page 42: An arrangement of lines: A(H) 1 1 2 3 4 5 1 5 5 5 1 1 1 11111111113455 11 11 1 11 1 2 3 4 5](https://reader030.vdocuments.mx/reader030/viewer/2022032606/56649eb05503460f94bb5bbd/html5/thumbnails/42.jpg)
Amortized Analysis