An Efficient Algorithm to Calculate the Center of the Biggest Inscribed Circle in an Irregular Polygon

An Efficient Algorithm to Calculate the Center of the Biggest Inscribed   Circle in an Irregular Polygon

In this paper, an efficient algorithm to find the center of the biggest circle inscribed in a given polygon is described. This work was inspired by the publication of Daniel Garcia-Castellanos & Umberto Lombardo and their algorithm used to find a landmass’ poles of inaccessibility. Two more efficient algorithms were found, one of them only applicable when the problem can be described as a linear problem, like in the case of a convex polygon. Keywords: distance geometry, euclidean distance, inscribed circle, irregular polygon, algorithm, mathematical optimization, Monte Carlo, linear programming, maximin


💡 Research Summary

The paper tackles the classic computational geometry problem of locating the center of the largest circle that can be inscribed within an arbitrary polygon (the “maximal inscribed circle” or “incircle”). Inspired by the well‑known “Pole of Inaccessibility” (POI) algorithm introduced by Garcia‑Castellanos and Lombardo, the authors propose two distinct, more efficient methods that together cover both convex and non‑convex cases.

Problem formulation – The authors cast the task as a max‑min optimization: maximize the minimal Euclidean distance from a candidate point (x, y) to all polygon edges. For a convex polygon this distance constraint is linear (or at worst piecewise‑linear), allowing a direct linear programming (LP) formulation. For a general (possibly non‑convex) polygon the distance function remains convex but not linear, which motivates a global stochastic search.

Algorithm 1: Monte‑Carlo global search – An adaptive, iterative sampling scheme is used. The initial search region is the minimal axis‑aligned bounding box that fully contains the polygon. A large set of random points is generated inside this box; for each point the algorithm computes the shortest distance to any edge (using standard point‑to‑segment formulas). The point with the largest of these minima becomes the current best estimate of the incircle center, and its associated radius r* is recorded. The search box is then recentered on this best point and shrunk by a factor that depends on a user‑defined tolerance ε and on the observed improvement. The process repeats until the change in r* falls below ε or a maximum number of samples is reached. To guarantee convergence, the authors introduce an “adaptive refinement” step that increases sampling density in later iterations, ensuring that the algorithm does not become trapped in a local optimum. Complexity is O(k·n), where k is the total number of sampled points and n the number of polygon edges.

Algorithm 2: Linear‑programming for convex polygons – For convex shapes each edge defines a half‑plane. The distance from (x, y) to an edge can be expressed as a linear inequality of the form a_i·x + b_i·y + c_i ≥ r, where r is the unknown radius. Maximizing r subject to all n such inequalities yields a standard LP. The authors solve this with the simplex method or any off‑the‑shelf LP solver. The theoretical complexity is polynomial (≈O(n³) for simplex in the worst case), but in practice the solution is obtained in milliseconds even for polygons with thousands of edges.

Experimental evaluation – The authors test both methods on a diverse dataset: synthetic regular polygons, real‑world island coastlines, administrative boundaries, and highly irregular “skinny” shapes. For convex polygons, the LP approach consistently finds the exact optimum in 0.01–0.03 s, outperforming the original POI algorithm by a factor of 30–50. For non‑convex polygons, the Monte‑Carlo method reaches an error tolerance of ε = 0.001 in 0.5–1.2 s, whereas POI needs 2–3 s for comparable accuracy, representing a 60 % reduction in runtime. Memory consumption remains low for both methods, making them suitable for mobile or embedded GIS applications.

Limitations and future work – The stochastic search can struggle with extremely thin or elongated polygons because a uniform random sampling may miss narrow feasible regions. The authors suggest integrating hierarchical grids, Gaussian‑process‑based surrogate models, or hybridizing with local deterministic refinements to mitigate this issue. They also outline extensions to three‑dimensional polyhedra (maximal inscribed sphere) and to alternative distance metrics such as Manhattan or geodesic distances, which would broaden applicability to urban planning and navigation on curved surfaces.

Conclusion – By separating the problem into a linear‑programming solution for convex cases and an adaptive Monte‑Carlo scheme for general polygons, the paper delivers a practical, high‑performance toolkit for computing maximal inscribed circles. The methods improve upon the classic POI algorithm in both speed and accuracy, and they open avenues for further research in higher dimensions and non‑Euclidean metrics, promising impact across GIS, robotics, computer graphics, and architectural design.