How to score a given arrangement of windows on a screen to produce good layouts
I will expand on my comment on the other question and propose a target function that ensures that no very small windows occur and that windows are not unnecessarily far away from screen edges. Let $\mathcal{W} = \{1,\dots,n\}$ a set of windows and $T = \mathcal{W} \to \mathbb{N}^4$ a tiling; if $T(W) = (x,y,w,h)$ window $W$'s top-left corner is positioned at $(x,y)$ and $W$ has width $w$ and height $h$. Now let $c : (\mathbb{N}^4)^\mathcal{W} \to \mathbb{R}$ a cost function from the space of all tilings to the reals:

$\qquad \displaystyle c(T) = \left[ \min_{W \in \mathcal{W}} T(W)_3\cdot T(W)_4 \right] - \sum\limits_{W \in \mathcal{W}} \operatorname{empty}(W)$

where $\operatorname{emtpy}(W)$ the maximum number of empty tiles between one of $W$'s edges and the respective nearest screen edges. The objective is maximisation.

Note that this is a (non-equivalent) simplification of the multicriteria optimisation goal of maximising

$\qquad \displaystyle c(T) = \left( \min_{W \in \mathcal{W}} T(W)_3\cdot T(W)_4 \ ,\ -\sum\limits_{W \in \mathcal{W}} \operatorname{empty}(W)\right)$.

Of course you need appropriate restrictions in place that ensure that now window is placed outside of the screen and windows do not overlap.