If by minimize waste you mean minimize area of rectangle circumscribing the polygons, you're looking at a
polygon packing problem. This seems to be NP-hard as given in the link; see a proof for a variant here. Also see this PPT .
So people have devised genetic algorithms and simulated annealing for solving this problem. Also, there are special cases, like rectilinear packing and rectangular packing. Interestingly, there seems to be a contest problem based on this. A slight variant of this problem is open. See here for a detailed discussion of packing irregular objects.
I don't know of any implementation, but if you want to write your own, I suggest using LEDA primitives.
In short, your question seems to be of current research interest; all I can give are pointers and not a complete answer.