Given the Npoints on the map of edges Map<Point, List<Edge>>, we can get the polygons formed by these edges in O(N log N)?
I know that you need to go through all the vertices and get the edges containing that vertex as a starting point. These are the edges of the voronoi diagram, and each vertex has no more than 3 artists who contain it. Thus, on the map, the key is the top, and the value is a list where the top is the beginning of the node.
For example:
Points :a,b,c,d,e,f,g
Edges :[a,b]; [a,c]; [a,d], [b,c], [d,e], [e,g], [g,f]
My idea is to iterate over the map counterclockwise until I get the starting vertex. This is a polygon, then I put it on the list of polygons and keep looking for others. The problem is that I do not want to overcome the difficultyO(N log N)
Thanks!
source
share