Problem: Given N tasks with potentially non-unique deadlines d1,...,dN and time needed t1,...,tN to complete each one (in hours), output a schedule that maximizes the number of deadlines met. Only 1 task can be worked on at any time.
Is there an efficient algorithm for this problem? I seems like a slight modification to the task scheduling problem (n tasks, n deadlines, each task takes 1 unit of time, 1 task at a time), which has an efficient greedy algorithm (do unexpired task with nearest deadline).
I am thinking the following DP algorithm might be optimal:
Subproblem: f(i, t) is maximum # deadlines meetable given tasks i...|T| to choose from, and start time is t
Recurrence: f(i, t) = max(f(i+1, t+ti), f(i+1, t))
Runtime: O(|T|*max(di))
Is this algorithm even efficient (would the runtime be considered polynomial)? If not, is there another efficient algorithm?