sky2 / benchmarks /math /circle_packing_rect /initial_program.py
JustinTX's picture
Add files using upload-large-folder tool
b0e88cf verified
# EVOLVE-BLOCK-START
import numpy as np
def circle_packing21() -> np.ndarray:
"""
Places 21 non-overlapping circles inside a rectangle of perimeter 4 in order to maximize the sum of their radii.
Returns:
circles: np.array of shape (21,3), where the i-th row (x,y,r) stores the (x,y) coordinates of the i-th circle of radius r.
"""
n = 21
circles = np.zeros((n, 3))
return circles
# EVOLVE-BLOCK-END
if __name__ == "__main__":
circles = circle_packing21()
print(f"Radii sum: {np.sum(circles[:,-1])}")