Layout Algorithm (Overfull page/colliding staves)

I know that this is an old answer but I still think it’s the most useful one to this question: