-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Source
TimetableDesign
Target
ILP (binary)
Motivation
- Connects the orphan TimetableDesign problem to the main reduction graph via ILP (which has 15+ inbound reductions and connects to QUBO)
- Enables solving TimetableDesign instances using any ILP solver through the standard reduction graph path
- The natural ILP formulation — each constraint of TimetableDesign maps directly to a linear (in)equality
- Enables removing the native solver hook in
src/solvers/ilp/solver.rs:185that currently bypasses the reduction graph for TimetableDesign (added in PR Fix #511: [Model] TimetableDesign #719 as a workaround). Once this rule lands, the hook should be removed and the existing solver dispatch test (test_timetable_design_issue_example_is_solved_via_ilp_solver_dispatch) should be reinforced as a standard closed-loop reduction test that exercisesreduce_to()→ BruteForce solve on ILP →extract_solution()→ verify withevaluate().
Reference
Even, S., Itai, A., & Shamir, A. (1976). On the Complexity of Timetable and Multicommodity Flow Problems. SIAM Journal on Computing, 5(4), 691–703. DOI: 10.1137/0205048
The ILP formulation is the direct translation of the four constraints in the problem definition into linear (in)equalities over binary variables — a standard technique described in de Werra, D. (1985). "An introduction to timetabling," European Journal of Operational Research, 19(2), 151–162. DOI: 10.1016/0377-2217(85)90167-5
Reduction Algorithm
Given a TimetableDesign instance with
-
Variables. Create one binary variable
$x_{c,t,h} \in {0,1}$ for each triple$(c, t, h)$ where$h \in A_C(c) \cap A_T(t)$ . Index the variables in craftsman-major, task-next, period-last order (matching the source model's configuration layout). Let$n$ be the total number of variables created. -
Craftsman exclusivity. For each craftsman
$c \in C$ and period$h \in H$ , add the constraint:
$$\sum_{t \in T : h \in A_T(t)} x_{c,t,h} \leq 1$$
(each craftsman works on at most one task per period). Total:$|C| \cdot |H|$ constraints. -
Task exclusivity. For each task
$t \in T$ and period$h \in H$ , add the constraint:
$$\sum_{c \in C : h \in A_C(c)} x_{c,t,h} \leq 1$$
(each task has at most one craftsman per period). Total:$|T| \cdot |H|$ constraints. -
Requirement satisfaction. For each pair
$(c, t) \in C \times T$ , add the equality constraint:
$$\sum_{h \in A_C(c) \cap A_T(t)} x_{c,t,h} = R(c,t)$$
Total:$|C| \cdot |T|$ constraints. -
Objective. Set the objective to minimize
$0$ (satisfaction problem — any feasible solution suffices).
Solution extraction. The binary vector
Size Overhead
| Target metric | Formula |
|---|---|
num_vars |
num_craftsmen * num_tasks * num_periods |
num_constraints |
num_craftsmen * num_periods + num_tasks * num_periods + num_craftsmen * num_tasks |
Note: num_vars is the worst case (all triples available). The actual count may be smaller when availability restricts some triples.
Validation Method
Closed-loop test: construct a small TimetableDesign instance, reduce to ILP, solve ILP with brute force, extract solution back to TimetableDesign, and verify with evaluate(). The test instance must be small enough for brute-force on the resulting ILP (e.g., 2×2×2 giving 8 ILP vars → 256 configs).
Example
Source (TimetableDesign): 3 craftsmen, 4 tasks, 3 periods.
Craftsman availability:
-
$A_C(c_1) = {h_1, h_2, h_3}$ ,$A_C(c_2) = {h_1, h_2}$ ,$A_C(c_3) = {h_1, h_2, h_3}$
Task availability:
-
$A_T(t_1) = {h_1, h_2}$ ,$A_T(t_2) = {h_2, h_3}$ ,$A_T(t_3) = {h_1, h_2, h_3}$ ,$A_T(t_4) = {h_1, h_3}$
Requirements
| 1 | 1 | 0 | 1 | |
| 0 | 0 | 2 | 0 | |
| 0 | 1 | 0 | 0 |
Construction:
Available triples (24 of 36): for each
Key constraints:
-
Craftsman exclusivity: 9 constraints (
$3 \times 3$ ) -
Task exclusivity: 12 constraints (
$4 \times 3$ ) -
Requirements: 12 equality constraints (
$3 \times 4$ ) - Objective: minimize 0
Constraint cascade:
ILP solution (one of two valid):
Extracted timetable:
-
$h_1$ :$f(c_1, t_1, h_1) = 1$ ,$f(c_2, t_3, h_1) = 1$ -
$h_2$ :$f(c_1, t_2, h_2) = 1$ ,$f(c_2, t_3, h_2) = 1$ -
$h_3$ :$f(c_1, t_4, h_3) = 1$ ,$f(c_3, t_2, h_3) = 1$
All 4 constraints satisfied: availability respected, no double booking, all requirements met. Answer: YES.
This example is non-trivial because
Extra Remark
Native solver hook cleanup (from PR #719 review): PR #719 added a native backtracking solver for TimetableDesign inside ILPSolver::solve_dyn (src/solvers/ilp/solver.rs:185) because no ILP reduction path existed. Once this rule is implemented:
- Remove the
TimetableDesignbranch fromsolve_dyninsrc/solvers/ilp/solver.rs - Remove
solve_via_required_assignments()fromsrc/models/misc/timetable_design.rs - Convert
test_timetable_design_issue_example_is_solved_via_ilp_solver_dispatchinto a standard closed-loop reduction test (test_timetabledesign_to_ilp_closed_loop) that exercisesreduce_to()→ BruteForce solve on ILP →extract_solution()→evaluate(). Use a small instance (e.g., 2×2×2) for brute-force feasibility. - Verify that
pred inspectcorrectly reports ILP as a supported solver andpred solveoutput accurately reflects the reduction path
BibTeX
@article{evenItaiShamir1976,
author = {Shimon Even and Alon Itai and Adi Shamir},
title = {On the Complexity of Timetable and Multicommodity Flow Problems},
journal = {SIAM Journal on Computing},
volume = {5},
number = {4},
pages = {691--703},
year = {1976},
doi = {10.1137/0205048},
}
@article{deWerra1985,
author = {Dominique de Werra},
title = {An Introduction to Timetabling},
journal = {European Journal of Operational Research},
volume = {19},
number = {2},
pages = {151--162},
year = {1985},
doi = {10.1016/0377-2217(85)90167-5},
}Metadata
Metadata
Assignees
Labels
Type
Projects
Status