0% found this document useful (0 votes)
65 views16 pages

Simple Dispatch Rules: Greedy Algorithms

EDD no longer optimal. Need to consider release dates.

Uploaded by

Tobalyntilang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views16 pages

Simple Dispatch Rules: Greedy Algorithms

EDD no longer optimal. Need to consider release dates.

Uploaded by

Tobalyntilang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Simple Dispatch Rules

• We will first look at some simple dispatch rules: algorithms for which
the decision about which job to run next is made based on the jobs
and the time (but not on the history of jobs running, or by computing
tentative schedules).
• These are also called greedy algorithms.

Goals:
• To recognize when simple dispatch rules apply.
• To prove that they are the correct algorithm.
• To analyze the running time of the algorithm.
1|| P Cj

Example:
j pj
1 5
2 3
3 10
4 8
5 4

Questions:
• What is the right algorithm?
• What is its running time?
• How do we prove it?
1|| P Cj

Example:
j pj
1 5
2 3
3 10
4 8
5 4

Questions:
• What is the right algorithm? – SPT
• What is its running time?
• How do we prove it?
1|| P Cj

Example:
j pj
1 5
2 3
3 10
4 8
5 4

Questions:
• What is the right algorithm?– SPT
• What is its running time? – O(n log n)
• How do we prove it?
1|| P Cj

Example:
j pj
1 5
2 3
3 10
4 8
5 4

Questions:
• What is the right algorithm?– SPT
• What is its running time? – O(n log n)
• How do we prove it? – Interchange Argument
Basic format of an interchange argument

• Specify the simple dispatch rule X.


• Assume, for the purposed of contradiction, that you have an optimal
schedule that does not obey the rule X.
• Find two specific jobs j and k that violate rule X.
• Show that if you interchange jobs j and k , then
– The resulting schedule is still feasible.
– The objective function value does not increase (for a minimization
problem).
• You can then conclude that, via repeated swaps, there must exist an
optimal schedule that satisfied rule X.

Comment: Even though the proof is boilerplate, you must provide enough
mathematical detail that shows that your proof applies to the particular
problem and the particular rule!
1|| P wj Cj

j pj wj
1 1 1
Example: 2 3 2
3 7 1
4 10 20

Questions:
• How can we figure out a simple dispatch rule?
• How do we prove it is correct – Exchange Argument
1|| P wj Cj

Example:
j pj wj
1 1 1
2 3 2
3 7 1
4 10 20

Questions:
• How can we figure out a simple dispatch rule?
• How do we prove it is correct – Exchange Argument

Two answers to first question;


• Experiment with small examples and develop a plausible rule.
• Start an exchange argument and see what you need to make it work.
WSPT, Smith’s rule

• Want to have large weight, small processing time jobs early


• Schedule jobs in decreasing order of wj /pj .
Problems with Deadlines

Deadlines
• Can be hard (deadlines) or soft (due dates).
• Model Real Time scheduling.

Example 1
j pj dj
1 2 25
2 4 13
3 6 6
4 7 19
5 10 29

Example 2
j pj dj
1 1 5
2 3 6
3 6 7
4 4 15
EDD - Earliest Due date

a.k.a. EDF - Earliest deadline first.

Theorem If, for an instance, on one machine with processing times and
deadlines, there is a schedule meeting all deadlines, then EDF meets all
deadlines.
What if you can’t meet all deadlines:

• One metric: lateness Lj = Cj − dj


• 1||Lmax
• Interpretation: if Lmax is 4, then there is a schedule in which no job
misses its deadline by more than 4 time units.

Question: Does EDD minimize Lmax ?

Answer:
What if you can’t meet all deadlines:

• One metric: lateness Lj = Cj − dj


• 1||Lmax
• Interpretation: if Lmax is 4, then there is a schedule in which no job
misses its deadline by more than 4 time units.

Question: Does EDD minimize Lmax ?

Answer: YES
• Reason 1. Think about Lmax = t as extending all deadlines by t .
• Reason 2. Interchange argument.
Adding Release Dates. 1|rj |Lmax

Question: Does EDD still produce an optimal schedule?


j rj pj dj
1 4 1 5
2 0 4 6
Maybe some other dispatch rule still works?

j rj pj dj
1 0 5 11
Example 1
2 4 1 6
3 5 1 6

j rj pj dj
1 0 5 11
Example 2
2 4 1 6
3’ 6 1 7
Adding release dates to a completion time problem.

1|rj | Cj
X

j rj pj
Example 1 1 0 100
2 40 1

j rj pj
1 0 100
Example 2
2 40 1
3 101 1

You might also like