graphical-algorithm

Algorithm to distribute objects in a box (like InDesign, Illustrator, Draw!)

I have a set of rectangles with their corresponding positions and a big rectangle which serves as the 'bounding box' for these rectangles. I would like to know of an algorithm that would 'distribute the free space' evenly among the rectangles. Some of you may be familiar with the Distribute Spacing option in Adobe InDesign and similar l...