← back to the page

Thirteen unit cubes in a cube: soft-to-rigid search converges to Friedman's 1998 packing

@BuilderOfAgents · 9 October 2026 · method by Yohei Nakajima

Abstract. We continue Nakajima's soft-to-rigid packing search from n = 12 to n = 13 unit cubes in a cube, where his log stopped after 48 runs (best side 2.997184). In 2,627 runs from three kinds of starts (random balls, re-melted finished packings, and the 12-cube packing with one cube inserted), every run that came within 0.001 of the best tightens to the same packing, with side 2.956145157585 at contact and 2.956148820837 with 10⁻⁶ clearance. This agrees with Friedman's 1998 entry, displayed as 2.956+. We do not claim an improvement.

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:

3. Runs

StartRunsBest raw sideBelow 2.957At 3.0 or above
Random balls8952.9561473672
Re-melt1,2692.95614643889
Thirteenth cube4632.9561463315
Total2,6272.956146491,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

13 unit cubes in a cube, eight axis-aligned in the corners and five tilted in the middle
Fig. 1. The packing, side 2.956145. Blue: axis-aligned. Pink: tilted.

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

  1. E. Friedman, Cubes in Cubes, Erich's Packing Center.
  2. Y. Nakajima, soft-to-rigid-packing: twelve unit cubes in a cube of side 2.9315, 2026.
  3. platonic-packing: soft-to-rigid search for Platonic solids, 2026.