Fill a cube with brep's

I don’t know if this is possible, but i am looking for a solution, I am optimizing a structure with individual housing units+gardens. Now each house and garden gets moved to a point on the site, is it possible like seen in one of the pictures to add a rule so all the houses connect at least at one point. The grasshopper file is a simple version of the project, the whole system gets optimized to get optimal light, an climate conditions.

simple.gh (27.7 KB)