Minimizing Perimeter for a Fixed Area (and Beyond)
The isoperimetric problem is one of the oldest and most elegant challenges in mathematics: among all curves enclosing a given area, which one has the shortest perimeter? The answer โ a circle โ has been known intuitively since antiquity, but proving it rigorously took centuries. In this post, weโll explore this beautiful problem through concrete examples, numerical optimization, and rich visualizations including 3D plots.
๐งฎ The Math Behind It
2D: Classic Isoperimetric Inequality
For a closed curve of perimeter $L$ enclosing area $A$, the isoperimetric inequality states:
$$L^2 \geq 4\pi A$$
Equality holds if and only if the curve is a circle. For a circle of radius $r$:
$$A = \pi r^2, \quad L = 2\pi r \implies L^2 = 4\pi^2 r^2 = 4\pi (\pi r^2) = 4\pi A \checkmark$$
3D: Surface Area vs. Volume
In 3D, for a surface enclosing volume $V$ with surface area $S$:
$$S^3 \geq 36\pi V^2$$
A sphere achieves equality. For sphere of radius $r$:
$$V = \frac{4}{3}\pi r^3, \quad S = 4\pi r^2$$
$$S^3 = 64\pi^3 r^6 = 36\pi \cdot \frac{16\pi^2 r^6}{1} = 36\pi \left(\frac{4}{3}\pi r^3\right)^2 \cdot \frac{9}{1} \cdot \frac{1}{9} = 36\pi V^2 \checkmark$$
Concrete Example Problems Weโll Solve
Problem 1: Among all rectangles with area $A = 1$, find the one with minimum perimeter.
Problem 2: Among regular $n$-gons with area $A = 1$, compute perimeter as $n \to \infty$ and show convergence to the circle.
Problem 3: Using numerical optimization (SciPy), minimize perimeter over arbitrary convex shapes via control points.
Problem 4 (3D): Among rectangular boxes with volume $V = 1$, find the minimum surface area shape โ the cube.
๐ป Python Source Code
1 | # ============================================================================= |
๐ Code Walkthrough
Global Styling
The first block sets a dark-theme style dictionary for all matplotlib plots โ navy background, soft lavender axes text, and a hand-picked color palette (GOLD, CYAN, PINK, GREEN, ORANGE). This is purely cosmetic but makes the multi-panel figures easy to read.
Section 1 โ Rectangle: Analytical Minimum
For a rectangle with sides $x$ and $y = A/x$ (area $A = 1$ fixed), the perimeter is:
$$L(x) = 2\left(x + \frac{A}{x}\right)$$
Setting $dL/dx = 0$:
$$\frac{dL}{dx} = 2\left(1 - \frac{A}{x^2}\right) = 0 \implies x = \sqrt{A}$$
So $x = y = 1$ โ a square โ minimizes the perimeter among all rectangles. We confirm this numerically with minimize_scalar (Brentโs method, bounded).
1 | result = minimize_scalar(rectangle_perimeter, bounds=(1e-6, 100), method='bounded') |
The result $L_{\min} = 4$ for the square (Area = 1), while the circle achieves $L = 2\sqrt{\pi} \approx 3.545$ โ the square still wastes perimeter compared to the circle.
Section 2 โ Regular $n$-gon Convergence
For a regular $n$-gon with area $A = 1$, the side length satisfies:
$$A = \frac{n s^2}{4 \tan(\pi/n)} \implies s = \sqrt{\frac{4A\tan(\pi/n)}{n}}$$
Perimeter:
$$L_n = n \cdot s = \sqrt{\frac{4An}{\cot(\pi/n)}} = 2\sqrt{An\tan(\pi/n)}$$
As $n \to \infty$: $n \tan(\pi/n) \to \pi$, so $L_n \to 2\sqrt{A\pi} = 2\pi r$ โ the circle. This is computed for $n = 3, \ldots, 200$ and plotted.
Section 3 โ Numerical Shape Optimization (SLSQP)
This is the heart of the numerical experiment. We parameterize a shape by $n = 64$ control points in polar form:
$$x_k = r_k \cos\theta_k, \quad y_k = r_k \sin\theta_k, \quad \theta_k = \frac{2\pi k}{n}$$
The optimizer (Sequential Least-Squares Programming) finds the radii ${r_k}$ that minimize the polygon perimeter subject to the area constraint $A = 1$.
1 | result = minimize(objective, r0, method='SLSQP', bounds=bounds, constraints=constraints) |
Starting from a slightly perturbed circle, the optimizer converges back to something very close to a circle โ visually confirming the isoperimetric theorem.
Section 4 โ 3D Box Surface Area
For a box with dimensions $a, b, c$ and volume $V = abc = 1$:
$$S = 2(ab + bc + ca)$$
By AM-GM inequality:
$$\frac{ab + bc + ca}{3} \geq (a^2b^2c^2)^{1/3} = V^{2/3} \implies S \geq 6V^{2/3}$$
Equality holds when $a = b = c = V^{1/3}$ โ a cube. For $V = 1$: $S_{\min} = 6$. SLSQP confirms this, and the 3D surface plot shows the minimum clearly at $(a, b) = (1, 1)$.
๐ Graph Explanations
Figure 1 โ 2D Analysis (4 panels)
Panel A shows the perimeter curve $L(x)$ of a rectangle with area 1. The sharp minimum at $x = 1$ (the square) is highlighted in gold. The pink dashed line shows the circleโs perimeter โ always below, illustrating that even the optimal rectangle canโt beat a circle.
Panel B shows how the $n$-gon perimeter decreases monotonically from the triangle ($n=3$, highest perimeter) toward the circle limit as $n \to \infty$. The green shading between the $n$-gon curve and the circle limit visualizes the โperimeter waste.โ
Panel C overlays the numerically optimized 64-point polygon (cyan) on the reference circle (gold). After convergence, they are nearly indistinguishable โ the optimizer found that a circle-like shape is optimal.
Panel D is a bar chart of the isoperimetric ratio $L / L_{\text{circle}}$ for several shapes. Every bar is $\geq 1$, and the circle achieves exactly $1$.
Figure 2 โ 3D Analysis (3 panels)
Panel A is a 3D surface plot of $S(a, b)$ for a unit-volume box ($c = 1/(ab)$). The plasma colormap reveals a deep well at $(a, b, S) = (1, 1, 6)$ โ the cube minimum.
Panel B shows cross-sections: fixing $b = 1$ (varying only $a$) vs. the square-base constraint $a = b$. Both curves have a minimum at $a = 1$, confirming the cube is optimal regardless of the path.
Panel C is a horizontal bar comparison of surface areas for various shapes with $V = 1$. The sphere (gold) has the globally minimum surface area $\approx 4.836$, the cube (green) achieves $6.0$, and elongated or flat boxes have dramatically larger surface areas.
Figure 3 โ Isoperimetric Quotient
The Isoperimetric Quotient (IQ) measures how โroundโ a shape is:
$$\mathrm{IQ} = \frac{4\pi A}{L^2} \leq 1$$
$\mathrm{IQ} = 1$ only for a circle. The three panels show $n=3,4$ then $n=6,12$ then $n=50$ overlaid with the circle, with each shape labeled by its IQ value. The inset plot in Panel C shows IQ rising from $\approx 0.605$ (triangle) toward $1.0$ (circle) as $n$ increases.
๐ Execution Results
======================================================= SECTION 1: Rectangle with Area = 1 Optimal sides : 1.000000 x 1.000000 Min perimeter : 4.000000 Circle perim : 3.544908 (theoretical minimum) Ratio L/L_circ: 1.128379 SECTION 2: n-gon perimeter (area = 1) n= 3: perimeter=4.559014 ratio=1.286074 n= 4: perimeter=4.000000 ratio=1.128379 n= 6: perimeter=3.722419 ratio=1.050075 n= 12: perimeter=3.586302 ratio=1.011677 n= 50: perimeter=3.547243 ratio=1.000659 n= 100: perimeter=3.545491 ratio=1.000165 n= 200: perimeter=3.545053 ratio=1.000041 Circle: perimeter=3.544908 ratio=1.000000 SECTION 3: Numerical shape optimization Optimized area : 1.000000 (target=1.0) Optimized perimeter : 3.546333 Circle perimeter : 3.544908 Convergence ratio : 1.000402 SECTION 4: Box with Volume = 1 Optimal dims : 1.000000 x 1.000000 x 1.000000 Min surf area : 6.000000 Cube SA (6) : 6.000000 (analytical) Sphere SA : 4.835976 (global minimum)

[Figure 1 โ 2D results displayed above]

[Figure 2 โ 3D results displayed above]

[Figure 3 โ Isoperimetric Quotient displayed above]
๐ฏ Summary
| Shape | Perimeter / SA (Area/Vol = 1) | IQ |
|---|---|---|
| Triangle ($n=3$) | $L \approx 4.559$ | $0.6046$ |
| Square ($n=4$) | $L = 4.000$ | $0.7854$ |
| Hexagon ($n=6$) | $L \approx 3.722$ | $0.9069$ |
| Circle ($n\to\infty$) | $L \approx 3.545$ | $1.0000$ |
| Cube ($V=1$) | $S = 6.000$ | โ |
| Sphere ($V=1$) | $S \approx 4.836$ | โ |
The isoperimetric problem reveals a profound geometric truth: natureโs most efficient boundary is always round. From soap bubbles to cells to planets, the circle (and sphere in 3D) minimize โedgeโ for a given โcontentโ โ a principle that echoes throughout physics, biology, and engineering.