Back to Schedule System

Schedule Generation System

A constraint solver (OR-Tools CP-SAT) finds the proven-optimal schedule in seconds

Excel for input and output. Python for thousands of comparisons.

~1 sec
Generate schedule
(patterns assigned)
seconds
The proven-optimal
schedule

50 employees, local processing

The Typical Challenge

Current Process

  • • 50 employees to schedule
  • • 20 shifts per employee = 1,000 manual Excel entries
  • • Varying demand throughout month (e.g. more during day than night)
  • • Employee vacation periods

What Happens

  • • Manager creates schedule manually
  • • After completion: schedule doesn't match production demand
  • • Start over, repeat many times
  • • Result: scattered schedules, dissatisfied employees

Why is This Difficult?

Thousands of possible combinations (patterns + shifts)

Balance between demand and cost

Constraints (vacations, preferences)

How the System Works

Let Python Do the Comparison

You define patterns in Excel. The solver proves the best assignment — it doesn't try them one by one.

1

Excel Input

Define shift patterns, employees, vacations, production demand

2

Generate Patterns

Python creates schedule for each employee per pattern

3

Prove the Optimum

CP-SAT proves the best assignment (patterns + shifts)

4

Select Best

Finds combination that best matches demand

Processing Time

Scenario 1: Patterns Assigned

When you've chosen pattern for each employee:

~1 sek

Just generate schedule

Scenario 2: Optimization

When the system finds the proven-best solution:

seconds

CP-SAT proves the best assignment

Detailed Workflow

What Happens When You Click "Analyze"

1

Python reads Excel file

Retrieves shift patterns, employee list (with vacations), production demand per day/hour

2

For each combination

Python tries: Employee A gets pattern 1 with shift 0, Employee B gets pattern 2 with shift 3, etc.

3

Creates schedule for each employee

According to pattern (e.g. 7 days work, 3 days off) and shift. Considers vacations (no shifts during vacation). ~1 sec for 50 employees

4

Sums all schedules

Creates schedule for entire team: how many employees work each day/hour

5

Compares with production demand

Calculates deviation: how much schedule matches demand (e.g. need 10 employees during day, schedule gives 8)

The solver handles steps 2-5 in a single model

CP-SAT proves the assignment with the smallest deviation (best match to demand) — or the best possible within a fixed time budget. This takes seconds for 50 employees with 3 patterns.

How Can the Best Be Proven So Fast?

Creating one schedule is fast (~1 sec). Finding the best one looks like it needs astronomically many tries — but the solver proves it directly instead of trying them one by one.

Shift Pattern Example

Excel Setup

work_days break_days start_hour end_hour
7 3 6 14
6 4 14 22
5 2 22 6

These are three different patterns you can create in Excel

What This Means

Pattern 1: Work 7 days (6AM-2PM), then 3 days off

Pattern 2: Work 6 days (2PM-10PM), then 4 days off

Pattern 3: Work 5 days (10PM-6AM), then 2 days off

System tries all combinations: Which employee gets which pattern, and with how much shift offset (0, 1, 2, 3... days).

Why So Many Combinations?

With 3 patterns and 50 employees:

  • Each employee can get one of 3 patterns
  • Each pattern can be shifted 0-9 days
  • Possible combinations per employee: 3 × 10 = 30

Total combinations: 3050 ≈ 7 × 1073

Far too many to try one by one — but the solver (OR-Tools CP-SAT) proves the optimum directly, in seconds.

Cost Calculation

What's Included in Calculation

Regular Hours

Day work × base hourly rate

Evening/Night Work

Premium pay for evening and night shifts

Holidays

Increased pay for work on public holidays

Overtime

Hours beyond regular work period

Output for Each Schedule

  • Total hours per employee
  • Breakdown: regular/evening/night/holiday hours
  • Total cost per employee
  • Total cost for entire team
  • Comparison with production demand (deviation)

Key Features

Unlimited Patterns

Create as many shift patterns as needed

Vacation Handling

Automatic consideration of employee vacations

Demand Comparison

Automatic comparison with production requirements

Cost Calculation

Total calculation incl. overtime and premiums

Excel

Familiar interface, easy to modify

Python

Powerful analysis, works on all systems

You define the patterns

You define the shift patterns yourself — so union rules are encoded up front. With a fixed vendor product, adding a rule means a paid modification.

Summary

~1 sek

Generate schedule (patterns set)

seconds

Prove the optimum

Excel

Familiar interface

Want to Try the System?

Download sample or contact for more information

Excel Sample

Ready with patterns and employee list

Local Processing

Python script that runs on your machine

Questions?

Contact for assistance

Get in Touch

Phone: +354 782 3011 | Darius Domagala