But how to optimize the number of circles fitted in a bounded region.

Circles that needn't all have the same size? If so, what is being optimized?

Design a rack with minimum area or perimeter to fit in 50 coke cans. Restrict the problem to racks in the shape of regular polygons.

I'll assume each can has radius 1.

If the rack has the shape of an equilateral triangle large enough to contain a row of ten cans along one side, it can hold up to 55 cans and has perimeter 64.4 approximately.

If the rack is square and uses square packing, it needs to have a side length of 16, and so will have a perimeter of 64. It will hold up to 64 cans. See

this article and also

this article if square packing needn't be used.

If the rack has the shape of a regular hexagon and uses hexagonal packing, it needs to be large enough to contain a row of five cans along one side, it can hold up to 61 cans and I'll let you calculate its perimeter.