GenerateRandomSearch

Random Shift Assignment Generator

Assigns people to shifts where each shift needs a particular number of staff, and lets you record who cannot work a given shift and who has to. If the numbers or the rules do not work, the tool says so before you publish anything.

What this generator does

Treats each shift's staffing level as a hard requirement rather than an average. The rota generator rotates people through duties over weeks; this fills a set of shifts once, respecting how many each needs and who cannot be on which.

How to use this tool

  1. Enter the staff, one per line.
  2. Enter the shifts, one per line, with how many people each needs after a colon.
  3. Add rules for anyone unavailable for a shift or required on one.
  4. Press Assign shifts and check the status line.

Understanding the controls

Staff
One name per line. The tool checks up front whether there are enough people to fill every shift and reports the shortfall rather than under-staffing one.
Shifts
One per line with the number needed after a colon — "Saturday morning: 3". This is a hard limit in both directions: the shift is filled to that number and never beyond it.
Must be / must not be
Use must not be for unavailability, which is the common case in a rota. Use must be where somebody has to be on a particular shift — a keyholder, or the only trained first-aider.
Spread numbers evenly
Levels how many shifts each person works, within the staffing requirements. Turn it off when some people are meant to work more than others.

Worked examples

Six staff, three shifts of two
Everyone works once, and every shift is fully covered.
With unavailability
A must-not-be rule for Tuesday means that person is never assigned Tuesday, whatever else changes.
Not enough staff
Five people for shifts needing seven is reported as impossible, with the shortfall of two stated.

Common use cases

  • Splitting weekend cover where each day needs a set number on
  • Volunteer rotas for an event with different staffing per session
  • Assigning cover when several people are unavailable on particular days
  • Filling shifts where one person has to be on each because of a qualification
  • Any rota where the numbers per shift are fixed rather than flexible

How this generator works

Required assignments are placed first and checked against the unavailability rules and the staffing numbers. The rest are filled by backtracking search, starting with whoever has fewest shifts available to them — that is where an over-constrained rota fails soonest, so the search finds out quickly rather than after a great deal of work. If no arrangement satisfies every rule, the result says so and names what could not be honoured.

Randomness and fairness

Randomness only decides between shifts a person is genuinely free to work, with ties broken at random rather than by list order. Everything the rules constrain is decided by the rules. A seed switches to a deterministic, non-cryptographic generator so a published rota can be reproduced exactly.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Working-time rules, rest periods between shifts, contracted hours and individual availability beyond what you enter are all outside what this tool knows. Treat the output as a first draft for a human to check.
  • It fills one set of shifts, not a repeating rota. Fairness across weeks has to be managed by re-running it, or by using the duty rota generator, which rotates by design.
  • Every person is treated as equally able to work every shift unless barred. Skills, seniority and supervision requirements are not modelled.
  • Randomised assignment is inappropriate where the right person genuinely matters — safety-critical cover in particular should not be drawn at random.

Privacy and your data

Staff names and shifts are matched in the browser and never transmitted. Nothing is retained, so this holds no record of who was assigned what.