Scheduling Trams in the Morning is Hard

In this note, we prove NP-completeness of the following problem: Given a set of trams of diierent types, which are stacked on sidings in their depot and an order in which trams of speciied types are supposed to leave. Is there an assignment of trams to departure times without any shunting movements? In the particular case where the number of sidings is xed, the problem is solvable in polynomial time. We derive a dynamic program and improve its performance by a state elimination scheme. We implemented three variants of the dynamic program and applied them to random data as well as to real-world data.