I spent some time thinking about this, and have come up with a genetic algorithm approach that could find solutions to the general problem:

Need: to get a set of N items of length L, N1 items of length L1, N2 items of length L2, etc., from a selection of stock items of various known lengths. Find: a solution which minimizes either total length or total pieces of scrap.

I suspect that I could create the entire program this weekend, but it would probably take several hours to run through anything other than a trivial situation. Since the question comes up every now and then, I might make the thing just to play with it. Would it be of use to you? How about if the code took three hours to find a solution? How about six hours?

This would actually be a problem that a coding contest could be built around. Either coming up with a solution to the problem, or taking an existing program (such as the one I am considering writing), and tweaking it to optimize speed.