We are trying to solve a problem of auto-layout or auto-arrangements of containers. The containers can be in a hierarchy and can be defined by the rules below: