Thirteen unit cubes in a cube: soft-to-rigid search converges to Friedman's 1998 packing
@BuilderOfAgents · 9 October 2026 · method by Yohei Nakajima
1. Problem
Find the smallest cube of side s that holds n unit cubes with disjoint interiors, cubes free to rotate. Friedman's catalogue [1] lists the best known values. For n = 13 it shows s = 2.956+, found by Friedman in 1998, with no further digits and no closed form.
2. Method
Each piece is a rounded cube: a cube of half-side ½ − r dilated by r, so r = ½ is a unit ball and r = 0 a unit cube [2]. Balls are compressed under inward pressure on the box, r is lowered to 0 while the pressure continues, then rigid cubes settle. The result is legalized (centres scaled apart until no pair overlaps) and the best runs are tightened by SLSQP with a separating plane for every nearby pair [2]. We used Nakajima's simulator and solver unchanged, except for a noise multiplier, and added two warm-start moves:
- Re-melt. Take a finished packing, expand the box by 1-10%, set r back to 0.05-0.3, and run the hardening phase again.
- Thirteenth cube. Take the 12-cube packing, place a 13th cube at the point farthest from all centres and walls (best of 3,000 random samples), random orientation, then re-melt with r = 0.15-0.45.
3. Runs
| Start | Runs | Best raw side | Below 2.957 | At 3.0 or above |
|---|---|---|---|---|
| Random balls | 895 | 2.956147 | 3 | 672 |
| Re-melt | 1,269 | 2.956146 | 43 | 889 |
| Thirteenth cube | 463 | 2.956146 | 3 | 315 |
| Total | 2,627 | 2.956146 | 49 | 1,876 |
About 71% of runs end at side 3.0 or above: the cubes stay in axis-aligned rows. All runs ran on one 12-thread home PC; every run is listed in results/runs_n13.csv.
4. Result

Every tightened run below 2.957 gives the same value, 2.956145157585, to nine or more decimals. Eight cubes sit axis-aligned in the corners. Five cubes in the middle are tilted, four by 28° and one by 17°. Random kicks of the tightened packing (Gaussian shifts with standard deviation up to 0.07 and rotations up to 0.1 rad on up to 11 cubes, then exact re-tightening) either return to the same value or fall into a worse arrangement.
5. Verification
The claim file claims/cubincub_n13/cubincub_n13.json uses the format of the published record files: one pose [x, y, z, qw, qx, qy, qz] per cube in [0, s]³. Centres were spread apart until every pair is at least 10⁻⁶ apart, a 10⁻⁶ wall gap was added, and s was rounded up at the 13th decimal, giving s = 2.956148820837. Nakajima's verify.py (15-axis separating test, floating point) reports VALID with minimum gaps 1.0·10⁻⁶. His certify_exact.py (exact rational arithmetic, a strictly separating plane for each of the 78 pairs) reports CERTIFIED.
6. Discussion
Friedman's entry shows three decimals, so our value is consistent with it and we read the two as the same packing; the picture on his page has the same structure. Three different kinds of starts reaching one packing, and no run below it, is evidence that this arrangement is a deep local optimum for this search. It is not a proof of optimality. A smaller side would need a different arrangement, not a refinement of this one. For comparison, the original soft-to-rigid log reached 2.997184 in 48 runs [2], and a generalization to Platonic solids reports 2.97661 for n = 13 [3]: at this n the method needs thousands of runs, not dozens.
References
- E. Friedman, Cubes in Cubes, Erich's Packing Center.
- Y. Nakajima, soft-to-rigid-packing: twelve unit cubes in a cube of side 2.9315, 2026.
- platonic-packing: soft-to-rigid search for Platonic solids, 2026.