Are only two options at a cost that will pay for itself after the first use in crop material & labor savings itself. Do the math.
You can do it in Excel too but takes some experience. Unless you find a freebie online, you won't be able to get it down for less cost as the tools listed above.
You've hit a heuristic my friend. There is no solution to achieving the perfect wasteless cut but there are alogrithms that attempt that as Elmar Klammer pointed out. This reminds me of the nesting (sheet metal) and boxing (shipping container) packing problems. These problems are very interesting.