Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Given centers, find minimum radius for set of circles such that they fully cover another

I have the following geometry problem: You are given a circle with the center in origin - C(0, 0), and radius 1. Inside the circle are given N points which represent the centers of N different circles. You are asked to find the minimum radius of the small circles (the radius of all the circles are equal) in order to cover all the boundary of the large circle.

The number of circles is: 3 ≤ N ≤ 10000 and the problem has to be solved with a precision of P decimals where 1 ≤ P ≤ 6.

For example:
N = 3 and P = 4

and the coordinates:
(0.193, 0.722)
(-0.158, -0.438)
(-0.068, 0.00)

The radius of the small circles is: 1.0686.

I have the following idea but my problem is implementing it. The idea consists of a binary search to find the radius and for each value given by the binary search to try and find all the intersection point between the small circles and the large one. Each intersection will have as result an arc. The next step is to 'project' the coordinates of the arcs on to the X axis and Y axis, the result being a number of intervals. If the reunions of the intervals from the X and the Y axis have as result the interval [-1, 1] on each axis, it means that all the circle is covered.

In order to avoid precision problems I thought of searching between 0 and 2×10P, and also taking the radius as 10P, thus eliminating the figures after the comma, but my problem is figuring out how to simulate the intersection of the circles and afterwards how to see if the reunion of the resulting intervals form the interval [-1, 1].

Any suggestions are welcomed!

like image 474
ZLMN Avatar asked Apr 30 '11 15:04

ZLMN


1 Answers

Each point in your set has to cover the the intersection of its cell in the point-set's voronoi diagram and the test-circle around the origin.

To find the radius, start by computing the voronoi diagram of your point set. Now "close" this voronoi diagram by intersecting all infinite edges with your target-circle. Then for each point in your set, check the distance to all the points of its "closed" voronoi cell. The maximum should be your solution.

It shouldn't matter that the cells get closed by an arc instead of a straight line by the test-circle until your solution radius gets greater than 1 (because then the "small" circles will arc stronger). In that case, you also have to check the furthest point from the cell center to that arc.

like image 112
ltjax Avatar answered Oct 22 '22 01:10

ltjax