A similar problem is that the cost to find the least waste exceeds the value of the material wasted.
Can one edge of a tile match the edge of another tile?
Or is it required that a small margin remain?
[2x4 lumber is not 2"x4"]
You may have included that border in the tile sizing.
Similar tiles are treated as a single unit (as square as possible).
Place the largest tile first [horizontally or vertically & then swap on the subsequent iteration]
Then in descending size, slide & rotate the remaining pieces until all are used or an unacceptable arrangement occurs - then back track and handle the alternate.
I really do not cut material; it is the dense packing of boxes in a container, but the idea is approximately the same.
Best to search the web for some free code.