Minimum Platforms
GreedyMediumDetermine the minimum platforms needed to prevent train schedule waiting overlaps.
Alt+Shift+M
Configuration Panel
Parallel Track Platform Routing Timeline
Timeline is empty.
Time Complexity
O(N log N) sorting + O(N) sweep
Space Complexity
O(N) mapping buffers
Conceptual Overview
The Minimum Platforms problem finds the minimum number of platforms required for a railway station so that no train has to wait, assuming arrival and departure schedules are fixed.
Greedy Choice Property
Sort arrival and departure events independently in ascending order. Process events chronologically: if arrival, increment platform count; if departure, decrement platform count.
Optimal Substructure
The peak number of overlapping train intervals represents the minimum platforms required at any instant in the global schedule.
Proof Idea / Correction
Proof by sweep-line: a railway station cannot hold more trains than the peak overlapping count without collision, so at least Peak platforms are required.
Source: CP-Algorithms greedy reference