rectangle layout algorithm?

Diez B. Roggisch deetsNOSPAM at web.de
Thu May 6 06:38:28 EDT 2004


Richard Taylor wrote:

> I need an algorithm to layout a collection of rectangles (images) within a
> bounding rectangle (sheet of paper).
> 
> I feel sure that I am not the first person faced with this problem :-)

That smells like a 2d-instance of the  knapsack-problem, also called
cuttingstock-problem - which is np-hard. In other words: There is no such
thing like a general solution to this. 

Some links I found:

http://www.inf.uos.de/papers_html/or_94/cutpaper.html

Maybe someone implemented a heuristic solvor for this in python - go google
for it :)


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list