
Lecture 6 - Management Science
Operations Manager’s Friday Crisis:
“It’s Friday at 06:00 in the morning. We just received 16 custom bicycle orders that must be completed by this evening. Two workstations. Rush orders with penalties. Overtime costs €100/hour after Friday 19:00. How do we schedule production to minimize costs?”
Custom Cycles faces multiple scheduling decisions:
The Stakes: With 16 orders totaling 13+ hours of work, wrong scheduling could mean €1000+ in overtime and penalties!
Question: With 16 bicycle orders to sequence, how many possible schedules exist?
16! = 20,922,789,888,000 possible schedules
Number of Orders
Possible Schedules
Testing all 20.9 trillion possibilities for 16 bikes would take thousands of years on a modern computer!
Look at these 4 bicycle orders. Which should we build first?
| Order | Arrival | Processing | Due | Penalty |
|---|---|---|---|---|
| B12 | 1st | 90 min | 180 min | €150 |
| B08 | 2nd | 45 min | 280 min | €150 |
| B15 | 3rd | 75 min | 220 min | €150 |
| B03 | 4th | 30 min | 300 min | €150 |
Question: How would you proceed here?
This is the greedy choice problem: Which local decision leads to the best global outcome?
Greedy algorithms make the locally optimal choice at each step.
The Idea: “Take what looks best right now, don’t look back”
Algorithmic strategy that builds solutions piece by piece
Core Philosophy:
You already use greedy thinking daily!
Common Greedy Decisions:
Question: Which of these actually gives the optimal solution?
Not all greedy algorithms are optimal
Greedy IS Optimal:
Greedy FAILS:
For greedy to be optimal, we need:
1. Greedy Choice Property
2. Optimal Substructure

For 16 bikes: Exhaustive = 20 trillion operations, Greedy = 64 operations!
We’ll explore three greedy approaches that manufacturing uses:
Question: Just as first feeling. Which rule would you use for the bike factory with penalties and overtime costs?
Process jobs in the order they arrive, no prioritization.
Like scheduling job interviews when all candidates applied at different times: You interview in application order to be fair, even if some candidates are stronger.

See the pattern? We just do patient A, then patient B, then patient C, then patient D.
The Idea: Process quickest job next to maximize throughput.
Like answering emails: Respond to quick 1-minute replies first, then tackle the complex ones requiring research so more people get helped faster.

However, not all customers might be willing to wait longer for their orders!
The Idea: Jobs by deadline order to tackle urgent work first.
Like grading assignments: Grade the papers due back tomorrow before the ones due next week so students get feedback when promised.

Note, that we only minimize maximal lateness here!
Let’s code it together - it’s remarkably simple!
Let’s assume we want to make some pizzas under deadlines.
Question: How should we proceed for SPT?
SPT Schedule:
P3: due 25, done 6
P2: due 15, done 14
P1: due 20, done 24
P5: due 30, done 36
P4: due 20, done 51
Easy, right? Just one line of Python! sorted() with a key function. Greedy algorithms are often simple to implement.
EDD is just as simple - change the sorting key!
EDD Schedule:
P2: due 15, done 8
P1: due 20, done 18
P4: due 20, done 33
P3: due 25, done 39
P5: due 30, done 51
Question: Can you modify this to implement FIFO?
Now let’s compare all three rules on the same dataset
Scenario: 4 rush bike orders arrive with conflicting priorities
| Order | Arrival | Processing | Due | Penalty |
|---|---|---|---|---|
| B12 | 1st | 90 min | 180 min | €150 |
| B08 | 2nd | 45 min | 280 min | €150 |
| B15 | 3rd | 75 min | 220 min | €150 |
| B03 | 4th | 30 min | 300 min | €150 |
Question: How would we schedule for each rule?

No single rule is always best! The right choice depends on your objectives, which might include fairness, throughput, deadlines and much more.
1. Priority Classes:
IF order.type == "Rush":
schedule using EDD
ELSE:
schedule using SPT
2. Time-Based Switching:
IF current_time < 3pm:
use SPT (maximize throughput)
ELSE:
use EDD (meet end-of-day deadlines)
3. Threshold Rules:
IF (due_date - current_time) < 30 minutes:
prioritize this order (emergency mode)
ELSE:
use normal SPT rule
Question: Any questions up until here?
Where scheduling algorithms appear in practice
Project Management:
Software Development:
Operations & Manufacturing:
Transportation & Logistics:
Healthcare:
If we formalize these:
If we look at several of these:
Question: In which context would you use each metric?
Different objectives require different metrics
Business Context Matters:
You can’t optimize what you don’t measure! Choose metrics that align with business goals.
Matching metrics to business context
| Business Goal | Metric to Optimize | Best Rule |
|---|---|---|
| Reduce customer wait time | Avg Flow Time | SPT |
| Meet all deadlines | Max Lateness | EDD |
| Minimize contract penalties | Total Tardiness | EDD |
| Maximize throughput | Makespan | Any (same!) |
| Customer satisfaction | Number Late | EDD |
| Fairness/transparency | (none) | FIFO |
5 consulting projects with different durations and revenues
| Project | Duration | Revenue | Revenue/Hour |
|---|---|---|---|
| C | 55h | €11,000 | €200 |
| A | 25h | €6,000 | €240 |
| E | 55h | €4,950 | €90 |
| D | 45h | €5,400 | €120 |
| B | 35h | €7,000 | €200 |
Goal: Maximize revenue during limited consulting time
Question: Sort by total revenue? Duration? Or something else?
Rule: Sort by revenue per hour (descending)
Sorted by Revenue/Hour:
| Project | Duration | Revenue | Revenue/Hour | Schedule |
|---|---|---|---|---|
| A | 25h | €6,000 | €240 | 1st |
| B | 35h | €7,000 | €200 | 2nd |
| C | 55h | €11,000 | €200 | 3rd |
| D | 45h | €5,400 | €120 | 4th |
| E | 55h | €4,950 | €90 | 5th |
Optimal order: A → B → C → D → E
Maximizing early revenue in capacity-constrained situations
Scenario: 120 hours of consulting capacity this quarter
This is Smith’s Rule in action: Sort by (value / time) to maximize weighted completion!
Most manufacturing involves multiple stages
Flow Shop: Jobs must visit machines in the same order
Key difference from single-machine: Machine 2 must wait for Machine 1 to finish each job. This creates idle time and blocking.
3 Bicycles through Assembly → Painting
| Bike | Assembly Time | Painting Time | Total |
|---|---|---|---|
| X | 30 min | 20 min | 50 |
| Y | 20 min | 30 min | 50 |
| Z | 15 min | 15 min | 30 |
Question: If we process in order X → Y → Z, what happens?

Painting station waits 30 minutes for first bike! Total time = 95 minutes
Each rule has ambiguities in two-stage problems
SPT - Shortest Processing Time:
EDD - Earliest Due Date: Doesn’t minimize idle time or makespan
FIFO: Arbitrary order, no optimization
Question: Is there a better approach for minimizing makespan?
Why does Johnson’s work? Let’s understand the logic first
Think about bottlenecks in a two-stage flow:
Key Observation:
Four simple steps to optimal scheduling
Johnson proved this greedy choice property guarantees global optimum for makespan in 2-machine flow shops!
Let’s apply this to our 3 bikes…
| Bike | Assembly | Painting | Min Time |
|---|---|---|---|
| X | 30 | 20 | 20 (P) |
| Y | 20 | 30 | 20 (A) |
| Z | 15 | 15 | 15 (A/P) |
Easy, right?

10-minute improvement! (85 vs 95) - 10.5% faster with optimal ordering
What about 3+ machines?
Bad news:
Good news:
How scheduling changes with job arrivals
Static (Offline):
Dynamic (Online):
Question: Any ideas about complications in dynamic environments?
Question: Any other real world considerations?
Learn from others’ errors - avoid these pitfalls!
Question: Any idea what could be common mistakes?
Mistake #1: Ignoring Setup Times
Learn from others’ errors - avoid these pitfalls!
Mistake #2: Static Scheduling with Dynamic Arrivals
Learn from others’ errors - avoid these pitfalls!
Mistake #3: Optimizing the Wrong Metric
When scheduling breaks down completely
What is Thrashing?
Question: Do you know this from your personally?
How to recognize when you’re thrashing
Individual Level:
Strategic approaches to maintain productivity
Strategic Solutions:
Hour 2: This Lecture
Hour 3: Notebook
Hour 4: Competition
The Bike Factory Crisis
Choose the right trade-off for the business context!
The Rules of Greedy Scheduling
Greedy algorithms are about smart trade-offs
The Advantage:
The Challenge:
Take 20 minutes, then we start the practice notebook
Next up: You’ll become Bean Counter’s scheduler
Then: The Bike Factory Crisis competition
Smart Quick Decisions | Dr. Tobias Vlćek | Home