Greedy Algorithms8 sections · 316 units
Open in Course

IPO - Greedy Insight

enable then maximize

The greedy insight: among all projects you can afford, always pick the one with highest profit. Why? Picking a higher profit project gives you more capital.

More capital enables more projects for future rounds. There is no downside to taking the best available option. The challenge is efficiently finding projects you can afford. Use a min-heap by capital requirement and a max-heap by profit.