I have a sorted list of blocks - some may overlap some may not. Each block has an ideal starting position and may be constrained to one axis. There are no velocity or acceleration or other forces involved - just the position. Some blocks are totally fixed and can never be moved (boundary blocks).
How do I solve the penetrations in a way that the blocks don't overlap anymore, but stay in the initial order?
I can easily solve the penetrations with normal position correction methods, like Baumgarte's stabilization in combination with separation axis theorem. The problem though, a separation normal might be found which pushes the block in a way that the order is changed, which is not what I want, because the application I am writing is a numerical simulation with some visualizations.