I suppose the penalty when a job misses its deadline is a constant w_j that depends on the job j but not on its lateness value.
In the general case the problem is NP Hard (it is 1||sum_j w_j U_j
in the classical alpha|beta|gamma
notation). It is polynomial in the special case all weights w_j are equal (minimizing number of late jobs).
You can probably find many very efficient problem-specific algorithms to solve this particular problem. If you are interested in generic formulations to solve this problem you could try CP Optimizer [1], in OPL the formulation to solve it would read like:
int n = ...;
int dd[j in 1..n] = ...; // Deadline for job j
int pt[j in 1..n] = ...; // Processing time for job j
float w[j in 1..n] = ...; // Penalty for late job j
dvar interval job[j in 1..n] size pt[j]; // Decision variables
minimize sum(j in 1..n) ( w[j]*(endOf(job[j])>=dd[j]) );
subject to {
noOverlap(all(j in 1..n) job[j]);
}
Here is an even better formulation in CP Optimizer exploiting the notion of optional interval variable: you maximize the waited sum of executed intervals/activities that are constrained to end before the deadline:
int n = ...;
int dd[j in 1..n] = ...; // Deadline for job j
int pt[j in 1..n] = ...; // Processing time for job j
float w[j in 1..n] = ...; // Penalty for late job j
dvar interval job[j in 1..n] optional in 0..dd[j] size pt[j]; // Decision variables
minimize n - sum(j in 1..n) ( w[j]*presenceOf(job[j]) );
subject to {
noOverlap(all(j in 1..n) job[j]);
}
[1] P. Laborie, J. Rogerie, P. Shaw, P. Vilím. IBM ILOG CP optimizer for scheduling. Constraints Journal. April 2018, Volume 23, Issue 2, pp 210–250. http://ibm.biz/Constraints2018.