Re: Programmers Contest: Fit pictures on a page
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Programmers Contest: Fit pictures on a page

From: Don <donald.welch@NOSPAM.hp.com>
Date: Thu Jun 30 2005 - 01:07:30 CEST

Chung Leong wrote:

> Isn't that an NP-complete problem or am I crazy?

It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack
problem"). Here's a Wikipedia page that describes it:

http://en.wikipedia.org/wiki/Cutting_stock_problem

There are commerical applications available that "solve" the problem in 2D
for use in the woodworking industry (among others). This is generally done
to minimize waste when cutting down panels (plywood, etc) into smaller
pieces for cabinets, etc.

-Don
Received on Mon Oct 17 20:59:36 2005