A warehouse has to prepare for shipping a variety of food items to be sent out to a grocery store. The food items are all from n different categories, F1, F2, ... Fn. Items in each food category first need to be labeled with their expiration date by a labeling machine and then packed into large containers for shipping by company employees. The warehouse has only one labeling machine, but a large enough number of employees (greater than n) who can do the packing, so the items for different food categories can be packed independently from each other. A food category Fi takes li minutes to be labeled by the machine and pi minutes to be packed.
Since there is only one labeling machine, the labeling of the food categories can be done only one at a time, which means that food categories need to be scheduled for the machine in some order. However, the packing can be done by company employees in parallel and can start as soon as the food has been labeled. A schedule for the warehouse is an ordering of the food item categories to be labeled by the machine. The preparation time of the schedule is the earliest time by when all the food items have been labeled and packed. Give a polynomial-time algorithm that finds a schedule with a minimum preparation time.
Note: To prove that your greedy strategy yields the optimal solution, you have to prove that the problem has the greedy-choice property.