Polyhedra in Polyhedra

Method

This project combines soft-to-rigid search, structured constructions and local tightening to find small containers for identical convex polyhedra and regular polytopes. Every published coordinate witness is checked separately in exact arithmetic. The catalogue also preserves independent constructions, their source credit and published bounds whose coordinates have not yet been recovered.

Alejandro Zarzuelo Urdiales developed this project's generalized pipeline from Yohei Nakajima's soft-to-rigid cube-packing method. The implementation now includes non-tangential 3D solids, adaptive search, symmetric and crystal seeds, nested constructions, and a separate engine and certifier for 4–6 dimensions. Contributors can use any construction method; the same geometric acceptance criteria apply.

Problem, scale and scope

Let P be the piece and C the container in dimension d. We seek a small scale s for which n translated and properly rotated copies of P have pairwise disjoint interiors inside sC. Reflections of a chiral piece are not interchangeable with rotations. Write s*P→C(n) for the infimum over all valid arrangements; a coordinate witness at scale s proves s*P→C(n) ≤ s.

For unit-edge regular and Archimedean solids, and equilateral prisms and antiprisms, s is the container edge divided by the piece edge. Catalan solids use the fixed canonical dual described below; their self-packing scale compares two copies of that same solid. Elongated prisms retain their specified aspect ratio and use their base edge as the size unit. In higher dimensions the records also report an edge ratio, even when the exact canonical vertex coordinates have a different native edge length.

The catalogue currently tracks 140 problems and 10,404 table slots. Its supported families are:

  • 3D, n = 2–100: all 25 ordered Platonic-solid pairs; 13 Archimedean and 13 Catalan self-packing problems; and 35 prism, antiprism and elongated-prism problems, including self-packings and cube containers. The cube and octahedron are not duplicated as a square prism and a triangular antiprism.
  • 4D, n = 2–40: all 36 ordered pairs of the six convex regular polytopes: the 5-cell, tesseract, 16-cell, 24-cell, 120-cell and 600-cell.
  • 5D, n = 2–32, and 6D, n = 2–24: all nine ordered pairs of the regular simplex, hypercube and orthoplex in each dimension.

These are the current search ranges, not mathematical limits. The construction catalogue links the selected witnesses, alternative arrangements, source material and certificates.

Density and lower bounds in dimension d

Use Vd for d-dimensional volume, with P and C expressed in the normalization used to define s. The occupied fraction and the necessary volume bound are

η = n Vd(P) / (sd Vd(C)),
s ≥ [n Vd(P) / Vd(C)]1/d.

Thus the exponent is 1/3 in 3D, 1/4 in 4D, 1/5 in 5D and 1/6 in 6D. The simplified bound s ≥ n1/d applies to self-packings or equal-volume reference shapes; a mixed pair needs its volume ratio. An equivalent volume-normalized scale is σ = s [Vd(C)/Vd(P)]1/d, for which η = n/σd.

For higher-dimensional native coordinates, let μ = edge(P0)/edge(C0). A record's edge ratio s_full places the pieces inside container_center + s_full × μ × C₀. Using the raw canonical volumes therefore gives η = nVd(P0)/[(sμ)dVd(C0)] and s ≥ [nVd(P0)/Vd(C0)]1/d/μ. The publisher applies this conversion.

The dashed chart line is a volume lower bound. A certified construction gives an upper bound; equality of suitable exact bounds can establish optimality, while a small numerical gap alone cannot. The charts also show absolute scale increments Δs = s(n) − s(n − 1) and relative increments Δs/s(n − 1). A plateau or jump in the current catalogue is an observed property of those witnesses, not a proof that the unknown optimum has the same pattern.

Canonical geometry

The geometry files define the shapes, their normalization and their supporting facets, independently of the search.

  • solids.py constructs the exact Platonic solids.
  • polyhedra.py builds Archimedean and Catalan solids, prisms, antiprisms and elongated prisms. Catalan solids are polar duals of unit-edge Archimedean solids in their common midsphere: a face with unit normal m at distance h gives a dual vertex (rm2/h)m. The generator checks the hull, face planarity, edge and face counts, supporting planes, and the appropriate equal-edge or insphere conditions.
  • src/polytopes_nd.py builds the regular 4D–6D polytopes; their exact algebraic coordinates and facets are stored in src/polytopes_nd.json and checked by the higher-dimensional certifier.

The 3D search reads src/solids.json; high-precision and exact geometry are kept separately in src/solids_hp.json and src/solids_exact.json. See exact solid definitions for the certificate's interpretation.

Soft shapes and hardening

Nakajima's starting idea lets rounded pieces rearrange under pressure before their sharp features lock together. For a convex polytope P with an insphere of radius ρ touching every facet, the project uses

Sr = (1 − r/ρ)P ⊕ Bd(r),   0 ≤ r ≤ ρ.

Here ⊕ is a Minkowski sum and Bd(r) is the radius-r ball in the ambient dimension. The endpoints are the insphere and P. Its support function is (1 − r/ρ)hP(u) + r for unit u. Since hP(u) ≥ ρ, the rounded bodies are nested and grow as r decreases. This formula applies to the Platonic and Catalan solids and every regular higher-dimensional polytope supported here. Internally ρ = 1/2, so the nD simulator uses (1 − 2r)P ⊕ Bd(r).

For 3D solids whose facets are not all tangent to one insphere, the generalized implementation uses erosion followed by dilation:

Sr = (P ⊖ B3(r)) ⊕ B3(r).

For unit facet normals, the eroded core is {x : nf·x ≤ hf − r}. Its vertices vary linearly between finitely many changes of face structure, precomputed by polyhedra.py. The rounded shape stays inside P and grows toward P as r decreases. For a tangential polytope this reduces to the insphere formula. A non-tangential solid starts as a rounded body rather than necessarily a ball.

Pressure, contact geometry and legalizing

The 3D simulator, src/sim.js, minimizes squared positive overlaps and wall violations plus a pressure term proportional to container size. Heavy-ball updates act on centers, orientations and scale, with bounded velocities and annealed noise. A fresh start compresses rounded bodies, lowers the softness to zero, then settles the hard pieces. Hop schedules and step budgets depend on the move and piece count.

src/geom.js evaluates contacts between rounded 3D bodies through their polyhedral cores: separating-axis penetration tests for overlapping cores and feature distances for disjoint cores. A Gauss-map filter prunes edge pairs in the separating-axis test, following Dirk Gregorius's presentation of the convex-polyhedron test.

A simulation is only a candidate. Legalizing spreads centers as needed, finds separating planes and refits the container, including its translation. Only a candidate passing the appropriate geometric checks can replace an archived witness. Approximate dynamics, legalizing and the final exact certificate serve distinct purposes.

scripts/engine.py maintains the best known packing and a pool of distinct good arrangements for each case. Its move portfolio includes:

  • Hop: slightly expand a packing, soften and perturb its pieces, then harden and tighten it again. Some hops move a local cluster rather than the whole configuration.
  • Fresh and symmetric starts: start from new rounded arrangements. In 3D, symfresh holds the soft phase in orbits of a randomly chosen cyclic container symmetry, then releases the symmetry during unconstrained tightening. The final witness need not retain that symmetry.
  • Ascend and descend: insert a piece into a good (n − 1)-packing, or remove a piece from an (n + 1)-packing and refit.
  • Reinsert: remove a few pieces and try placing them in larger holes before relaxing.
  • Cheap perturbation: expand and perturb a hard packing, then use sequential linear programming directly, avoiding a full soft simulation.
  • Follow-ups: a case that has just improved is usually still short of its local optimum, so up to three further perturbations of it run at once while it keeps improving (in 4D–6D they improved the case in 58% of attempts, against 45% for other perturbations).

The old fixed move percentages have been replaced by family-aware policies and measured performance. Recent improvements, logarithmic scale gains, CPU time, failure streaks, neighboring n values and long plateaus affect where the engine spends effort. Exploration and polishing use different move balances. These are implemented adaptive heuristics, not a guarantee of convergence to a global optimum.

Deleting a piece preserves feasibility, hence s*(n) ≤ s*(n + 1). The archive propagates such deletions when they improve a smaller case and schedules further tightening. Distributed workers export candidates; the harvesting process rechecks them before admission. The live archive currently records 589,728 attempts.

The project's search-method study reports measured comparisons of moves. Its proposed experiments are not all production features: for example, the current engine does not implement every GPU, projection or orbit-reduction idea discussed there.

Structured seeds: grids, lattices and crystal cuts

Known grids and space-filling structures provide useful baselines. For larger 3D cases, scripts/crystal.py constructs numerical lattice, double-lattice and prism-column packings. scripts/crystal_cut.py selects finite windows, varies orientations and offsets, and refits and tightens them inside the chosen container. These seeds compete with insertions, hops and community arrangements. A dense infinite packing need not give the best small finite-container packing because boundary effects are substantial.

The project's finite-cut implementation builds on an established subject: Betke and Henk's lattice work, Torquato and Jiao's dense-polyhedron packing work, and Jiao and Torquato's truncated-tetrahedron double lattice. The numerical periodic seeds are not certificates of globally densest infinite packings; the extracted finite constructions receive their own exact checks.

Nested constructions and reuse

If a witness puts m copies of P inside Q at edge ratio a, and another puts k copies of Q inside C at ratio b, substituting a scaled inner arrangement into every outer piece gives mk copies of P inside C at ratio ab. Any subset is still a packing, so

s*P→C(N) ≤ ab   for 1 ≤ N ≤ mk.

All shapes must have the same ambient dimension and compatible normalization. With an inner map Rix + pi in aQ and outer map Ujy + qj in bC, scale the entire outer construction by a: the composite pose is UjRix + Ujpi + aqj in abC. Nonzero container centers are translated consistently. One-piece inclusions are included by taking m = 1.

scripts/compose3d.py and scripts/compose_nd.py search over intermediary Platonic solids in 3D and supported regular polytopes in 4D–6D, respectively (scripts/compose3d_all.py extends the 3D sweep to every solid of the archive, computing one-piece inclusions on demand), and available multiplicities, construct improving candidates and re-legalize them. Improvements can therefore propagate to other problems without a fresh numerical search.

The automated higher-dimensional sweep generalizes the whole-body inclusion construction in PingYou Ltd's contribution #79, including a 120-cell placed inside each 24-cell of an existing packing. PingYou Ltd's related contributions use honeycomb windows and fixed-orientation center optimization, prism subdivisions and face lifts into a higher dimension. Their original issues describe the actual construction; derived witnesses retain the relevant source lineage. Product constructions and inclusion are general geometric principles, not claimed here as newly invented principles.

Tightening and witness files

The hard-packing tighteners minimize container scale subject to vertex containment and separating-plane constraints. src/fastslp.py uses sequential linear programming with trust regions and regularization. Exploratory perturbations and close comparisons can use unregularized tightening; src/exact.py also contains the earlier tightening path. Despite that filename, numerical optimization itself is not an exact proof.

Separating-plane nonlinear models for freely translating and rotating polyhedra predate this project; see Romanova, Bennell, Stoyan and Pankratov (2018). Sequential-LP packing methods also have prior literature, including Torquato and Jiao (2010). Berthold, Kamp, Mexi, Pokutta and Pólik (2026) studied every ordered Platonic-solid pair before this project. This site's literature page distinguishes those results and methods from the present implementation.

The publisher generates full-precision JSON witnesses and certificates. Search-generated records normally add a small positive clearance; community witnesses may use different margins. The certificate, not a blanket decimal padding rule, determines whether a file is strictly valid. The displayed trailing “+” marks a truncated display: the printed base value alone is not the certified scale. Use s_full and the complete coordinate file for calculations and for the construction's upper bound.

Search and visualization in 4–6 dimensions

scripts/engine_nd.py and src/ndsim.py extend the archive and hardening search to SO(d). An orientation has d(d − 1)/2 infinitesimal rotation parameters. Skew-matrix increments are applied with a Cayley map; simulation matrices are numerical and periodically reorthonormalized.

Support-point queries and separating-hyperplane optimization replace exhaustive enumeration of 3D edge-cross-edge axes. src/ndslp.py tightens centers, rotations, scale and separating hyperplanes. Higher-dimensional symmetric starts use central inversion, reflections and suitable four-element symmetry groups, with constraints released for final settling. The engine also uses grid seeds, local perturbations, insertion, deletion and reinsertions.

The viewer shows 3D slices, not a full-dimensional projection: in 4D it fixes x4; in 5D and 6D it also fixes the remaining coordinates. Sliders and a sweep move the section. A piece missing the current slice still belongs to the packing. The certificate checks the whole d-dimensional bodies, independently of this visualization.

Higher-dimensional implementation notes explain the geometry, cost and current search limits. The higher-dimensional contribution instructions describe the native matrix-format witnesses and the separate review route.

What exact verification proves

For 3D, verify_general.py supplies a floating-point diagnostic and certify_general.py performs exact verification. In 4–6D, certify_nd.py checks the native polytopes, rational rotations, containment and separation. Its rational skew-matrix/Cayley representation gives exactly orthogonal proper rotations; rigorous outward interval arithmetic proves the geometric inequalities.

The certificate proves that the supplied construction fits at its stated scale, with positive margins. It does not prove that every smaller scale is impossible, validate every theorem in an accompanying write-up, or establish priority for a construction. Source-only published bounds are labelled separately. 10,400 selected coordinate constructions are certified exactly; 4 better published entries link to the original constructions and have no coordinates or local certificate. Their certified alternatives remain available in the viewer.

Construction authorship, source witnesses and certificate refinement are recorded separately. Re-padding or re-certifying an unchanged arrangement does not transfer its construction credit. A deletion or nested construction can inherit or combine earlier source credit. See certification and contributor attribution.

Extending the library and reproducing a result

A new convex 3D solid needs canonical high-precision geometry, exact geometry and validation, and a problem definition. A new higher-dimensional polytope needs exact vertices and supporting facets plus a compatible engine and certifier definition. Adding a name to the viewer alone does not establish support. Mixed pieces, curved containers and new objectives require changes to the appropriate geometry, optimizer and proof checks.

The contribution page explains existing problems, new categories and alternative constructions. The current implementation does not accept planar packings as catalogue entries.

git clone https://github.com/alejandrozu/platonic-packing.git
cd platonic-packing
# Exact witness checks use the Python standard library:
python3 certify_general.py records/phcinphc/phcinphc_n12.json
python3 certify_nd.py path/to/native-nd-witness.json
# Building/searching additionally needs the dependencies in the repository's instructions.
python3 scripts/site.py

Download a complete native record from the viewer or construction catalogue and check that exact file. Preserve numeric strings, translations, orientations, scale and provenance when sharing it. Search-generated and community files can have different filenames and locations; use the linked record rather than reconstructing one from a rounded table value.

Code and research notes