every night a metro depot decides where each train parks and in what order they leave. get it wrong and you are shunting trains at four in the morning.
certificates and maintenance windows constrain what can run at all. branding contracts want particular trains on particular lines. mileage wants to stay even so nothing wears out first.
real constraints and no clean optimum, which is exactly why it was worth doing.
the shape of the problem
25 four car trainsets, one depot at muttom, a service day from 06:00 to 22:30. every night seven to nine trains are marked active and the rest go to standby or the inspection bay, whose jobs have to fit between 21:00 and 05:30.
how it decides
in stages, solved with cp-sat from or-tools. first the assignment, minimising risk, branding shortfall, mileage variance, cleaning penalties and shunting. then the inspection bay schedule, so every job is finished by 05:30 with as few moves as possible. then stabling and the morning turnout order.
it is offline and single depot. no live integrations, no mid day rescheduling, no crew rostering. every decision comes with an explanation, and there is a what-if mode.








