ArticleslgStudy

computer science

Lawler's algorithm

Lawler's algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lawler's algorithm rather than just read about it. In short: Lawler's algorithm is an efficient algorithm for solving a variety of constrained scheduling problems, particularly single-machine scheduling. It can handle precedence constraints between jobs, requiring certain jobs to be completed before other jobs can be started.

Key takeaways

  • Lawler's algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lawler's algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lawler's algorithm from memory before moving on to harder problems.

Reference excerpt

Lawler's algorithm is an efficient algorithm for solving a variety of constrained scheduling problems, particularly single-machine scheduling. 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, lateness, or any function of them.

Definitions There are n jobs. Each job is denoted by i {\displaystyle i} and has the following characteristics:

Processing-time, denoted by pi; Due time, denoted by d i {\displaystyle d_{i}} . Cost function, denoted by g i {\displaystyle g_{i}} ; it is a weakly-increasing function of the time job i completes its execution, denoted by F i {\displaystyle F_{i}} . The objective function is m i n m a x 0 ≤ i ≤ n g i ( F i ) {\displaystyle min\,max_{0\leq i\leq n}\,g_{i}(F_{i})} . Some special cases are:

When g i ( F i ) = F i − d i = L i {\displaystyle g_{i}(F_{i})=F_{i}-d_{i}=L_{i}} , the objective function corresponds to minimizing the maximum lateness When g i ( F i ) = m a x ( F i − d i , 0 ) {\displaystyle g_{i}(F_{i})=max{(F_{i}-d_{i},0)}} , the objective corresponds to minimizing the maximum 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 = ∑ p j {\displaystyle t=\sum p_{j}} that p j {\displaystyle p_{j}} is the processing time of job j {\displaystyle j} .

S {\displaystyle S} set of already scheduled jobs (at start: S = ∅ {\displaystyle \emptyset } )

J {\displaystyle J} set of jobs whose successors have been scheduled (at start: all jobs without successors)

t {\displaystyle t} time when the next job will be completed (at start: t = ∑ p j {\displaystyle t=\sum p_{j}} ) while J ≠ ∅ {\displaystyle J\neq \emptyset } do select j ∈ J {\displaystyle j\in J} such that f j ( t ) = m i n k ∈ J f k ( t ) {\displaystyle f_{j}(t)=min_{k\in J}f_{k}(t)}

schedule j {\displaystyle j} such that it completes at time t {\displaystyle t}

add j {\displaystyle j} to S {\displaystyle S} , delete j {\displaystyle j} from J {\displaystyle J} and update J {\displaystyle J} . t = t − p j {\displaystyle 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 = {empty}, initially empty set of scheduled jobs J = {t2, t3}, 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 latest, in this example, it is t3 with a due date 8th. move j from J to S's front, now J = {t2}, S={t3}. 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 latest. It is t2 with due date 5th this time. move j from J to S's front, now J = {empty}, S={t2, t3} update J to add any new job whose successors have been scheduled, now J= {t1} since both t2 and t3 have been scheduled. Do the next round:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Lawler's algorithm

Start with the simplest possible case. Write down what Lawler's algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lawler's algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lawler's algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lawler's algorithm

In research
Lawler's algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lawler's algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lawler's algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Optimal scheduling, Production planning, so understanding it makes those chapters shorter.
In everyday life
Look for Lawler's algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Lawler's algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Lawler's algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lawler's algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lawler's algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lawler's algorithm in simple terms?

Lawler's algorithm is an efficient algorithm for solving a variety of constrained scheduling problems, particularly single-machine scheduling. It can handle precedence constraints between jobs, requiring certain jobs to be completed before other jobs can be started.

Why does Lawler's algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lawler's algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lawler's algorithm.

Tags

  • Optimal scheduling
  • Production planning

Keep exploring