0

My problem is a bit similar to this topic :

Fit elements into box

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.

enter image description here

Anyone knows any algorithms that may be helpful here ?

Community
  • 1
  • 1
mike_hornbeck
  • 1,612
  • 3
  • 30
  • 51

1 Answers1

2

Well one way would be to model this problem as a convex optimization problem and then use a solver to solve it (tons of solvers are available online). You can find more info about this approach in floor planning chapter (page 438) of Boyds convex optimization book. They have a matlab implementation of it in the examples folder of cvx software. I hope I haven't made it more complicated, it would be interesting to see other solutions.

amas
  • 604
  • 4
  • 8
  • I finally haven't used any algo, but just checked all the boxes against each other and positioned them properly but thanks for the book ! – mike_hornbeck May 24 '13 at 01:24