Greedy Algorithms8 sections · 316 units
Open in Course

Activity Selection - Inductive Step

Maintaining the lead

Inductive hypothesis: After kk activities, greedy's kk-th activity ends at time gkg_k, and OPT's kk-th activity ends at time oko_k, with gkokg_k \leq o_k.

Inductive step: After greedy picks its (k+1)(k+1)-th activity: Greedy picks the earliest-ending activity that starts after gkg_k. OPT picks some activity that starts after oko_k. Since gkokg_k \leq o_k, any activity OPT can pick, greedy could also consider (it starts late enough). But greedy picks the earliest-ending one. So gk+1ok+1g_{k+1} \leq o_{k+1}. Greedy stays ahead.