← Software

Roommate Cleaning Schedule Demo

Music room

My apartment's chore plan was a PDF, and its rotations overlapped. I wrote fairness rules, and a small Python optimizer found a semester schedule that follows them. This page runs a JavaScript port of that optimizer and then shows the web app each roommate used to see their weekend. The names and dates are made up.

Try this: press Run the optimizer in step 2. Then pick a name in step 3 and move the date forward to a Wednesday to watch the app switch weekends.

Rename the roommates

The old rotation

The PDF had a numbered list for each chore. Each list repeated on its own, and you counted weeks to find your turn. Every list started with the same person, so Theo gets all three chores on 2 weekends and does the bathroom 2 out of every 3 weeks.

  • Towels + kitchen

    Hand towels and rags go in the laundry. Wipe the counters, table and stove, and clear the kitchen.

    Old list

    1. Clean bathroom

      Sinks, toilets, showers, mirror and floor.

      Old list, 2 people a weekend

      1. Vacuum + mop

        Pick everything up off the floor, then vacuum and mop everywhere but the bedrooms.

        Old list

        The lists over 11 weekends

        Names in red have more than one chore that weekend.

        WeekWeekendTowels + kitchenBathroomVacuum + mopDoubled up

        Rules check

        Passes 0 of 5 rules

        RuleViolations
        Nobody gets more than one chore on a weekend Most chores on one weekend:
        Nobody does the same chore two weekends in a row Repeats: towels , bathroom , mop
        Bathroom: a different person takes the double turn in each 3-week block Double turns:
        Everyone does each chore within 1 time of everyone else Gaps: towels , bathroom , mop
        Everyone shares a bathroom shift with every other roommate Pairs covered: of

        Run the optimizer

        The optimizer is simulated annealing. It starts from a random schedule and swaps out one weekend at a time. A swap that lowers the cost is kept. A swap that raises it is sometimes kept too, often at the start and almost never by the end, so the search doesn't stall on the first decent schedule.

        Breaking a hard rule adds 1,000 to the cost. Smaller penalties spread repeats apart and mix up the bathroom pairs. Each run is 150,000 swaps, the same as the Python script.

        The seed makes a run repeatable. A seed gives the same schedule here as it does in the Python script, which tried seeds 0 to 19 and kept seed 6.

        schedule optimizerready

        seed
        6
        step
        0 of 150,000
        temperature
        50.00
        cost now
        –
        best cost
        –
        hard-rule violations
        –
        soft penalty
        –

        The result

        The best schedule from the run and the app each roommate opened to see their weekend.

        Run the optimizer in step 2 to see the schedule here.