Lawler's Algorithm
   HOME

TheInfoList



OR:

Lawler's algorithm is an efficient algorithm for solving a variety of constrained scheduling problems, particularly
single-machine scheduling Single-machine scheduling or single-resource scheduling is an optimization problem in computer science and Operations Research, operations research. We are given ''n'' jobs ''J''1, ''J''2, ..., ''Jn'' of varying processing times, which need to be sc ...
. It can handle precedence constraints between jobs, requiring certain jobs to be completed before other jobs can be started. It can schedule jobs on a single processor in a way that minimizes the maximum
tardiness Tardiness is the habit of being late or delaying arrival. Being late as a form of misconduct may be formally punishable in various arrangements, such as workplace, school, etc. An opposite personality trait is punctuality. Workplace tardiness ...
,
lateness Late may refer to: * LATE, an acronym which could stand for: ** Limbic-predominant age-related TDP-43 encephalopathy, a proposed form of dementia ** Local-authority trading enterprise, a New Zealand business law ** Local average treatment effect, ...
, or any function of them.


Definitions

There are ''n'' jobs. Each job is denoted by i and has the following characteristics: * Processing-time, denoted by ''pi''; * Due time, denoted by ''d_i''. * Cost function, denoted by ''g_i''; it is a weakly-increasing function of the time job ''i'' completes its execution, denoted by ''F_i''. The
objective function In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cos ...
is min \, max_ \, g_i(F_i).Joseph Y-T. Leung. Handbook of scheduling: algorithms, models, and performance analysis. 2004. Some special cases are: * When g_i (F_i) = F_i - d_i = L_i, the objective function corresponds to minimizing the maximum
lateness Late may refer to: * LATE, an acronym which could stand for: ** Limbic-predominant age-related TDP-43 encephalopathy, a proposed form of dementia ** Local-authority trading enterprise, a New Zealand business law ** Local average treatment effect, ...
* When g_i (F_i) = max , the objective corresponds to minimizing the maximum
tardiness Tardiness is the habit of being late or delaying arrival. Being late as a form of misconduct may be formally punishable in various arrangements, such as workplace, school, etc. An opposite personality trait is punctuality. Workplace tardiness ...
.


Algorithm

The algorithm builds the schedule back to front. For each scheduling step, it looks only at the tasks that no other tasks depend on, and puts the one with the latest due date at the end of the schedule queue. Then it repeats this process until all jobs are scheduled. The algorithm works by planning the job with the least impact as late as possible. Starting at t = \sum p_j that p_j is the processing time of job j. S set of already scheduled jobs (at start: S = \emptyset) J set of jobs whose successors have been scheduled (at start: all jobs without successors) t time when the next job will be completed (at start: t = \sum p_j) whileJ \neq \emptyset do select j \in J such that f_j(t) = min_f_k(t) schedule j such that it completes at time t add j to S, delete j from J and update J. t = t - p_j end while


Example 1

Assuming there are three jobs: t1, t2, and t3, with the following precedence constraints: * t1-> t2, t1 must finish before t2 * t1-> t3, t1 must finish before t3 And the following deadlines (due date in a month) * t1: 2nd day * t2: 5th day * t3: 8th day Now we construct the required set of jobs: * S = , initially empty set of scheduled jobs * J = , the set of jobs whose successors have been scheduled or jobs without successors. t2 and t3 have no successors. Repeat the following steps until J is empty: * select a job j in J, so its due date is the latests, in this example, it is t3 with a due date 8th. * move j from J to S's front, now J = , S=. * update J to add any new job whose successors have been scheduled. There is none this time. Do the next round: * select a job j in J, so its due date is the latests. It is t2 with due date 5th this time. * move j from J to S's front, now J = , S= * update J to add any new job whose successors have been scheduled, now J= since both t2 and t3 have been scheduled. Do the next round: * select a job j in J=, so its due date is the latests. This example, it is t1. * move j from J to S's front, now J = , S= * update J to add any new job whose successors have been scheduled. Nothing to add. J is now empty. The end. So the final schedule is t1 -> t2-> t3 as S =


Example 2

A more complex example, with simplified steps: The jobs and precedence constraints are shown below: a parent node --> child node in the tree.
      j1 
     (2) 
    /   \
   j2    j3 
  (2)    (4)
  / \     , 
 j4 j5   j6
(3) (5)  (6)  
The due dates of jobs are shown underneath of each node of the tree in parentheses. * j1: 2 * j2: 5 * j3: 4 * j4: 3 * j5: 5 * j6: 6 Now look at the set of jobs without any successors, find the one with latest due date, put it into the front of S: * The S set would be


References


Further reading

* Michael Pinedo. Scheduling: theory, algorithms, and systems. 2008. * Conway, Maxwell, Miller. Theory of Scheduling. 1967. {{Scheduling problems Production planning Optimal scheduling