Easier solution for schedule-with-completion-duration.md

Author: spike1236Created Jan 29, 2026Updated Mar 7, 2026
Labelsenhancement

There exists an easier solution for schedule-with-completion-duration.md. First, sort the jobs by their deadlines. Now, assume we took some set of jobs $S$ that we plan to complete, and our strategy is to start next job right after completing previous job (we start the first job at $T=0$). We traverse jobs in ascending order of their deadline, and suppose we can't take current job $i$ because $\sum_{j \in S} t_j + t_i > d_i$. We then just drop the job with the highest duration in $S \cup ${i} (could be $i$ which means we skip it) and continue.

Source: cp-algorithms/cp-algorithms