FAILURE MAP
← Case archive

FA-94671 / Exam timetabling constraints / Open access

Second sitting starts without the supervised break · case 01

Candidates go straight from one paper to the next.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The 15-minute break is omitted.

VERIFIED REPAIR

Second start = start + first duration + 15.

Unsuccessful approach: Using the second exam's duration offsets by the wrong paper.

Case contract

Each clash [student, exam a, exam b] shares a start time. The longer exam is sat first (ties by id), then a 15-minute supervised break, then the second exam. Return [student, first, second, second start, whether the second exam ends by day_end (inclusive)].

Why this case matters

Clash resolution by supervised sequential sitting is a standard timetabling fallback.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(clashes, dur, start, day_end):
    out = []
    for st, a, b in clashes:
        first, second = sorted([a, b], key=lambda e: (-dur[e], e))
        s2 = start + dur[first]
        out.append([st, first, second, s2, s2 + dur[second] <= day_end])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 180}, 600, 1080],
   [['s1', 'B', 'A', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'MATH101H', 'ECON150'], ['s5', 'MATH101', 'CHEM120'], ['s1', 'ECON150', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 90},
    840, 1080],
   [['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True],
    ['s1', 'BIO130', 'ECON150', 945, True]]),
  ('partial repair guard 3',
   [[['s3', 'BIO130', 'PHYS110'], ['s1', 'ECON150', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 60,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 90},
    780, 1020],
   [['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 5',
   [[['s5', 'CHEM120', 'MATH101H'], ['s3', 'PHYS110', 'BIO130'], ['s1', 'CHEM120', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True],
    ['s1', 'MATH101', 'CHEM120', 675, True]]),
  ('normal control 6',
   [[['s3', 'BIO130', 'MATH101H'], ['s4', 'MATH101', 'CHEM120']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    840, 1020],
   [['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]),
  ('normal control 7',
   [[['s3', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s3', 'MATH101', 'PHYS110', 795, True]]),
  ('normal control 8',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 60},
    600, 1080],
   [['s3', 'HIST140', 'MATH101H', 705, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855],
   [['s1', 'A', 'B', 735, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'CHEM120', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 180},
    600, 1020],
   [['s3', 'CHEM120', 'PHYS110', 795, True]]),
  ('partial repair guard 3',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s3', 'MATH101H', 'HIST140', 675, True]]),
  ('boundary control 4', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 6',
   [[['s4', 'CHEM120', 'MATH101H'], ['s1', 'HIST140', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 60},
    840, 1080],
   [['s4', 'CHEM120', 'MATH101H', 915, True], ['s1', 'BIO130', 'HIST140', 945, True]]),
  ('normal control 7',
   [[['s1', 'CHEM120', 'ECON150'], ['s1', 'PHYS110', 'CHEM120'], ['s1', 'MATH101', 'CHEM120']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 90,
     'CHEM120': 120,
     'BIO130': 120,
     'HIST140': 180,
     'ECON150': 180},
    840, 1020],
   [['s1', 'ECON150', 'CHEM120', 1035, False], ['s1', 'CHEM120', 'PHYS110', 975, False],
    ['s1', 'MATH101', 'CHEM120', 1035, False]]),
  ('normal control 8',
   [[['s5', 'ECON150', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 90},
    840, 1080],
   [['s5', 'ECON150', 'PHYS110', 945, True], ['s5', 'MATH101', 'PHYS110', 975, True]])],
 [('regression: supervised break 1', [[['s1', 'B', 'A']], {'A': 90, 'B': 90}, 780, 1080],
   [['s1', 'A', 'B', 885, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'BIO130'], ['s4', 'BIO130', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 60},
    840, 1080],
   [['s1', 'BIO130', 'ECON150', 945, True], ['s4', 'HIST140', 'BIO130', 1035, False]]),
  ('partial repair guard 3',
   [[['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 90},
    780, 1020],
   [['s4', 'PHYS110', 'MATH101H', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('boundary control 5', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('normal control 6',
   [[['s5', 'ECON150', 'MATH101'], ['s4', 'HIST140', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'ECON150', 'MATH101', 735, True], ['s4', 'PHYS110', 'HIST140', 675, True],
    ['s5', 'MATH101', 'PHYS110', 735, True]]),
  ('normal control 7',
   [[['s2', 'PHYS110', 'BIO130'], ['s1', 'BIO130', 'ECON150']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 180,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s2', 'BIO130', 'PHYS110', 795, True], ['s1', 'BIO130', 'ECON150', 795, True]]),
  ('normal control 8',
   [[['s2', 'BIO130', 'HIST140'], ['s2', 'CHEM120', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s2', 'HIST140', 'BIO130', 645, True], ['s2', 'BIO130', 'CHEM120', 615, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'PHYS110'], ['s2', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 120},
    540, 1080],
   [['s1', 'ECON150', 'PHYS110', 675, True], ['s2', 'MATH101', 'PHYS110', 735, True]]),
  ('partial repair guard 3',
   [[['s4', 'BIO130', 'ECON150'], ['s4', 'MATH101', 'MATH101H']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 120},
    780, 1020],
   [['s4', 'BIO130', 'ECON150', 915, False], ['s4', 'MATH101H', 'MATH101', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855], [['s1', 'A', 'B', 795, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('normal control 6',
   [[['s5', 'HIST140', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s5', 'PHYS110', 'HIST140', 675, True]]),
  ('normal control 7',
   [[['s3', 'BIO130', 'PHYS110'], ['s3', 'PHYS110', 'CHEM120'], ['s2', 'BIO130', 'CHEM120']],
    {'MATH101': 90,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'BIO130', 735, True], ['s3', 'CHEM120', 'PHYS110', 735, True],
    ['s2', 'CHEM120', 'BIO130', 735, True]]),
  ('normal control 8',
   [[['s1', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    840, 1020],
   [['s1', 'MATH101', 'PHYS110', 1035, False]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855],
   [['s1', 'A', 'B', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 90,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 120,
     'HIST140': 60,
     'ECON150': 180},
    780, 1020],
   [['s3', 'BIO130', 'MATH101', 915, True]]),
  ('partial repair guard 3',
   [[['s2', 'BIO130', 'ECON150'], ['s4', 'ECON150', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 120},
    780, 1020],
   [['s2', 'BIO130', 'ECON150', 975, False], ['s4', 'MATH101', 'ECON150', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 780, 1035],
   [['s1', 'A', 'B', 915, True]]),
  ('normal control 5',
   [[['s2', 'HIST140', 'PHYS110']],
    {'MATH101': 90,
     'MATH101H': 90,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 60,
     'HIST140': 180,
     'ECON150': 120},
    840, 1020],
   [['s2', 'HIST140', 'PHYS110', 1035, False]]),
  ('normal control 6',
   [[['s3', 'MATH101H', 'ECON150'], ['s2', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1020],
   [['s3', 'MATH101H', 'ECON150', 675, True], ['s2', 'BIO130', 'MATH101', 645, True]]),
  ('normal control 7',
   [[['s3', 'PHYS110', 'MATH101H'], ['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'MATH101H', 675, True], ['s4', 'PHYS110', 'MATH101H', 675, True]]),
  ('normal control 8',
   [[['s2', 'PHYS110', 'HIST140'], ['s5', 'CHEM120', 'BIO130'], ['s5', 'MATH101H', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    600, 1020],
   [['s2', 'PHYS110', 'HIST140', 735, True], ['s5', 'BIO130', 'CHEM120', 675, True],
    ['s5', 'MATH101H', 'PHYS110', 795, True]])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: supervised break 1[['s1', 'B', 'A', 780, True]][['s1', 'B', 'A', 795, True]]Failed
regression variant: supervised break 2[['s1', 'MATH101H', 'ECON150', 1020, False], ['s5', 'MATH101', 'CHEM120', 960, True], ['s1', 'BIO130', 'ECON150', 930, True]][['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True], ['s1', 'BIO130', 'ECON150', 945, True]]Failed
partial repair guard 3[['s3', 'BIO130', 'PHYS110', 960, False], ['s1', 'HIST140', 'ECON150', 900, True]][['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]Failed
boundary control 4[['s1', 'A', 'B', 1020, True]][['s1', 'A', 'B', 1035, False]]Failed
normal control 5[['s5', 'CHEM120', 'MATH101H', 630, True], ['s3', 'PHYS110', 'BIO130', 720, True], ['s1', 'MATH101', 'CHEM120', 660, True]][['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True], ['s1', 'MATH101', 'CHEM120', 675, True]]Failed
normal control 6[['s3', 'BIO130', 'MATH101H', 930, True], ['s4', 'CHEM120', 'MATH101', 1020, False]][['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]Failed
normal control 7[['s3', 'MATH101', 'PHYS110', 780, True]][['s3', 'MATH101', 'PHYS110', 795, True]]Failed
normal control 8[['s3', 'HIST140', 'MATH101H', 690, True]][['s3', 'HIST140', 'MATH101H', 705, True]]Failed

SHA-256 / 017f6fe07196b8f4c90142479580c74bc619aed6f4b321349fdf27d4c67b8ff3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(clashes, dur, start, day_end):
    out = []
    for st, a, b in clashes:
        first, second = sorted([a, b], key=lambda e: (-dur[e], e))
        s2 = start + dur[second] + 15
        out.append([st, first, second, s2, s2 + dur[second] <= day_end])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 180}, 600, 1080],
   [['s1', 'B', 'A', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'MATH101H', 'ECON150'], ['s5', 'MATH101', 'CHEM120'], ['s1', 'ECON150', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 90},
    840, 1080],
   [['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True],
    ['s1', 'BIO130', 'ECON150', 945, True]]),
  ('partial repair guard 3',
   [[['s3', 'BIO130', 'PHYS110'], ['s1', 'ECON150', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 60,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 90},
    780, 1020],
   [['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 5',
   [[['s5', 'CHEM120', 'MATH101H'], ['s3', 'PHYS110', 'BIO130'], ['s1', 'CHEM120', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True],
    ['s1', 'MATH101', 'CHEM120', 675, True]]),
  ('normal control 6',
   [[['s3', 'BIO130', 'MATH101H'], ['s4', 'MATH101', 'CHEM120']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    840, 1020],
   [['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]),
  ('normal control 7',
   [[['s3', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s3', 'MATH101', 'PHYS110', 795, True]]),
  ('normal control 8',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 60},
    600, 1080],
   [['s3', 'HIST140', 'MATH101H', 705, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855],
   [['s1', 'A', 'B', 735, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'CHEM120', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 180},
    600, 1020],
   [['s3', 'CHEM120', 'PHYS110', 795, True]]),
  ('partial repair guard 3',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s3', 'MATH101H', 'HIST140', 675, True]]),
  ('boundary control 4', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 6',
   [[['s4', 'CHEM120', 'MATH101H'], ['s1', 'HIST140', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 60},
    840, 1080],
   [['s4', 'CHEM120', 'MATH101H', 915, True], ['s1', 'BIO130', 'HIST140', 945, True]]),
  ('normal control 7',
   [[['s1', 'CHEM120', 'ECON150'], ['s1', 'PHYS110', 'CHEM120'], ['s1', 'MATH101', 'CHEM120']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 90,
     'CHEM120': 120,
     'BIO130': 120,
     'HIST140': 180,
     'ECON150': 180},
    840, 1020],
   [['s1', 'ECON150', 'CHEM120', 1035, False], ['s1', 'CHEM120', 'PHYS110', 975, False],
    ['s1', 'MATH101', 'CHEM120', 1035, False]]),
  ('normal control 8',
   [[['s5', 'ECON150', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 90},
    840, 1080],
   [['s5', 'ECON150', 'PHYS110', 945, True], ['s5', 'MATH101', 'PHYS110', 975, True]])],
 [('regression: supervised break 1', [[['s1', 'B', 'A']], {'A': 90, 'B': 90}, 780, 1080],
   [['s1', 'A', 'B', 885, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'BIO130'], ['s4', 'BIO130', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 60},
    840, 1080],
   [['s1', 'BIO130', 'ECON150', 945, True], ['s4', 'HIST140', 'BIO130', 1035, False]]),
  ('partial repair guard 3',
   [[['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 90},
    780, 1020],
   [['s4', 'PHYS110', 'MATH101H', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('boundary control 5', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('normal control 6',
   [[['s5', 'ECON150', 'MATH101'], ['s4', 'HIST140', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'ECON150', 'MATH101', 735, True], ['s4', 'PHYS110', 'HIST140', 675, True],
    ['s5', 'MATH101', 'PHYS110', 735, True]]),
  ('normal control 7',
   [[['s2', 'PHYS110', 'BIO130'], ['s1', 'BIO130', 'ECON150']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 180,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s2', 'BIO130', 'PHYS110', 795, True], ['s1', 'BIO130', 'ECON150', 795, True]]),
  ('normal control 8',
   [[['s2', 'BIO130', 'HIST140'], ['s2', 'CHEM120', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s2', 'HIST140', 'BIO130', 645, True], ['s2', 'BIO130', 'CHEM120', 615, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'PHYS110'], ['s2', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 120},
    540, 1080],
   [['s1', 'ECON150', 'PHYS110', 675, True], ['s2', 'MATH101', 'PHYS110', 735, True]]),
  ('partial repair guard 3',
   [[['s4', 'BIO130', 'ECON150'], ['s4', 'MATH101', 'MATH101H']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 120},
    780, 1020],
   [['s4', 'BIO130', 'ECON150', 915, False], ['s4', 'MATH101H', 'MATH101', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855], [['s1', 'A', 'B', 795, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('normal control 6',
   [[['s5', 'HIST140', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s5', 'PHYS110', 'HIST140', 675, True]]),
  ('normal control 7',
   [[['s3', 'BIO130', 'PHYS110'], ['s3', 'PHYS110', 'CHEM120'], ['s2', 'BIO130', 'CHEM120']],
    {'MATH101': 90,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'BIO130', 735, True], ['s3', 'CHEM120', 'PHYS110', 735, True],
    ['s2', 'CHEM120', 'BIO130', 735, True]]),
  ('normal control 8',
   [[['s1', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    840, 1020],
   [['s1', 'MATH101', 'PHYS110', 1035, False]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855],
   [['s1', 'A', 'B', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 90,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 120,
     'HIST140': 60,
     'ECON150': 180},
    780, 1020],
   [['s3', 'BIO130', 'MATH101', 915, True]]),
  ('partial repair guard 3',
   [[['s2', 'BIO130', 'ECON150'], ['s4', 'ECON150', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 120},
    780, 1020],
   [['s2', 'BIO130', 'ECON150', 975, False], ['s4', 'MATH101', 'ECON150', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 780, 1035],
   [['s1', 'A', 'B', 915, True]]),
  ('normal control 5',
   [[['s2', 'HIST140', 'PHYS110']],
    {'MATH101': 90,
     'MATH101H': 90,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 60,
     'HIST140': 180,
     'ECON150': 120},
    840, 1020],
   [['s2', 'HIST140', 'PHYS110', 1035, False]]),
  ('normal control 6',
   [[['s3', 'MATH101H', 'ECON150'], ['s2', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1020],
   [['s3', 'MATH101H', 'ECON150', 675, True], ['s2', 'BIO130', 'MATH101', 645, True]]),
  ('normal control 7',
   [[['s3', 'PHYS110', 'MATH101H'], ['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'MATH101H', 675, True], ['s4', 'PHYS110', 'MATH101H', 675, True]]),
  ('normal control 8',
   [[['s2', 'PHYS110', 'HIST140'], ['s5', 'CHEM120', 'BIO130'], ['s5', 'MATH101H', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    600, 1020],
   [['s2', 'PHYS110', 'HIST140', 735, True], ['s5', 'BIO130', 'CHEM120', 675, True],
    ['s5', 'MATH101H', 'PHYS110', 795, True]])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: supervised break 1[['s1', 'B', 'A', 735, True]][['s1', 'B', 'A', 795, True]]Failed
regression variant: supervised break 2[['s1', 'MATH101H', 'ECON150', 945, True], ['s5', 'MATH101', 'CHEM120', 915, True], ['s1', 'BIO130', 'ECON150', 945, True]][['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True], ['s1', 'BIO130', 'ECON150', 945, True]]Failed
partial repair guard 3[['s3', 'BIO130', 'PHYS110', 885, True], ['s1', 'HIST140', 'ECON150', 885, True]][['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]Failed
boundary control 4[['s1', 'A', 'B', 915, True]][['s1', 'A', 'B', 1035, False]]Failed
normal control 5[['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 645, True], ['s1', 'MATH101', 'CHEM120', 645, True]][['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True], ['s1', 'MATH101', 'CHEM120', 675, True]]Failed
normal control 6[['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 975, False]][['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]Failed
normal control 7[['s3', 'MATH101', 'PHYS110', 795, True]][['s3', 'MATH101', 'PHYS110', 795, True]]Passed
normal control 8[['s3', 'HIST140', 'MATH101H', 705, True]][['s3', 'HIST140', 'MATH101H', 705, True]]Passed

SHA-256 / a8ff040be0b8aa9663862ea7732255ffadd14f44f16404ee9b5090bc77c31eb1

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(clashes, dur, start, day_end):
    out = []
    for st, a, b in clashes:
        first, second = sorted([a, b], key=lambda e: (-dur[e], e))
        s2 = start + dur[first] + 15
        out.append([st, first, second, s2, s2 + dur[second] <= day_end])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 180}, 600, 1080],
   [['s1', 'B', 'A', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'MATH101H', 'ECON150'], ['s5', 'MATH101', 'CHEM120'], ['s1', 'ECON150', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 90},
    840, 1080],
   [['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True],
    ['s1', 'BIO130', 'ECON150', 945, True]]),
  ('partial repair guard 3',
   [[['s3', 'BIO130', 'PHYS110'], ['s1', 'ECON150', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 60,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 90},
    780, 1020],
   [['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 5',
   [[['s5', 'CHEM120', 'MATH101H'], ['s3', 'PHYS110', 'BIO130'], ['s1', 'CHEM120', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True],
    ['s1', 'MATH101', 'CHEM120', 675, True]]),
  ('normal control 6',
   [[['s3', 'BIO130', 'MATH101H'], ['s4', 'MATH101', 'CHEM120']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 180},
    840, 1020],
   [['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]),
  ('normal control 7',
   [[['s3', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s3', 'MATH101', 'PHYS110', 795, True]]),
  ('normal control 8',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 120,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 60},
    600, 1080],
   [['s3', 'HIST140', 'MATH101H', 705, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855],
   [['s1', 'A', 'B', 735, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'CHEM120', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 180,
     'HIST140': 90,
     'ECON150': 180},
    600, 1020],
   [['s3', 'CHEM120', 'PHYS110', 795, True]]),
  ('partial repair guard 3',
   [[['s3', 'MATH101H', 'HIST140']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s3', 'MATH101H', 'HIST140', 675, True]]),
  ('boundary control 4', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('normal control 6',
   [[['s4', 'CHEM120', 'MATH101H'], ['s1', 'HIST140', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 60},
    840, 1080],
   [['s4', 'CHEM120', 'MATH101H', 915, True], ['s1', 'BIO130', 'HIST140', 945, True]]),
  ('normal control 7',
   [[['s1', 'CHEM120', 'ECON150'], ['s1', 'PHYS110', 'CHEM120'], ['s1', 'MATH101', 'CHEM120']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 90,
     'CHEM120': 120,
     'BIO130': 120,
     'HIST140': 180,
     'ECON150': 180},
    840, 1020],
   [['s1', 'ECON150', 'CHEM120', 1035, False], ['s1', 'CHEM120', 'PHYS110', 975, False],
    ['s1', 'MATH101', 'CHEM120', 1035, False]]),
  ('normal control 8',
   [[['s5', 'ECON150', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 60,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 60,
     'ECON150': 90},
    840, 1080],
   [['s5', 'ECON150', 'PHYS110', 945, True], ['s5', 'MATH101', 'PHYS110', 975, True]])],
 [('regression: supervised break 1', [[['s1', 'B', 'A']], {'A': 90, 'B': 90}, 780, 1080],
   [['s1', 'A', 'B', 885, True]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'BIO130'], ['s4', 'BIO130', 'HIST140']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 60},
    840, 1080],
   [['s1', 'BIO130', 'ECON150', 945, True], ['s4', 'HIST140', 'BIO130', 1035, False]]),
  ('partial repair guard 3',
   [[['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 90},
    780, 1020],
   [['s4', 'PHYS110', 'MATH101H', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('boundary control 5', [[['s3', 'A', 'B'], ['s1', 'A', 'B']], {'A': 60, 'B': 90}, 780, 1020],
   [['s3', 'B', 'A', 885, True], ['s1', 'B', 'A', 885, True]]),
  ('normal control 6',
   [[['s5', 'ECON150', 'MATH101'], ['s4', 'HIST140', 'PHYS110'], ['s5', 'PHYS110', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s5', 'ECON150', 'MATH101', 735, True], ['s4', 'PHYS110', 'HIST140', 675, True],
    ['s5', 'MATH101', 'PHYS110', 735, True]]),
  ('normal control 7',
   [[['s2', 'PHYS110', 'BIO130'], ['s1', 'BIO130', 'ECON150']],
    {'MATH101': 120,
     'MATH101H': 90,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 180,
     'HIST140': 60,
     'ECON150': 180},
    600, 1020],
   [['s2', 'BIO130', 'PHYS110', 795, True], ['s1', 'BIO130', 'ECON150', 795, True]]),
  ('normal control 8',
   [[['s2', 'BIO130', 'HIST140'], ['s2', 'CHEM120', 'BIO130']],
    {'MATH101': 120,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 90,
     'ECON150': 180},
    540, 1020],
   [['s2', 'HIST140', 'BIO130', 645, True], ['s2', 'BIO130', 'CHEM120', 615, True]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 840, 1080],
   [['s1', 'A', 'B', 1035, False]]),
  ('regression variant: supervised break 2',
   [[['s1', 'ECON150', 'PHYS110'], ['s2', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 90,
     'HIST140': 180,
     'ECON150': 120},
    540, 1080],
   [['s1', 'ECON150', 'PHYS110', 675, True], ['s2', 'MATH101', 'PHYS110', 735, True]]),
  ('partial repair guard 3',
   [[['s4', 'BIO130', 'ECON150'], ['s4', 'MATH101', 'MATH101H']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 180,
     'CHEM120': 60,
     'BIO130': 120,
     'HIST140': 90,
     'ECON150': 120},
    780, 1020],
   [['s4', 'BIO130', 'ECON150', 915, False], ['s4', 'MATH101H', 'MATH101', 915, True]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855], [['s1', 'A', 'B', 795, True]]),
  ('boundary control 5', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 600, 855], [['s1', 'A', 'B', 735, True]]),
  ('normal control 6',
   [[['s5', 'HIST140', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 120},
    540, 1080],
   [['s5', 'PHYS110', 'HIST140', 675, True]]),
  ('normal control 7',
   [[['s3', 'BIO130', 'PHYS110'], ['s3', 'PHYS110', 'CHEM120'], ['s2', 'BIO130', 'CHEM120']],
    {'MATH101': 90,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'BIO130', 735, True], ['s3', 'CHEM120', 'PHYS110', 735, True],
    ['s2', 'CHEM120', 'BIO130', 735, True]]),
  ('normal control 8',
   [[['s1', 'MATH101', 'PHYS110']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 180,
     'CHEM120': 120,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    840, 1020],
   [['s1', 'MATH101', 'PHYS110', 1035, False]])],
 [('regression: supervised break 1', [[['s1', 'A', 'B']], {'A': 180, 'B': 60}, 600, 855],
   [['s1', 'A', 'B', 795, True]]),
  ('regression variant: supervised break 2',
   [[['s3', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 90,
     'PHYS110': 90,
     'CHEM120': 180,
     'BIO130': 120,
     'HIST140': 60,
     'ECON150': 180},
    780, 1020],
   [['s3', 'BIO130', 'MATH101', 915, True]]),
  ('partial repair guard 3',
   [[['s2', 'BIO130', 'ECON150'], ['s4', 'ECON150', 'MATH101']],
    {'MATH101': 180,
     'MATH101H': 120,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 180,
     'HIST140': 120,
     'ECON150': 120},
    780, 1020],
   [['s2', 'BIO130', 'ECON150', 975, False], ['s4', 'MATH101', 'ECON150', 975, False]]),
  ('boundary control 4', [[['s1', 'A', 'B']], {'A': 120, 'B': 120}, 780, 1035],
   [['s1', 'A', 'B', 915, True]]),
  ('normal control 5',
   [[['s2', 'HIST140', 'PHYS110']],
    {'MATH101': 90,
     'MATH101H': 90,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 60,
     'HIST140': 180,
     'ECON150': 120},
    840, 1020],
   [['s2', 'HIST140', 'PHYS110', 1035, False]]),
  ('normal control 6',
   [[['s3', 'MATH101H', 'ECON150'], ['s2', 'MATH101', 'BIO130']],
    {'MATH101': 60,
     'MATH101H': 120,
     'PHYS110': 60,
     'CHEM120': 180,
     'BIO130': 90,
     'HIST140': 90,
     'ECON150': 60},
    540, 1020],
   [['s3', 'MATH101H', 'ECON150', 675, True], ['s2', 'BIO130', 'MATH101', 645, True]]),
  ('normal control 7',
   [[['s3', 'PHYS110', 'MATH101H'], ['s4', 'PHYS110', 'MATH101H']],
    {'MATH101': 180,
     'MATH101H': 60,
     'PHYS110': 120,
     'CHEM120': 90,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    540, 1080],
   [['s3', 'PHYS110', 'MATH101H', 675, True], ['s4', 'PHYS110', 'MATH101H', 675, True]]),
  ('normal control 8',
   [[['s2', 'PHYS110', 'HIST140'], ['s5', 'CHEM120', 'BIO130'], ['s5', 'MATH101H', 'PHYS110']],
    {'MATH101': 120,
     'MATH101H': 180,
     'PHYS110': 120,
     'CHEM120': 60,
     'BIO130': 60,
     'HIST140': 60,
     'ECON150': 60},
    600, 1020],
   [['s2', 'PHYS110', 'HIST140', 735, True], ['s5', 'BIO130', 'CHEM120', 675, True],
    ['s5', 'MATH101H', 'PHYS110', 795, True]])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: supervised break 1[['s1', 'B', 'A', 795, True]][['s1', 'B', 'A', 795, True]]Passed
regression variant: supervised break 2[['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True], ['s1', 'BIO130', 'ECON150', 945, True]][['s1', 'MATH101H', 'ECON150', 1035, False], ['s5', 'MATH101', 'CHEM120', 975, True], ['s1', 'BIO130', 'ECON150', 945, True]]Passed
partial repair guard 3[['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]][['s3', 'BIO130', 'PHYS110', 975, False], ['s1', 'HIST140', 'ECON150', 915, True]]Passed
boundary control 4[['s1', 'A', 'B', 1035, False]][['s1', 'A', 'B', 1035, False]]Passed
normal control 5[['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True], ['s1', 'MATH101', 'CHEM120', 675, True]][['s5', 'CHEM120', 'MATH101H', 645, True], ['s3', 'PHYS110', 'BIO130', 735, True], ['s1', 'MATH101', 'CHEM120', 675, True]]Passed
normal control 6[['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]][['s3', 'BIO130', 'MATH101H', 945, False], ['s4', 'CHEM120', 'MATH101', 1035, False]]Passed
normal control 7[['s3', 'MATH101', 'PHYS110', 795, True]][['s3', 'MATH101', 'PHYS110', 795, True]]Passed
normal control 8[['s3', 'HIST140', 'MATH101H', 705, True]][['s3', 'HIST140', 'MATH101H', 705, True]]Passed

SHA-256 / 87f95f1b9840841b83471a0a59a3275dfa5883dccdd4391c21e2dad4d651a578

Verification & scope

Stipulated toy exam-timetabling rule set for a bounded model; it does not claim conformance with any institution's regulations or a benchmark specification, and it performs no search or optimisation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:52:06.558530+00:00.

Case digest / f09588408c3b5fa19266e1cb42287c297ddac0970cd65159f22f1ee8d6e8f4a1