Lecture 07: Practice Problems

1. Multitasking

You have one processor and n jobs. Each job requires time t_i. You want to minimize the average completion time.

Greedy Strategy?

Show Answer

Shortest Job First.

Process jobs in increasing order of length.

This minimizes the waiting time for subsequent jobs.

2. Maximum Independent Set (Trees)

Can we use Greedy to find the Maximum Independent Set on a general graph?

Show Answer

No.

This is NP-Hard for general graphs. Greedy heuristics (like pick min-degree node) can fail.

However, for Trees, a greedy approach (process leaves up) works.