ArticleslgStudy

mathematics

Longest-processing-time-first scheduling

Longest-processing-time-first scheduling is a mathematics 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 Longest-processing-time-first scheduling rather than just read about it. In short: Longest-processing-time-first (LPT) is a greedy algorithm for job scheduling. The input to the algorithm is a set of jobs, each of which has a specific processing-time.

Key takeaways

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

Reference excerpt

Longest-processing-time-first (LPT) is a greedy algorithm for job scheduling. The input to the algorithm is a set of jobs, each of which has a specific processing-time. There is also a number m specifying the number of machines that can process the jobs. The LPT algorithm works as follows:

Order the jobs by descending order of their processing-time, such that the job with the longest processing time is first. Schedule each job in this sequence into a machine in which the current load (= total processing-time of scheduled jobs) is smallest. Step 2 of the algorithm is essentially the list-scheduling (LS) algorithm. The difference is that LS loops over the jobs in an arbitrary order, while LPT pre-orders them by descending processing time. LPT was first analyzed by Ronald Graham in the 1960s in the context of the identical-machines scheduling problem. Later, it was applied to many other variants of the problem. LPT can also be described in a more abstract way, as an algorithm for multiway number partitioning. The input is a set S of numbers, and a positive integer m; the output is a partition of S into m subsets. LPT orders the input from largest to smallest, and puts each input in turn into the part with the smallest sum so far.

Examples If the input set is S = {4, 5, 6, 7, 8} and m = 2, then the resulting partition is {8, 5, 4}, {7, 6}. If m = 3, then the resulting 3-way partition is {8}, {7, 4}, {6, 5}.

Properties LPT might not find the optimal partition. For example, in the above instance the optimal partition {8,7}, {6,5,4}, where both sums are equal to 15. However, its suboptimality is bounded both in the worst case and in the average case; see Performance guarantees below. The running time of LPT is dominated by the sorting, which takes O(n log n) time, where n is the number of inputs.

LPT is monotone in the sense that, if one of the input numbers increases, the objective function (the largest sum or the smallest sum of a subset in the output) weakly increases. This is in contrast to Multifit algorithm.

Performance guarantees: identical machines When used for identical-machines scheduling, LPT attains the following approximation ratios.

Worst-case maximum sum In the worst case, the largest sum in the greedy partition is at most 4 3 {\displaystyle {\frac {4}{3}}} times the optimal (minimum) largest sum. A more detailed analysis yields a factor of 4 m − 1 3 m = 4 3 − 1 3 m {\displaystyle {\frac {4m-1}{3m}}={\frac {4}{3}}-{\frac {1}{3m}}} times the optimal (minimum) largest sum. (for example, when m =2 this ratio is 7 / 6 ≈ 1.167 {\displaystyle 7/6\approx 1.167} ). The factor 4 m − 1 3 m {\displaystyle {\frac {4m-1}{3m}}} is tight. Suppose there are 2 m + 1 {\displaystyle 2m+1} inputs (where m is even): 2 m − 1 , 2 m − 1 , 2 m − 2 , 2 m − 2 , … , m + 1 , m + 1 , m , m , m {\displaystyle 2m-1,2m-1,2m-2,2m-2,\ldots ,m+1,m+1,m,m,m} . Then the greedy algorithm returns:

2 m − 1 , m , m {\displaystyle 2m-1,m,m}

2 m − 1 , m {\displaystyle 2m-1,m}

2 m − 2 , m + 1 {\displaystyle 2m-2,m+1}

2 m − 2 , m + 1 {\displaystyle 2m-2,m+1} , ...

3 m / 2 , 3 m / 2 − 1 {\displaystyle 3m/2,3m/2-1}

3 m / 2 , 3 m / 2 − 1 {\displaystyle 3m/2,3m/2-1}

with a maximum of 4 m − 1 {\displaystyle 4m-1} , but the optimal partition is:

m , m , m {\displaystyle m,m,m}

2 m − 1 , m + 1 {\displaystyle 2m-1,m+1}

2 m − 1 , m + 1 {\displaystyle 2m-1,m+1}

2 m − 2 , m + 2 {\displaystyle 2m-2,m+2}

2 m − 2 , m + 2 {\displaystyle 2m-2,m+2}

...

3 m / 2 , 3 m / 2 {\displaystyle 3m/2,3m/2}

with a maximum of 3 m {\displaystyle 3m} .

Input consideration An even more detailed analysis takes into account the number of inputs in the max-sum part.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Longest-processing-time-first scheduling

Start with the simplest possible case. Write down what Longest-processing-time-first scheduling claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, 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 Longest-processing-time-first scheduling 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 Longest-processing-time-first scheduling 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 Longest-processing-time-first scheduling

In research
Longest-processing-time-first scheduling appears in mathematics 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 Longest-processing-time-first scheduling 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
Longest-processing-time-first scheduling is common in secondary-school and first-year university syllabi. It links to neighbouring topics Number partitioning, Scheduling algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Longest-processing-time-first scheduling 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.

Affiliate

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

How to study Longest-processing-time-first scheduling in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Longest-processing-time-first scheduling 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 Longest-processing-time-first scheduling out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Longest-processing-time-first scheduling in simple terms?

Longest-processing-time-first (LPT) is a greedy algorithm for job scheduling. The input to the algorithm is a set of jobs, each of which has a specific processing-time.

Why does Longest-processing-time-first scheduling matter?

Because it connects several mathematics 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 Longest-processing-time-first scheduling?

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 Longest-processing-time-first scheduling.

Tags

  • Number partitioning
  • Scheduling algorithms

Keep exploring