Notes/UNB/Year 5/Semester 2/CS3383/Tutorial Notes.md

13 lines
639 B
Markdown
Raw Normal View History

2025-01-22 10:10:40 -04:00
# Schedule Problem
2025-01-22 13:41:46 -04:00
A single server has n customers to serve. The sere time t_i required by each customer i is known in advance. Goal is to minimize T, the time in the system for customer i.
2025-01-22 10:10:40 -04:00
For example, t_1=5, t_2=10, t_3=3. Schedule 1: 123, Schedule 2: 231
Input: The set C of all customers C = { t_1, ... }. t_i is the service time for customer i
Output: The total time in the system for all customers
Merge Sort C in ascending order. A greedy solution works in this case.
We can simply run through the sorted list and serve them in order.
2025-01-22 10:20:35 -04:00
But if we assume the greedy algorithm is not optimal in this case
Try to reduce total time T