My problem is a bit similar to this topic :
Although in my case I have a container of some size, and some predefined elements with know vertical positions. The elements are to be allocated inside the container without overlapping, and taking full available width. If two or more would overlap, they should have the same width.
Anyone knows any algorithms that may be helpful here ?