FA-94391 / Exam timetabling constraints / Open access
Whole exam placed in the first sufficient room · case 01
Small exams occupy large halls and later large exams must split or go unplaced.
ROOT CAUSE
The first fitting room is used instead of the tightest fit.
VERIFIED REPAIR
Choose the fitting room with the least remaining capacity, ties by id.
Unsuccessful approach: Choosing the largest room is worst fit.
Case contract
exams [id, size, duration, splittable], rooms [id, capacity]. Exams are placed largest first (ties by id). A room is compatible if empty or holding only exams of the same duration. Place whole in the compatible room with the least sufficient remaining capacity (ties by id); else if splittable and compatible rooms have enough total space, fill them by descending remaining capacity (ties by id), skipping full rooms; else unplaced. Return placements and unplaced ids.
Why this case matters
Room allocation rules (mixed durations, best fit, splitting) are the second hard-constraint family of exam timetabling.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(exams, rooms):
rem = {r: c for r, c in rooms}
dur = {}
place = {}
unplaced = []
for eid, size, d, split in sorted(exams, key=lambda x: (-x[1], x[0])):
ok = [r for r in rem if dur.get(r, d) == d]
fit = [r for r in ok if rem[r] >= size]
if fit:
r = fit[0]
place[eid] = [[r, size]]
rem[r] -= size
dur[r] = d
continue
if split and sum(rem[r] for r in ok) >= size:
parts = []
left = size
for r in sorted(ok, key=lambda r: (-rem[r], r)):
if left == 0:
break
take = min(rem[r], left)
parts.append([r, take])
rem[r] -= take
dur[r] = d
left -= take
place[eid] = parts
continue
unplaced.append(eid)
return {'placed': place, 'unplaced': unplaced}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: best fit room 1', [[['A', 40, 120, False], ['B', 20, 120, False]], [['R1', 60], ['R2', 40]]],
{'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []}),
('regression variant: best fit room 2',
[[['E0', 80, 90, True], ['E1', 20, 120, True]], [['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']}),
('partial repair guard 3',
[[['E0', 80, 180, True], ['E1', 20, 90, True], ['E2', 80, 90, False], ['E3', 80, 90, True]],
[['R0', 60], ['R1', 60], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']}),
('normal control 4',
[[['E0', 10, 90, True], ['E1', 60, 180, False], ['E2', 10, 120, True], ['E3', 10, 180, False],
['E4', 10, 120, False]],
[['R0', 40], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]},
'unplaced': ['E1']}),
('normal control 5',
[[['E0', 30, 120, True], ['E1', 20, 120, True], ['E2', 10, 180, False], ['E3', 60, 120, False]],
[['R0', 20], ['R1', 60], ['R2', 20], ['R3', 50]]],
{'placed': {'E3': [['R1', 60]], 'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]},
'unplaced': []}),
('normal control 6',
[[['E0', 10, 180, False], ['E1', 20, 120, False], ['E2', 45, 120, False]],
[['R0', 30], ['R1', 20], ['R2', 40]]],
{'placed': {'E1': [['R1', 20]], 'E0': [['R0', 10]]}, 'unplaced': ['E2']}),
('normal control 7', [[['E0', 10, 180, True], ['E1', 60, 180, True]], [['R0', 40], ['R1', 30], ['R2', 30]]],
{'placed': {'E1': [['R0', 40], ['R1', 20]], 'E0': [['R1', 10]]}, 'unplaced': []}),
('normal control 8', [[['E0', 10, 120, False], ['E1', 60, 120, True]], [['R0', 30], ['R1', 30]]],
{'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']})],
[('regression: best fit room 1',
[[['E0', 80, 120, False], ['E1', 10, 120, False]], [['R0', 60], ['R1', 50]]],
{'placed': {'E1': [['R1', 10]]}, 'unplaced': ['E0']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 50], ['R1', 30], ['R2', 30], ['R3', 20]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 45, 120, True],
['E4', 45, 120, True]],
[['R0', 30], ['R1', 20], ['R2', 20], ['R3', 50]]],
{'placed': {'E0': [['R3', 50], ['R0', 10]], 'E1': [['R1', 20]], 'E2': [['R2', 10]]},
'unplaced': ['E3', 'E4']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 20]]],
{'placed': {'A': [['R1', 30], ['R2', 20]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 30, 120, False], ['E1', 20, 120, True], ['E2', 45, 180, True], ['E3', 80, 120, True]],
[['R0', 60], ['R1', 60], ['R2', 40]]],
{'placed': {'E3': [['R0', 60], ['R1', 20]], 'E0': [['R1', 30]], 'E1': [['R2', 20]]}, 'unplaced': ['E2']}),
('normal control 6',
[[['E0', 20, 90, False], ['E1', 10, 120, False], ['E2', 20, 120, False]], [['R0', 30], ['R1', 20]]],
{'placed': {'E0': [['R1', 20]], 'E2': [['R0', 20]], 'E1': [['R0', 10]]}, 'unplaced': []}),
('normal control 7',
[[['E0', 80, 120, True], ['E1', 20, 120, False], ['E2', 20, 120, True], ['E3', 80, 180, True],
['E4', 60, 90, True]],
[['R0', 50], ['R1', 50]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 20]]}, 'unplaced': ['E3', 'E4', 'E2']}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 20, 180, True], ['E2', 60, 90, False]], [['R0', 30], ['R1', 50]]],
{'placed': {'E0': [['R1', 50], ['R0', 30]]}, 'unplaced': ['E2', 'E1']})],
[('regression: best fit room 1',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, False], ['E1', 10, 120, True]], [['R0', 20], ['R1', 30], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 80, 120, True], ['E1', 10, 120, False], ['E2', 60, 120, True]],
[['R0', 50], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 10]]}, 'unplaced': ['E2']}),
('boundary control 4', [[['A', 30, 120, True], ['B', 30, 120, True]], [['R1', 30], ['R2', 40]]],
{'placed': {'A': [['R1', 30]], 'B': [['R2', 30]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 20, 120, True], ['E1', 60, 120, True]], [['R0', 30], ['R1', 40], ['R2', 20], ['R3', 30]]],
{'placed': {'E1': [['R1', 40], ['R0', 20]], 'E0': [['R2', 20]]}, 'unplaced': []}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 60, 120, False]], [['R0', 40], ['R1', 20], ['R2', 20]]],
{'placed': {'E0': [['R1', 20]]}, 'unplaced': ['E1']}),
('normal control 7',
[[['E0', 45, 120, False], ['E1', 60, 180, True]], [['R0', 40], ['R1', 50], ['R2', 40]]],
{'placed': {'E1': [['R1', 50], ['R0', 10]]}, 'unplaced': ['E0']}),
('normal control 8',
[[['E0', 30, 120, False], ['E1', 80, 120, True], ['E2', 80, 90, True], ['E3', 45, 120, True],
['E4', 80, 120, False]],
[['R0', 50], ['R1', 30]]],
{'placed': {'E1': [['R0', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E4', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 10, 120, True], ['E1', 80, 120, False]], [['R0', 60], ['R1', 40], ['R2', 40]]],
{'placed': {'E0': [['R1', 10]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 40], ['R1', 30], ['R2', 40], ['R3', 30]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, False], ['E1', 10, 90, True], ['E2', 60, 120, True], ['E3', 10, 90, False]],
[['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 10]], 'E3': [['R1', 10]]}, 'unplaced': ['E0', 'E2']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 19]]],
{'placed': {}, 'unplaced': ['A']}),
('normal control 5',
[[['E0', 30, 180, True], ['E1', 60, 120, False], ['E2', 30, 180, False], ['E3', 20, 180, False]],
[['R0', 20], ['R1', 40], ['R2', 60], ['R3', 60]]],
{'placed': {'E1': [['R2', 60]], 'E0': [['R1', 30]], 'E2': [['R3', 30]], 'E3': [['R0', 20]]},
'unplaced': []}),
('normal control 6',
[[['E0', 30, 180, False], ['E1', 45, 180, False], ['E2', 60, 90, True]], [['R0', 40], ['R1', 40]]],
{'placed': {'E2': [['R0', 40], ['R1', 20]]}, 'unplaced': ['E1', 'E0']}),
('normal control 7',
[[['E0', 60, 120, False], ['E1', 30, 120, False], ['E2', 60, 180, True]],
[['R0', 60], ['R1', 50], ['R2', 60]]],
{'placed': {'E0': [['R0', 60]], 'E2': [['R2', 60]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 30, 120, True], ['E1', 60, 90, True], ['E2', 80, 120, True], ['E3', 45, 120, True]],
[['R0', 20], ['R1', 20], ['R2', 30]]],
{'placed': {'E1': [['R2', 30], ['R0', 20], ['R1', 10]]}, 'unplaced': ['E2', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 20, 90, True], ['E1', 80, 120, False]], [['R0', 30], ['R1', 30], ['R2', 20], ['R3', 60]]],
{'placed': {'E0': [['R2', 20]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 10, 90, True], ['E1', 20, 120, True], ['E2', 80, 120, False], ['E3', 60, 120, True],
['E4', 20, 120, True]],
[['R0', 50], ['R1', 20], ['R2', 50], ['R3', 30]]],
{'placed': {'E3': [['R0', 50], ['R2', 10]], 'E1': [['R1', 20]], 'E4': [['R3', 20]]},
'unplaced': ['E2', 'E0']}),
('partial repair guard 3',
[[['E0', 30, 120, True], ['E1', 30, 90, True]], [['R0', 30], ['R1', 40], ['R2', 60]]],
{'placed': {'E0': [['R0', 30]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('boundary control 4', [[['A', 30, 120, False], ['B', 30, 90, False]], [['R1', 60]]],
{'placed': {'A': [['R1', 30]]}, 'unplaced': ['B']}),
('normal control 5',
[[['E0', 45, 180, True], ['E1', 80, 90, True], ['E2', 80, 120, True], ['E3', 10, 120, True],
['E4', 30, 90, True]],
[['R0', 30], ['R1', 50], ['R2', 20]]],
{'placed': {'E1': [['R1', 50], ['R0', 30]], 'E3': [['R2', 10]]}, 'unplaced': ['E2', 'E0', 'E4']}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('normal control 7',
[[['E0', 20, 90, True], ['E1', 10, 120, True], ['E2', 30, 90, True]],
[['R0', 30], ['R1', 30], ['R2', 50]]],
{'placed': {'E2': [['R0', 30]], 'E0': [['R1', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 80, 90, True], ['E2', 60, 120, True], ['E3', 60, 180, True]],
[['R0', 60], ['R1', 30], ['R2', 60], ['R3', 50]]],
{'placed': {'E0': [['R0', 60], ['R2', 20]], 'E1': [['R3', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E3']})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: best fit room 1 | {'placed': {'A': [['R1', 40]], 'B': [['R1', 20]]}, 'unplaced': []} | {'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []} | Failed |
| regression variant: best fit room 2 | {'placed': {'E1': [['R0', 20]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']} | Failed |
| partial repair guard 3 | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']} | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']} | Passed |
| normal control 4 | {'placed': {'E0': [['R0', 10]], 'E2': [['R1', 10]], 'E3': [['R2', 10]], 'E4': [['R1', 10]]}, 'unplaced': ['E1']} | {'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]}, 'unplaced': ['E1']} | Failed |
| normal control 5 | {'placed': {'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | {'placed': {'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | Passed |
| normal control 6 | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 20]]}, 'unplaced': ['E2']} | {'placed': {'E0': [['R0', 10]], 'E1': [['R1', 20]]}, 'unplaced': ['E2']} | Failed |
| normal control 7 | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | Passed |
| normal control 8 | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | Passed |
SHA-256 / 9cb0cb5754e9793ea1d3d3124605c69d31525e958421973460dadac74d53934e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(exams, rooms):
rem = {r: c for r, c in rooms}
dur = {}
place = {}
unplaced = []
for eid, size, d, split in sorted(exams, key=lambda x: (-x[1], x[0])):
ok = [r for r in rem if dur.get(r, d) == d]
fit = [r for r in ok if rem[r] >= size]
if fit:
r = max(fit, key=lambda r: (rem[r], r))
place[eid] = [[r, size]]
rem[r] -= size
dur[r] = d
continue
if split and sum(rem[r] for r in ok) >= size:
parts = []
left = size
for r in sorted(ok, key=lambda r: (-rem[r], r)):
if left == 0:
break
take = min(rem[r], left)
parts.append([r, take])
rem[r] -= take
dur[r] = d
left -= take
place[eid] = parts
continue
unplaced.append(eid)
return {'placed': place, 'unplaced': unplaced}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: best fit room 1', [[['A', 40, 120, False], ['B', 20, 120, False]], [['R1', 60], ['R2', 40]]],
{'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []}),
('regression variant: best fit room 2',
[[['E0', 80, 90, True], ['E1', 20, 120, True]], [['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']}),
('partial repair guard 3',
[[['E0', 80, 180, True], ['E1', 20, 90, True], ['E2', 80, 90, False], ['E3', 80, 90, True]],
[['R0', 60], ['R1', 60], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']}),
('normal control 4',
[[['E0', 10, 90, True], ['E1', 60, 180, False], ['E2', 10, 120, True], ['E3', 10, 180, False],
['E4', 10, 120, False]],
[['R0', 40], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]},
'unplaced': ['E1']}),
('normal control 5',
[[['E0', 30, 120, True], ['E1', 20, 120, True], ['E2', 10, 180, False], ['E3', 60, 120, False]],
[['R0', 20], ['R1', 60], ['R2', 20], ['R3', 50]]],
{'placed': {'E3': [['R1', 60]], 'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]},
'unplaced': []}),
('normal control 6',
[[['E0', 10, 180, False], ['E1', 20, 120, False], ['E2', 45, 120, False]],
[['R0', 30], ['R1', 20], ['R2', 40]]],
{'placed': {'E1': [['R1', 20]], 'E0': [['R0', 10]]}, 'unplaced': ['E2']}),
('normal control 7', [[['E0', 10, 180, True], ['E1', 60, 180, True]], [['R0', 40], ['R1', 30], ['R2', 30]]],
{'placed': {'E1': [['R0', 40], ['R1', 20]], 'E0': [['R1', 10]]}, 'unplaced': []}),
('normal control 8', [[['E0', 10, 120, False], ['E1', 60, 120, True]], [['R0', 30], ['R1', 30]]],
{'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']})],
[('regression: best fit room 1',
[[['E0', 80, 120, False], ['E1', 10, 120, False]], [['R0', 60], ['R1', 50]]],
{'placed': {'E1': [['R1', 10]]}, 'unplaced': ['E0']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 50], ['R1', 30], ['R2', 30], ['R3', 20]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 45, 120, True],
['E4', 45, 120, True]],
[['R0', 30], ['R1', 20], ['R2', 20], ['R3', 50]]],
{'placed': {'E0': [['R3', 50], ['R0', 10]], 'E1': [['R1', 20]], 'E2': [['R2', 10]]},
'unplaced': ['E3', 'E4']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 20]]],
{'placed': {'A': [['R1', 30], ['R2', 20]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 30, 120, False], ['E1', 20, 120, True], ['E2', 45, 180, True], ['E3', 80, 120, True]],
[['R0', 60], ['R1', 60], ['R2', 40]]],
{'placed': {'E3': [['R0', 60], ['R1', 20]], 'E0': [['R1', 30]], 'E1': [['R2', 20]]}, 'unplaced': ['E2']}),
('normal control 6',
[[['E0', 20, 90, False], ['E1', 10, 120, False], ['E2', 20, 120, False]], [['R0', 30], ['R1', 20]]],
{'placed': {'E0': [['R1', 20]], 'E2': [['R0', 20]], 'E1': [['R0', 10]]}, 'unplaced': []}),
('normal control 7',
[[['E0', 80, 120, True], ['E1', 20, 120, False], ['E2', 20, 120, True], ['E3', 80, 180, True],
['E4', 60, 90, True]],
[['R0', 50], ['R1', 50]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 20]]}, 'unplaced': ['E3', 'E4', 'E2']}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 20, 180, True], ['E2', 60, 90, False]], [['R0', 30], ['R1', 50]]],
{'placed': {'E0': [['R1', 50], ['R0', 30]]}, 'unplaced': ['E2', 'E1']})],
[('regression: best fit room 1',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, False], ['E1', 10, 120, True]], [['R0', 20], ['R1', 30], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 80, 120, True], ['E1', 10, 120, False], ['E2', 60, 120, True]],
[['R0', 50], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 10]]}, 'unplaced': ['E2']}),
('boundary control 4', [[['A', 30, 120, True], ['B', 30, 120, True]], [['R1', 30], ['R2', 40]]],
{'placed': {'A': [['R1', 30]], 'B': [['R2', 30]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 20, 120, True], ['E1', 60, 120, True]], [['R0', 30], ['R1', 40], ['R2', 20], ['R3', 30]]],
{'placed': {'E1': [['R1', 40], ['R0', 20]], 'E0': [['R2', 20]]}, 'unplaced': []}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 60, 120, False]], [['R0', 40], ['R1', 20], ['R2', 20]]],
{'placed': {'E0': [['R1', 20]]}, 'unplaced': ['E1']}),
('normal control 7',
[[['E0', 45, 120, False], ['E1', 60, 180, True]], [['R0', 40], ['R1', 50], ['R2', 40]]],
{'placed': {'E1': [['R1', 50], ['R0', 10]]}, 'unplaced': ['E0']}),
('normal control 8',
[[['E0', 30, 120, False], ['E1', 80, 120, True], ['E2', 80, 90, True], ['E3', 45, 120, True],
['E4', 80, 120, False]],
[['R0', 50], ['R1', 30]]],
{'placed': {'E1': [['R0', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E4', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 10, 120, True], ['E1', 80, 120, False]], [['R0', 60], ['R1', 40], ['R2', 40]]],
{'placed': {'E0': [['R1', 10]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 40], ['R1', 30], ['R2', 40], ['R3', 30]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, False], ['E1', 10, 90, True], ['E2', 60, 120, True], ['E3', 10, 90, False]],
[['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 10]], 'E3': [['R1', 10]]}, 'unplaced': ['E0', 'E2']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 19]]],
{'placed': {}, 'unplaced': ['A']}),
('normal control 5',
[[['E0', 30, 180, True], ['E1', 60, 120, False], ['E2', 30, 180, False], ['E3', 20, 180, False]],
[['R0', 20], ['R1', 40], ['R2', 60], ['R3', 60]]],
{'placed': {'E1': [['R2', 60]], 'E0': [['R1', 30]], 'E2': [['R3', 30]], 'E3': [['R0', 20]]},
'unplaced': []}),
('normal control 6',
[[['E0', 30, 180, False], ['E1', 45, 180, False], ['E2', 60, 90, True]], [['R0', 40], ['R1', 40]]],
{'placed': {'E2': [['R0', 40], ['R1', 20]]}, 'unplaced': ['E1', 'E0']}),
('normal control 7',
[[['E0', 60, 120, False], ['E1', 30, 120, False], ['E2', 60, 180, True]],
[['R0', 60], ['R1', 50], ['R2', 60]]],
{'placed': {'E0': [['R0', 60]], 'E2': [['R2', 60]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 30, 120, True], ['E1', 60, 90, True], ['E2', 80, 120, True], ['E3', 45, 120, True]],
[['R0', 20], ['R1', 20], ['R2', 30]]],
{'placed': {'E1': [['R2', 30], ['R0', 20], ['R1', 10]]}, 'unplaced': ['E2', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 20, 90, True], ['E1', 80, 120, False]], [['R0', 30], ['R1', 30], ['R2', 20], ['R3', 60]]],
{'placed': {'E0': [['R2', 20]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 10, 90, True], ['E1', 20, 120, True], ['E2', 80, 120, False], ['E3', 60, 120, True],
['E4', 20, 120, True]],
[['R0', 50], ['R1', 20], ['R2', 50], ['R3', 30]]],
{'placed': {'E3': [['R0', 50], ['R2', 10]], 'E1': [['R1', 20]], 'E4': [['R3', 20]]},
'unplaced': ['E2', 'E0']}),
('partial repair guard 3',
[[['E0', 30, 120, True], ['E1', 30, 90, True]], [['R0', 30], ['R1', 40], ['R2', 60]]],
{'placed': {'E0': [['R0', 30]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('boundary control 4', [[['A', 30, 120, False], ['B', 30, 90, False]], [['R1', 60]]],
{'placed': {'A': [['R1', 30]]}, 'unplaced': ['B']}),
('normal control 5',
[[['E0', 45, 180, True], ['E1', 80, 90, True], ['E2', 80, 120, True], ['E3', 10, 120, True],
['E4', 30, 90, True]],
[['R0', 30], ['R1', 50], ['R2', 20]]],
{'placed': {'E1': [['R1', 50], ['R0', 30]], 'E3': [['R2', 10]]}, 'unplaced': ['E2', 'E0', 'E4']}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('normal control 7',
[[['E0', 20, 90, True], ['E1', 10, 120, True], ['E2', 30, 90, True]],
[['R0', 30], ['R1', 30], ['R2', 50]]],
{'placed': {'E2': [['R0', 30]], 'E0': [['R1', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 80, 90, True], ['E2', 60, 120, True], ['E3', 60, 180, True]],
[['R0', 60], ['R1', 30], ['R2', 60], ['R3', 50]]],
{'placed': {'E0': [['R0', 60], ['R2', 20]], 'E1': [['R3', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E3']})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: best fit room 1 | {'placed': {'A': [['R1', 40]], 'B': [['R2', 20]]}, 'unplaced': []} | {'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []} | Failed |
| regression variant: best fit room 2 | {'placed': {'E1': [['R0', 20]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']} | Failed |
| partial repair guard 3 | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R3', 20]]}, 'unplaced': ['E2', 'E3']} | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']} | Failed |
| normal control 4 | {'placed': {'E0': [['R1', 10]], 'E2': [['R0', 10]], 'E3': [['R2', 10]], 'E4': [['R0', 10]]}, 'unplaced': ['E1']} | {'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]}, 'unplaced': ['E1']} | Failed |
| normal control 5 | {'placed': {'E0': [['R3', 30]], 'E1': [['R3', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | {'placed': {'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | Failed |
| normal control 6 | {'placed': {'E0': [['R0', 10]], 'E1': [['R2', 20]]}, 'unplaced': ['E2']} | {'placed': {'E0': [['R0', 10]], 'E1': [['R1', 20]]}, 'unplaced': ['E2']} | Failed |
| normal control 7 | {'placed': {'E0': [['R2', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | Failed |
| normal control 8 | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | Passed |
SHA-256 / 548c361be10e7e50721f65007640d6ccb84b07d46ee61e88667954a878ba93a4
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(exams, rooms):
rem = {r: c for r, c in rooms}
dur = {}
place = {}
unplaced = []
for eid, size, d, split in sorted(exams, key=lambda x: (-x[1], x[0])):
ok = [r for r in rem if dur.get(r, d) == d]
fit = [r for r in ok if rem[r] >= size]
if fit:
r = min(fit, key=lambda r: (rem[r], r))
place[eid] = [[r, size]]
rem[r] -= size
dur[r] = d
continue
if split and sum(rem[r] for r in ok) >= size:
parts = []
left = size
for r in sorted(ok, key=lambda r: (-rem[r], r)):
if left == 0:
break
take = min(rem[r], left)
parts.append([r, take])
rem[r] -= take
dur[r] = d
left -= take
place[eid] = parts
continue
unplaced.append(eid)
return {'placed': place, 'unplaced': unplaced}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: best fit room 1', [[['A', 40, 120, False], ['B', 20, 120, False]], [['R1', 60], ['R2', 40]]],
{'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []}),
('regression variant: best fit room 2',
[[['E0', 80, 90, True], ['E1', 20, 120, True]], [['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']}),
('partial repair guard 3',
[[['E0', 80, 180, True], ['E1', 20, 90, True], ['E2', 80, 90, False], ['E3', 80, 90, True]],
[['R0', 60], ['R1', 60], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']}),
('normal control 4',
[[['E0', 10, 90, True], ['E1', 60, 180, False], ['E2', 10, 120, True], ['E3', 10, 180, False],
['E4', 10, 120, False]],
[['R0', 40], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]},
'unplaced': ['E1']}),
('normal control 5',
[[['E0', 30, 120, True], ['E1', 20, 120, True], ['E2', 10, 180, False], ['E3', 60, 120, False]],
[['R0', 20], ['R1', 60], ['R2', 20], ['R3', 50]]],
{'placed': {'E3': [['R1', 60]], 'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]},
'unplaced': []}),
('normal control 6',
[[['E0', 10, 180, False], ['E1', 20, 120, False], ['E2', 45, 120, False]],
[['R0', 30], ['R1', 20], ['R2', 40]]],
{'placed': {'E1': [['R1', 20]], 'E0': [['R0', 10]]}, 'unplaced': ['E2']}),
('normal control 7', [[['E0', 10, 180, True], ['E1', 60, 180, True]], [['R0', 40], ['R1', 30], ['R2', 30]]],
{'placed': {'E1': [['R0', 40], ['R1', 20]], 'E0': [['R1', 10]]}, 'unplaced': []}),
('normal control 8', [[['E0', 10, 120, False], ['E1', 60, 120, True]], [['R0', 30], ['R1', 30]]],
{'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']})],
[('regression: best fit room 1',
[[['E0', 80, 120, False], ['E1', 10, 120, False]], [['R0', 60], ['R1', 50]]],
{'placed': {'E1': [['R1', 10]]}, 'unplaced': ['E0']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 50], ['R1', 30], ['R2', 30], ['R3', 20]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 45, 120, True],
['E4', 45, 120, True]],
[['R0', 30], ['R1', 20], ['R2', 20], ['R3', 50]]],
{'placed': {'E0': [['R3', 50], ['R0', 10]], 'E1': [['R1', 20]], 'E2': [['R2', 10]]},
'unplaced': ['E3', 'E4']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 20]]],
{'placed': {'A': [['R1', 30], ['R2', 20]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 30, 120, False], ['E1', 20, 120, True], ['E2', 45, 180, True], ['E3', 80, 120, True]],
[['R0', 60], ['R1', 60], ['R2', 40]]],
{'placed': {'E3': [['R0', 60], ['R1', 20]], 'E0': [['R1', 30]], 'E1': [['R2', 20]]}, 'unplaced': ['E2']}),
('normal control 6',
[[['E0', 20, 90, False], ['E1', 10, 120, False], ['E2', 20, 120, False]], [['R0', 30], ['R1', 20]]],
{'placed': {'E0': [['R1', 20]], 'E2': [['R0', 20]], 'E1': [['R0', 10]]}, 'unplaced': []}),
('normal control 7',
[[['E0', 80, 120, True], ['E1', 20, 120, False], ['E2', 20, 120, True], ['E3', 80, 180, True],
['E4', 60, 90, True]],
[['R0', 50], ['R1', 50]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 20]]}, 'unplaced': ['E3', 'E4', 'E2']}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 20, 180, True], ['E2', 60, 90, False]], [['R0', 30], ['R1', 50]]],
{'placed': {'E0': [['R1', 50], ['R0', 30]]}, 'unplaced': ['E2', 'E1']})],
[('regression: best fit room 1',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, False], ['E1', 10, 120, True]], [['R0', 20], ['R1', 30], ['R2', 20], ['R3', 20]]],
{'placed': {'E0': [['R0', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 80, 120, True], ['E1', 10, 120, False], ['E2', 60, 120, True]],
[['R0', 50], ['R1', 40], ['R2', 30]]],
{'placed': {'E0': [['R0', 50], ['R1', 30]], 'E1': [['R1', 10]]}, 'unplaced': ['E2']}),
('boundary control 4', [[['A', 30, 120, True], ['B', 30, 120, True]], [['R1', 30], ['R2', 40]]],
{'placed': {'A': [['R1', 30]], 'B': [['R2', 30]]}, 'unplaced': []}),
('normal control 5',
[[['E0', 20, 120, True], ['E1', 60, 120, True]], [['R0', 30], ['R1', 40], ['R2', 20], ['R3', 30]]],
{'placed': {'E1': [['R1', 40], ['R0', 20]], 'E0': [['R2', 20]]}, 'unplaced': []}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 60, 120, False]], [['R0', 40], ['R1', 20], ['R2', 20]]],
{'placed': {'E0': [['R1', 20]]}, 'unplaced': ['E1']}),
('normal control 7',
[[['E0', 45, 120, False], ['E1', 60, 180, True]], [['R0', 40], ['R1', 50], ['R2', 40]]],
{'placed': {'E1': [['R1', 50], ['R0', 10]]}, 'unplaced': ['E0']}),
('normal control 8',
[[['E0', 30, 120, False], ['E1', 80, 120, True], ['E2', 80, 90, True], ['E3', 45, 120, True],
['E4', 80, 120, False]],
[['R0', 50], ['R1', 30]]],
{'placed': {'E1': [['R0', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E4', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 10, 120, True], ['E1', 80, 120, False]], [['R0', 60], ['R1', 40], ['R2', 40]]],
{'placed': {'E0': [['R1', 10]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 20, 120, True], ['E1', 30, 120, True]], [['R0', 40], ['R1', 30], ['R2', 40], ['R3', 30]]],
{'placed': {'E1': [['R1', 30]], 'E0': [['R3', 20]]}, 'unplaced': []}),
('partial repair guard 3',
[[['E0', 60, 180, False], ['E1', 10, 90, True], ['E2', 60, 120, True], ['E3', 10, 90, False]],
[['R0', 30], ['R1', 20]]],
{'placed': {'E1': [['R1', 10]], 'E3': [['R1', 10]]}, 'unplaced': ['E0', 'E2']}),
('boundary control 4', [[['A', 50, 120, True]], [['R1', 30], ['R2', 19]]],
{'placed': {}, 'unplaced': ['A']}),
('normal control 5',
[[['E0', 30, 180, True], ['E1', 60, 120, False], ['E2', 30, 180, False], ['E3', 20, 180, False]],
[['R0', 20], ['R1', 40], ['R2', 60], ['R3', 60]]],
{'placed': {'E1': [['R2', 60]], 'E0': [['R1', 30]], 'E2': [['R3', 30]], 'E3': [['R0', 20]]},
'unplaced': []}),
('normal control 6',
[[['E0', 30, 180, False], ['E1', 45, 180, False], ['E2', 60, 90, True]], [['R0', 40], ['R1', 40]]],
{'placed': {'E2': [['R0', 40], ['R1', 20]]}, 'unplaced': ['E1', 'E0']}),
('normal control 7',
[[['E0', 60, 120, False], ['E1', 30, 120, False], ['E2', 60, 180, True]],
[['R0', 60], ['R1', 50], ['R2', 60]]],
{'placed': {'E0': [['R0', 60]], 'E2': [['R2', 60]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 30, 120, True], ['E1', 60, 90, True], ['E2', 80, 120, True], ['E3', 45, 120, True]],
[['R0', 20], ['R1', 20], ['R2', 30]]],
{'placed': {'E1': [['R2', 30], ['R0', 20], ['R1', 10]]}, 'unplaced': ['E2', 'E3', 'E0']})],
[('regression: best fit room 1',
[[['E0', 20, 90, True], ['E1', 80, 120, False]], [['R0', 30], ['R1', 30], ['R2', 20], ['R3', 60]]],
{'placed': {'E0': [['R2', 20]]}, 'unplaced': ['E1']}),
('regression variant: best fit room 2',
[[['E0', 10, 90, True], ['E1', 20, 120, True], ['E2', 80, 120, False], ['E3', 60, 120, True],
['E4', 20, 120, True]],
[['R0', 50], ['R1', 20], ['R2', 50], ['R3', 30]]],
{'placed': {'E3': [['R0', 50], ['R2', 10]], 'E1': [['R1', 20]], 'E4': [['R3', 20]]},
'unplaced': ['E2', 'E0']}),
('partial repair guard 3',
[[['E0', 30, 120, True], ['E1', 30, 90, True]], [['R0', 30], ['R1', 40], ['R2', 60]]],
{'placed': {'E0': [['R0', 30]], 'E1': [['R1', 30]]}, 'unplaced': []}),
('boundary control 4', [[['A', 30, 120, False], ['B', 30, 90, False]], [['R1', 60]]],
{'placed': {'A': [['R1', 30]]}, 'unplaced': ['B']}),
('normal control 5',
[[['E0', 45, 180, True], ['E1', 80, 90, True], ['E2', 80, 120, True], ['E3', 10, 120, True],
['E4', 30, 90, True]],
[['R0', 30], ['R1', 50], ['R2', 20]]],
{'placed': {'E1': [['R1', 50], ['R0', 30]], 'E3': [['R2', 10]]}, 'unplaced': ['E2', 'E0', 'E4']}),
('normal control 6',
[[['E0', 20, 120, True], ['E1', 20, 120, True], ['E2', 10, 120, True], ['E3', 80, 120, False],
['E4', 80, 120, False]],
[['R0', 40], ['R1', 50], ['R2', 30]]],
{'placed': {'E0': [['R2', 20]], 'E1': [['R0', 20]], 'E2': [['R2', 10]]}, 'unplaced': ['E3', 'E4']}),
('normal control 7',
[[['E0', 20, 90, True], ['E1', 10, 120, True], ['E2', 30, 90, True]],
[['R0', 30], ['R1', 30], ['R2', 50]]],
{'placed': {'E2': [['R0', 30]], 'E0': [['R1', 20]], 'E1': [['R2', 10]]}, 'unplaced': []}),
('normal control 8',
[[['E0', 80, 120, True], ['E1', 80, 90, True], ['E2', 60, 120, True], ['E3', 60, 180, True]],
[['R0', 60], ['R1', 30], ['R2', 60], ['R3', 50]]],
{'placed': {'E0': [['R0', 60], ['R2', 20]], 'E1': [['R3', 50], ['R1', 30]]}, 'unplaced': ['E2', 'E3']})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: best fit room 1 | {'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []} | {'placed': {'A': [['R2', 40]], 'B': [['R1', 20]]}, 'unplaced': []} | Passed |
| regression variant: best fit room 2 | {'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R1', 20]]}, 'unplaced': ['E0']} | Passed |
| partial repair guard 3 | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']} | {'placed': {'E0': [['R0', 60], ['R1', 20]], 'E1': [['R2', 20]]}, 'unplaced': ['E2', 'E3']} | Passed |
| normal control 4 | {'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]}, 'unplaced': ['E1']} | {'placed': {'E0': [['R2', 10]], 'E2': [['R0', 10]], 'E3': [['R1', 10]], 'E4': [['R0', 10]]}, 'unplaced': ['E1']} | Passed |
| normal control 5 | {'placed': {'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | {'placed': {'E0': [['R3', 30]], 'E1': [['R0', 20]], 'E2': [['R2', 10]], 'E3': [['R1', 60]]}, 'unplaced': []} | Passed |
| normal control 6 | {'placed': {'E0': [['R0', 10]], 'E1': [['R1', 20]]}, 'unplaced': ['E2']} | {'placed': {'E0': [['R0', 10]], 'E1': [['R1', 20]]}, 'unplaced': ['E2']} | Passed |
| normal control 7 | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | {'placed': {'E0': [['R1', 10]], 'E1': [['R0', 40], ['R1', 20]]}, 'unplaced': []} | Passed |
| normal control 8 | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | {'placed': {'E1': [['R0', 30], ['R1', 30]]}, 'unplaced': ['E0']} | Passed |
SHA-256 / 1f59a0f8cb82c6b3226ca451ac8e09da651a58425afd1429f214212c2329f31d
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:03.937448+00:00.
Case digest / 9e58d36a86959d672853ea9dc4fe9ff0beeca05b615a654090a2802163f78fa7