by Guest » Thu Nov 23, 2023 2:08 am
Sort the lengths of the metal bars ([tex]z_k[/tex]) in decreasing order.
Initialize a list of remaining lengths starting with a single rod of length 0.
For each metal bar length in decreasing order:
Try to fit the current bar length into the remaining lengths:
Start from the beginning of the list.
If a segment is found where the bar length fits, cut it from that segment.
If no suitable segment is found, add a new segment of the current bar length.
The number of cuts made during this process is the minimum number required to fulfill the customer's order.