Usually for this sort of stuff you'll work on a grid based system, testing only against nearby buildings rather than all buildings. The algorithm you want depends how irregular you want the layout to be. For something irregular look at circle packing or Poisson distribution algorithms. For more regular (grid based) layouts…