The Algorithmic Codification of the Swiss Employment Act: Engineering Fair Scheduling Through Constraint Optimization
A behind-the-scenes look at how Plantime's compliance engine mathematically optimizes for labor law compliance — encoding the Swiss Employment Act's working-hour limits, rest periods, and Sunday-work rules directly into a fully customizable constraint optimization loop.
July 28th, 2026 · 3 min read
Translating intricate labor mandates into an automated shift scheduling engine is one of our most exciting engineering challenges. Here is a practical, behind-the-scenes look at how our algorithm mathematically optimizes for labor law compliance to protect you and your team.
Crucially, while the specific times, shift limits, and day counts detailed below reflect the baseline requirements of the Swiss Employment Act, Plantime's compliance engine is fully customizable. Every parameter can easily be adjusted by the user to seamlessly adapt to their specific local, regional, or industry-specific labor laws.
1. Working Hours and Time Limits
Maximum Weekly Working Time (Article 9)
Human fatigue doesn't magically reset on Monday mornings. That's why Plantime continuously calculates a worker's target workload over a rolling seven-day timeframe. If an employee's assigned hours exceed their maximum statutory limit, our system immediately flags the schedule and applies a strict penalty, encouraging the algorithm to find a better solution.
Daytime and Evening Work (Article 10)
Swiss law defines a "standard" workday window between 6:00 AM and 11:00 PM (a 17-hour block). Our scheduling engine actively tracks and penalizes unauthorized "Night work" for any shift falling outside of these standard daytime parameters.
Furthermore, an individual and a global maximum timespan is enforced:
-
The 14-Hour Individual Span: The system enforces a strict 14-hour limit for the starting and finishing times of any individual adult employee. If the chronological span of all shifts and breaks in a single day exceeds this duration for a specific worker, the schedule gets deducted points during its evaluation.
-
The 17-Hour Global Span: We simultaneously enforce an enterprise-wide "Global Span" limit of 17 hours per day (the legal limit for daytime and evening work without requiring special night work authorization), heavily penalizing schedule plans where the total spread of all facility shifts combined exceeds this boundary.
2. Rest Periods
Daily Rest Periods (Article 15a)
Our software tracks daily rest by identifying chronological gaps between consecutive shifts. For the Swiss Employment Act this means identifying 11 consecutive hours of daily rest.
3. Sunday Work and Compensation
Sunday Work (Articles 18 & 19)
Sundays are heavily protected. Our engine identifies all weekend shifts in the schedule matrix and applies cascading penalties if work is scheduled without simultaneously meeting specific compensatory rest criteria.
Compensatory Rest (Article 20)
When Sunday work is required, Plantime's algorithm branches depending on the exact duration of the shift:
-
Work > 5 hours: The software initiates a forward and backward search for a 35-hour uninterrupted rest period that must legally encompass the core daytime hours of 6:00 AM to 8:00 PM.
-
Work ≤ 5 hours: The algorithm looks for equivalent time off (i.e. specifically, a recognizable schedule gap of at least the exact hours worked) strictly within the following four weeks.
Free Sundays (Article 20)
To prevent long-term weekend burnout, the platform implements a rigorous rule for "Alternating Weekends." We penalize the schedule plan heavily if a worker does not have at least one full Sunday completely off in an overlapping three-week window following a Sunday shift.
By embedding these customizable rules directly into our continuous optimization engine, Plantime balances compliance adherence with fair and efficient scheduling. Whether you are taking into account the 14-hour span of Swiss law or a localized 10-hour span in your home city, our algorithm easily adapts to keep your scheduling safe and easy.
Works Cited
- Beyond the Schedule: How Plantime's Evolutionary Engine Fixes Shift Work
- Work and rest period — SECO, accessed on July 28, 2026