HiveBrain v1.2.0
Get Started
← Back to all entries
snippetModerate

Circles covering a rectangular, how to verify it?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
verifycirclesrectangularcoveringhow

Problem

This may be basic to some of you, but excuse my inexperience with comp. geometry:

Given a set of $n$ circles with centers $(x_i, y_i)$ for $1 \leq i \leq n$ and each having radii $r$. Also given a rectangle. All objects are on a plane. How to verify that every point inside the rectangle (including its edges) is fully covered by the circles. That is, each point in the rectangle lay on at least one of the circles.

Anyone have hints ? I am currently trying with voronoi diagrams.

Solution

Create a Voronoi diagram on the $n$ disk centers in $O(n\log n)$ time. Intersect it with the rectangle in $O(n)$ time.

Now you have a set of convex shapes, thus the furthest point away from the center of the disk inside the cell is a vertex on the cell. Compute the furthest point for each cell can be done in $O(n)$ time. If for all of them, it is within $r$, then the set of disks covers the rectangle.

A $O(n \log n)$ algorithm.

Context

StackExchange Computer Science Q#11163, answer score: 10

Revisions (0)

No revisions yet.