Skip to content

Commit

Permalink
more README
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jan 14, 2025
1 parent 333cfc9 commit b23cbac
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,101 @@ fig.add_trace(Cloud(points).scatter())
fig.show()

```

## Background

We are solving the convex optimization problem:

\[
\min_r \quad r
\]

subject to the constraint that for each point \( p_i \), the Euclidean
distance from \( p_i \) to the center of the circle is less than or
equal to the radius \( r \):

\[
\| p_i - \text{center} \| \leq r, \quad \forall i = 1, 2, \dots, n
\]

Where:

- \( p_i \) are the points in \( \mathbb{R}^d \).
- \( \text{center} \) is the center of the circle we are trying to find.
- \( r \) is the radius of the circle.

The goal is to minimize the radius \( r \) such that all points
lie inside or on the boundary of the circle.

---

## Interpretation as a Min/Max Problem

The constraint \( \| p_i - \text{center} \| \leq r \) implies that
the radius \( r \) must be at least as large as the maximum distance
from the center to any of the points \( p_i \).

If we define the distance from the center to each point as:

\[
d_i = \| p_i - \text{center} \|
\]

Then, the radius \( r \) must satisfy:

\[
r \geq \max_i d_i
\]

Thus, the optimization problem becomes:

\[
r = \min \max_i d_i
\]

This is a **min-max** problem, where we want to
minimize the maximum distance from the center to any of the points.
In other words, we are looking for the smallest possible radius \( r \)
such that the maximum distance from the center to any point is minimized.

---

## Geometric Interpretation

Geometrically, the problem is about finding the **smallest enclosing circle**
(or ball in higher dimensions) that contains all the given points.
The center of the circle is positioned in such a way that the radius
is minimized, but all points still lie inside or on the boundary of the circle.

- **Convexity**: The objective function \( r = \min \max_i d_i \) is
convex, as the maximum of a set of convex functions is convex.
Minimizing a convex function over a convex set is a convex optimization problem.

- **Center and Radius**: The solution involves determining
both the center and the radius of the circle.
The optimal center minimizes the maximum distance to any of the points,
and the optimal radius ensures all points are inside
or on the boundary of the circle.

---

## Relation to Welzl's Algorithm

In 2D, this problem is often solved using **Welzl's algorithm**.
Welzl's algorithm is a recursive method for finding the
smallest enclosing circle. It works by:

1. Randomly choosing a subset of points.
2. Recursively refining the circle so that all points are inside or on its boundary.
3. Ensuring the radius is minimized.

---

## Conclusion

The problem you're describing is a **min-max** optimization problem
aimed at finding the smallest enclosing circle (or ball).
The radius \( r \) is the smallest value that ensures all points
lie within or on the boundary of the circle, and the goal
is to minimize the maximum distance from the center to any
point in the set.

0 comments on commit b23cbac

Please sign in to comment.