## Finding the union of N random circles arbitrarily (or conspiratorially) placed on a two-dimensional surface

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

Please consider a two-dimensional surface populated with a set of Cartesian coordinates $(x_i, y_i)$ for $N$ circles with individual radii $r_i$, where $r_{min} < r_i < r_{max}$.

Here, the number of circles, $N$, may be large - ranging from hundreds to tens of thousands. The circles may sparsely populate the plane in some places, and in others, be 'conspiratorially' packed together. Furthermore, $r_{min}$ / $r_{max}$ are not necessary defined in such a way to allow for accurate convex hull, spline interpolation, etc.

While we can always perform a monte carlo sampling of coordinates on the plane (or over some defined lattice), is there an efficient deterministic method of calculating the exact area given by the union of all $N$ circles?

Update - After a more extensive literature search (and thanks to "jc" for mentioning Edelsbrunner!), I was able to find a few relevant papers in the literature. First, the problem was of finding the union of 'N' discs was first proposed by M. I. Shamos in his 1978 thesis:

Shamos, M. I. “Computational Geometry” Ph.D. thesis, Yale Univ., New Haven, CT 1978.

In 1985 Micha Sharir presented an O(n $log^2n$) time and O(n) space deterministic algorithm for the disc intersection/union problem (based on modified Voronoi diagrams): Sharir, M. Intersection and closest-pair problems for a set of planar discs. SIAM .J Comput. 14 (1985), pp. 448-468.

In 1988, Franz Aurenhammer presented another, more efficient O(n log n) time and O(n) space algorithm for circle (disc) intersection/union using power diagrams (generalizations of Voronoi diagrams): Aurenhammer, F. Improved algorithms for discs and balls using power diagrams. Journal of Algorithms 9 (1985), pp. 151-161.

It would be really neat if anyone could be point me to an implementation of one of the two determistic algorithms above, perhaps in a computational geometry package (neither appear trivial to put into practice)...

-

## 5 Answers

CGAL has a general voronoi diagram module that's quite customizable. While I've never used it to build power diagrams, it should not be hard to add in the right kind of distance function to generate the diagrams you need:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Voronoi_diagram_2/Chapter_main.html

-

### You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.

I believe Herbert Edelsbrunner has written a few papers on the topic (for balls in $\mathbb{R}^d$), though his main interest was in d=3. You might try starting with "The union of balls and its dual shape", which discusses some structure useful in all dimensions.

-

I would perform DFS on a quadtree to the desired level of depth. Can't prove it is optimal, but it is very space efficient and can be done in parallel.

````At each level you need to determine::
  If one of the circles does not touch this box then I return empty.
  If all remaining circles cover this box then I return the size of the box.
  Any circles that cover this box I ignore them on future recursions. 
````
-

Dear Chad,  Thanks, I really appreciate you taking the time to answer my question!  However, I'm looking for an exact/analytical solution to the problem... – Rob Grey Jul 6 2010 at 3:12

The problem was solved completely by the following papers:

A New Algorithm for Dynamic Computing the Perimeter of Union of Circular Arcs， CHEN Jian-xun ZHAO Hui Dept. of Computer Science & technology, Wuhan University of Science & Technology, Wuhan Hubei 430081; Journal of Computer-Aided Design & Computer Graphics，1998-03

-

Do you happen to have a version of this last paper in English?

-

"this last paper": Which paper? "Last" in this context does not pick out a paper unambiguously. – Joseph O'Rourke May 8 2012 at 19:27
Sorry. I meant the paper "A New Algorithm for Dynamic Computing the Perimeter of Union of Circular Arcs", by CHEN Jian-xun and ZHAO Hui.  The only related reference I found is  en.cnki.com.cn/Article_en/… but that is another paper (for union instead of perimeter) by CHEN Jian-xun and MA Heng Tai.   I would like to see either of these papers by CHEN Jian-xun.   Thanks! – Cristina Fernandes May 8 2012 at 20:10
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 10, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8928828239440918, "perplexity_flag": "middle"}