# How to create an algorithms for fitting a network of tubes into a cube? [closed]

How to create an algorithms for fitting a network of tubes with a range of diameters into a cube, with maximum volume in the tubes? Assume:

• 30 cm minimum square side
• 1 cm minimum pipe diameter
• 1 mm pipe wall thickness.
• Cube edge length $L$
• number of different diameters $n$
• volume Pipes $= \pi r^2\times\text{length}$.

The tubes form a network in the sense of a continuous network of connected Tubes.

Tricky parts:

• Finding the ideal number of different radiuses of pipes to use.
• accounting for curves in the pipes. May be worth assuming straight pipes with U-turns at the ends? Obviously square pipes would be ideal. But we are restricted to circular pipes.

Best to break down the problem into components:

1. assuming (one) 1 cm diameter pipe, how to fit most volume pipe into 30cm cube.
2. assuming (multiple) diameter pipes: 1 cm and 5 cm diameter pipes, how to fit most volume pipe into 30 cm cube.
3. how to determine the optimal number of diameters
i. given limited number or radii,
ii. given unlimited number of radii.
• use the smallest pipes you can, they pack best. You haven't really given any constraints to the length of the pipe, or if there are any turns. en.wikipedia.org/wiki/Circle_packing Sep 5 '18 at 19:57
• "they pack best" - not necessarily. You can fit small pipes into the spaces left between bigger pipes. en.wikipedia.org/wiki/Apollonian_gasket Sep 5 '18 at 20:01
• What's the purpose of this exercise?
– mart
Sep 6 '18 at 8:00
• Ambiguity: Is the minimum diameter constraint internal or external diameter? If it's external then the wall thickness is immaterial.
– user6335
Sep 6 '18 at 9:29
• @Wossname if its external, then the wall thickness still is significant for the calculation of the volume of liquid contained.
– Dale
Sep 7 '18 at 2:13