惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
H
Help Net Security
I
InfoQ
月光博客
月光博客
量子位
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
D
DataBreaches.Net
宝玉的分享
宝玉的分享
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a shift schedule generator taught me that schedu...
Mark · 2026-05-09 · via DEV Community

I recently built a small tool called Shift Schedule Maker.

At first, I thought shift scheduling would be a fairly straightforward problem.

You have employees.
You have shifts.
You assign people to shifts.

That sounds like a simple table.

But once I started building it, I realized scheduling is less like filling out a calendar and more like solving a constraint problem.

A valid schedule is not necessarily a good schedule.

For example, the system has to think about things like:

  • Does every shift have enough people?
  • Is anyone assigned to two overlapping shifts?
  • Is someone working too many days in a row?
  • Are night shifts distributed fairly?
  • Are weekends always falling on the same person?
  • What happens when one person is unavailable?
  • Can the schedule still work if the team size is small?

The tricky part is that these rules often conflict with each other.

You might want perfect fairness, but still need full coverage.
You might want to respect everyone’s availability, but only have a limited number of people.
You might want a simple repeating pattern, but real-life exceptions break the pattern very quickly.

That made me think about scheduling differently.

Instead of treating it as a calendar UI problem, I started treating it as a constraint-solving problem.

Each shift becomes a slot that needs to be filled.
Each employee has limits, availability, and workload history.
Each rule adds pressure to the system.

Some rules are hard constraints:

  • A person cannot work two shifts at the same time.
  • A shift cannot be left uncovered.
  • An unavailable employee should not be assigned.

Other rules are softer:

  • Try to balance total working hours.
  • Try to distribute unpopular shifts.
  • Try to avoid too many consecutive workdays.
  • Try to keep the result understandable for a human manager.

That last part is easy to underestimate.

A schedule can be mathematically valid and still feel wrong.

For example, if one person gets all the night shifts, the algorithm might still satisfy coverage. But from a team perspective, the result is bad. So the goal is not just “generate something that works.” The goal is to generate something that feels reasonable.

Another challenge was templates.

Many industries already use known rotation patterns, like 12-hour shifts, 4-on/2-off, Pitman-style schedules, or 2-2-3 rotations. These patterns are useful because they give structure. But once you add employee availability or custom rules, the template becomes only the starting point.

So the product became a mix of two ideas:

  1. Start with common scheduling patterns.
  2. Adjust the actual result based on constraints and fairness rules.

I’m still improving the logic, especially around edge cases where the input is technically possible but very tight.

For example, if there are too few employees for too many required shifts, the system should not simply fail. It should explain what is making the schedule difficult.

That is probably the most interesting part of the project so far: not just generating the schedule, but helping people understand why a schedule is hard to generate.

I made the tool public here:

https://shiftschedulemaker.net/

It is still evolving, but building it has made me appreciate how much hidden complexity exists behind something as ordinary as a weekly shift calendar.

Curious if anyone here has worked on scheduling, constraint solving, workforce planning, or optimization problems.

How would you approach fairness in a scheduling system?