Sometimes matches would be arranged in triangles or other more complex shapes, but since everybody involved needed to get on the same page this was rare.
A web service could handle this neatly. You could commit to being ready for a match within the next 2 weeks. If the server can find a way to move any number of people between equivalent apartments, everyone gets notified and confirms receipt.