NS plans its shunting yards in minutes with AI
Dutch rail operator NS uses HIP, a local search algorithm from Utrecht University research, to draft the plans that park, clean and couple its trains at shunting yards.
Nederlandse SpoorwegenNetherlandsRailIn production
- Scale
- Smaller hubs such as Enkhuizen, Leeuwarden and Vlissingen
- Scenario
- Train shunting yard planning
- Business function
- Supply chain and logistics
- Kind of solution
- Scheduling and routing optimization
- Who built it
- Built with a partner (Utrecht University)
- Human oversight
- Assists people
- Organization
- Enterprise, 10,000 to 99,999 employees
- AI types
- Optimization
- Users
- around 120
- Sites
- 32
tl;drNS now drafts plans for smaller shunting yards in minutes and plans days ahead instead of weeks.See the results
Nederlandse Spoorwegen (NS), the main Dutch passenger rail operator, uses an AI-based planning method at its shunting yards1. The Hybrid Integrated Planning Method (HIP) drafts where trains park, when they’re cleaned and inspected, and how they move between platform and yard1, 3.
HIP rests on a local search algorithm that Roel van den Broek developed for his PhD at Utrecht University, in research that NS funded1, 2. NS then built the algorithm into its own planning software3.
As of March 2026, NS uses HIP at smaller hubs such as Enkhuizen, Leeuwarden and Vlissingen1. There it generates plans within minutes, and NS plans days in advance instead of weeks1.
Before the deployment
Outside the rush hours, NS parks its surplus train units at shunting yards, where they’re also cleaned, inspected and coupled1. The yards lie close to major stations in urban areas, so their space is very limited4.
- Manual planning: A team of around 120 planners prepared the yard plans, largely by hand1.
- Long lead time: Planners started more than a month before execution, when little was known about the real situation on the day1.
- Costly changes: If the timetable changed in the final month, for example after track damage, a month’s worth of plans had to be redone1.
- Full yards: Dutch shunting yards reached occupancies of up to 90%4.
- Slow earlier tool: NS’s earlier tool, OPG, took so long to compute that it held no advantage over human planners3.
The planning problem joins several NP-hard problems2. It matches arriving units to departing trains, schedules cleaning and maintenance, and parks trains so that the yard runs without conflicts2.
What was built
HIP drafts a complete shunting and service plan for one station and its yards, and planners turn the best draft into the final schedule1, 3.
- Initial plan builder: Solves the subproblems in turn. It matches arriving and departing trains, selects a yard and a route for each train, and assigns parking tracks3.
- Local search algorithm: Generates hundreds of possible plans, keeps the best, and refines it through hundreds of small variations1. It continues until it finds a plan without delays, crossings or track length violations6.
- Driver assignment: The local search also chooses the shunting drivers’ shifts, by using heuristics6, 3.
- Planners: Polish the algorithm’s best plan into the final schedule, and can adjust any plan as they see fit1.
“Humans remain in control. AI is a support tool.”
Alternatives considered
- Decomposition into subproblems: NS’s earlier OPG tool solved each subproblem separately. The results were poor because the subproblems didn’t interact, and the tool was too slow to beat human planners3.
- Mixed integer linear program: The researchers compared their local search with an existing mixed integer linear program on realistic NS instances. The local search was the first method to solve real-world instances of the complete problem2.
Rollout
The phases took the method from a published algorithm to use at smaller hubs1, 2. NS plans to extend HIP to larger hubs such as Amsterdam and Utrecht, and eventually to all 32 stabling yards1.
Technology and architecture
The builder hands the local search a complete plan that can still contain conflicts6. The builder uses simple heuristics based on mixed integer programming (MIP) and constraint programming (CP). Because the plan is allowed to contain conflicts, it’s easy to construct6. The local search follows the simulated annealing framework4.
| Layer | What they used | Role | Source |
|---|---|---|---|
| Solution platform | Hybrid Integrated Planning Method (HIP) | NS’s planning software that produces the plan for a station and its yards | 1, 3 |
| Optimizer | Initial plan heuristics (MIP and CP) | Build a complete starting plan that may still hold conflicts | 3, 6 |
| Optimizer | Local search algorithm | Removes conflicts through small changes and assigns drivers | 1, 4, 6 |
| Review workbench | Plan adjustment by planners | Planners polish and adjust the drafted plans | 1 |
Data inputs
- Timetable and rolling stock: The arrival and departure times and train compositions, fixed before the yard plan is made3, 6.
- Station and yard layout: The available tracks and the possible routes from each platform to each yard1, 3.
- Service tasks: Cleaning, toilet emptying, and mechanical inspections or repairs that each train needs6.
- Staff and safety rules: The available staff and the rules for safe shunting that a human planner also applies1.
- Test instances: Realistic instances from NS, on which the researchers tested the local search2.
How one yard plan flows through HIP
- A train arrives at a platform, and its passengers disembark. From then on, the node planner is responsible for the train6.
- The initial plan builder matches each arriving train unit to a departing train3.
- The builder selects a yard and a route for each train, and then assigns its parking track3.
- HIP combines the results into a plan graph, which is the input for the local search3.
- The local search makes small changes until the plan is conflict-free, and it assigns the drivers6.
- A planner polishes the best plan into the final schedule1.
Results
| Metric | Before | After | Scope and timeframe | Reported by |
|---|---|---|---|---|
| Planning horizon | Weeks in advance | Days in advance | Smaller hubs where NS uses HIP, as of March 2026 | NS, measured1 |
| Time to generate a plan | Not disclosed | Within minutes | Smaller stations, as of March 2026 | Utrecht University, measured1 |
- Planning horizon: How far ahead of the day of operation planners fix a yard plan. Planning later lets NS take in timetable changes and leaves more room for planning passenger services1.
- Time to generate a plan: Covers smaller stations. In research tests presented in November 2023, the algorithm found a plan option for Enkhuizen within a few seconds5.
Lessons learned
NS funded the research and then built the algorithm into its own planning software2, 3. Han Hoogeveen, who proposed the approach to NS, said the PhD work showed that it worked and convinced the NS board to invest1.
HIP works at smaller hubs only for now1. A local search run took around one hour for Amersfoort and more than 10 hours for Utrecht, and after 10 hours the Utrecht plan still held a couple of dozen conflicts3, 6.
The local search makes many random small changes, so its plans lack a clear structure6. NS states that plans are easier to understand and execute when they share a structure, and it tests better initial plans with Utrecht as the demonstrator6.
The rollout took longer than first expected. In December 2023, Utrecht University expected the software to go into operation the next year5. Its use at smaller hubs was announced in March 20261.
Planners keep their role. They polish every plan, and NS designed the system so that they can change any plan1.
The planning speed and horizon figures are statements by NS and Utrecht University, from the university’s announcement1.
Case study scorecard
- Days in advance Planning horizon for shunting yard plans1
- Within minutes Time to generate a shunting yard plan1
Sources by publication date
- Organization 2
- Vendors and partners 3
- Press, academic, and regulators 3
Build this solution yourself
Analysis
What you need
- A digital model of each station and yard: You need the tracks, the routes from each platform to each yard, and the service facilities, because HIP plans every move against them1, 3.
- A settled timetable and rolling stock plan: NS makes the yard plan after the timetable and the rolling stock assignment are fixed, so you need both as input6.
- Planners who finish the plans: NS planners polish each plan, and the random changes of the local search make plans harder to read, so you need people in the loop1, 6.
- Small yards to start with: HIP plans small hubs in minutes, while the Utrecht node ran for hours without a conflict-free plan, so start where the problem is small1, 6.
Reference architecture
Scheduling and routing optimization
A scheduling and routing optimization solution computes who or what goes where, in what order, and when, within the constraints that apply. An optimizer builds a plan from the work, live positions and conditions, and the organization's rules, and rebuilds it as conditions change. Planners approve or finish the plan or steer it through limits, and the people who carry it out can depart from it.
- Operational system
- Live positions and conditions
- Network and reference data
- Rules and priorities
- Forecasting model
- Optimizer (documented in this case study)
- Planner console
- Field app
- Customer app or website
- Planning platform (documented in this case study)
- Machine learning platform
- Offline evaluation
A check mark shows a building block that this case study's sources document.
Open the reference architectureOthers who built it
- Union Pacific: Its Block Optimizer combines its team’s expertise with machine processing to group rail cars earlier and cut re-sorting at terminals7.
- PSA Antwerp: In March 2026, its Europa Terminal went live with INFORM’s Integrated Terminal Scheduler, which optimizes move schedules for stacking cranes, straddle carriers and quay cranes8.
In the library
- Alaska Airlines cuts fuel burn with AI route optimization Alaska Airlines
- How American Airlines uses AI to save tight connections American Airlines
- AI production planning takes 91.6% less time at Atlas Copco Atlas Copco
- UPS's ORION cuts 6 to 8 miles from each delivery route UPS
- GlobalFoundries fills idle fab tool time with AI dispatching GlobalFoundries
- AI disruption tools cut Heathrow delays at British Airways British Airways
Cite this case study
Enterprise AI Case Studies. "NS plans its shunting yards in minutes with AI." Updated Nov 21, 2026. https://case-studies.ai/case-studies/operational-technology/OT-034-shunting-yard-planning-ns/
@misc{csai-ot-034,
author = {{Enterprise AI Case Studies}},
title = {{NS plans its shunting yards in minutes with AI}},
year = {2026},
note = {Updated 2026-11-21},
url = {https://case-studies.ai/case-studies/operational-technology/OT-034-shunting-yard-planning-ns/}
}Sources
The following reporting, and every passage quoted from it, belongs to its publisher, not to this site. Sources and ownership
- Source 1:
National railway operator NS uses smart software for planning at shunting yards
Supporting excerpts (19)
NS is deploying a new AI-based method to plan trains at shunting yards.
The algorithm is based on research by Roel van den Broek, who completed his PhD on the subject at Utrecht University.
Outside the timetable, these units must be parked, cleaned, inspected and coupled before being put back into service.
Planning at these sites is still largely done manually by a team of around 120 planners.
They prepare the plans more than a month before execution, based on the information available at the time about the eventual real-life situation, which is still limited.
If the timetable changes in the final month before implementation, for example due to damage to the track, a month’s worth of plans has to be rescheduled.
For smaller stations, the system can now generate plans within minutes, taking into account all the aspects a human planner must consider: available tracks and staff, required service tasks, and rules for safe shunting.
Joris Snijders, responsible at NS for implementing the new software
It generates hundreds of possible plans, from which the best is selected. The algorithm then creates hundreds of variations on that plan, with small adjustments to the original.
Planners subsequently polish the algorithm’s best plan into a final schedule.
The so-called Hybrid Integrated Planning Method (HIP)
Because of the time savings we achieve, we move from planning weeks in advance to planning days in advance. That allows us to incorporate changes at a later stage. It also creates more room for planning passenger services.
For the time being, the algorithm can be used at smaller hubs, such as the stations of Enkhuizen, Leeuwarden and Vlissingen. The ambition is to eventually deploy it at larger hubs as well, including Amsterdam and Utrecht.
Ultimately we want to plan train movements at all 32 stabling yards in this way. Within a European subsidy project we are working to further develop the method.
The system has been designed so that users can still adjust plans as they see fit.
Humans remain in control. AI is a support tool.
This algorithm proves that fundamental research can find its way into practical application.
He proposed the new approach to NS.
Roel van den Broek subsequently demonstrated brilliantly that this approach really works, and that convinced the NS board to invest in it.
- Source 2:
A local search algorithm for train unit shunting with service scheduling
Supporting excerpts (6)
This problem originates from Dutch Railways, which is the main railway operator in the Netherlands.
The problem consists of matching train units arriving on a shunting yard to departing trains, scheduling service tasks such as cleaning and maintenance on the available resources, and parking the trains on the available tracks such that the shunting yard can operate conflict-free.
These different aspects lead to a computationally extremely difficult problem, which combines several well-known NP-hard problems.
The proposed solution method is compared with an existing mixed integer linear program in a computational study on realistic instances provided by Dutch Railways.
We show that our local search algorithm is the first method to solve real-world problem instances of the complete shunting and scheduling problem.
This research was funded by a grant from Dutch Railways.
- Source 3:
Constraint Programming for Rail Workforce Scheduling
Supporting excerpts (12)
This led Nederlandse Spoorwegen (NS), the main passenger railway operator in the Netherlands, to develop the HIP (Hybride Integrale Planmethode), an algorithm that generates a solution for the TUSP at their stations.
The algorithm works by creating an initial solution, which is then used as input to a local search, producing a feasible solution.
At that time, NS used a tool named OPG to solve all TUSP subproblems. However, the computation time was so high that it was not an advantage in comparison to using human planners.
Nonetheless, it is hard to achieve good results with this method as there is no interaction between the different subproblems.
The HIP is the algorithm soon to be employed to compute the shunt plan at a station at NS.
First, the matching of arrival and departure trains is calculated.
which is the yard selection and shunt routing
input is the possible routes from each platform to each yard. In yard selection, trains are distributed to the available yards.
Then, the corresponding parking tracks for each train in the yard are assigned
The final plan graph is then the input for the local search.
Currently, the drivers’ schedules for the shunt trains are computed in the local search of the HIP.
around one hour for Amersfoort and more than 10 hours for Utrecht
- Source 4:
A Local Search Algorithm for Train Unit Shunting with Service Scheduling (author manuscript)
Supporting excerpts (4)
Due to the proximity of shunting yards in the Netherlands to major stations, located in urban areas, their size, and thus their parking capacity, is very limited, reaching occupancies of up to 90%.
We have based our algorithm on the Simulated Annealing framework
A shunting and service plan constructed by the local search is then feasible if and only if none of the relaxed problem constraints are violated.
The maximum computation time is based on preferences of NS.
- Source 5:
NS to work with algorithms AI Labs
Supporting excerpts (3)
He presented his findings during the kickoff event of the RAIL Lab, that took place in November. The software is expected to be put into operation next year.
Van den Broek developed an algorithm that calculates an option for a station like Enkhuizen within a few seconds
The algorithm also works for larger stations like Amsterdam and Utrecht, but it requires significantly more computing time—more than ten hours.
- Source 6:
Supporting excerpts (20)
Jord Boeijink NSR Author Section 8.2
requiring planners to start weeks in advance.
The trains arrive at a platform track in the station, the passengers disembark, and the doors close. From this point onward the train is the responsibility of the node planner
The rolling stock stabling plan is created after the timetable has been created, the network planning has been completed, and rolling stock has been assigned to the trains.
The trains stabled on a node might require service, such as, internal and external cleaning, toilet emptying, and mechanical inspections or repairs.
The core of the solver is a local search algorithm.
but it is allowed to contain infeasibilities, such as delays, crossings and track length violations.
Driver shifts do not need to be explicitly determined in the initial plan, as these are chosen heuristically by the local search solver.
Since infeasibilities (or conflicts) are allowed such an initial plan can be easily constructed, and this is currently done with relatively simple heuristics (using MIP, CP) with many simplifications.
local search is then used to iteratively improve the plan by small, local mutations to the plan until a conflict-free plan has been found.
This works fine for smaller nodes, but makes the problem hard to solve for large nodes like Utrecht.
(after 10 hours the node of Utrecht still has a couple of dozens conflicts)
Secondly, the local search creates plans with no clear structure
This is undesired since plans are easier to understand and execute if they are always of a more or less similar structure.
the plans can be made more recognizable to planners.
The node of Utrecht, also the demonstrator for this research
Prior to these algorithms a matching has already been determined using an existing MIP model.
experiments were performed on real life scenarios.
For each experiment the scenarios were run with 18 random seeds
However, the new method is able to solve more instances within the allotted time (8 vs. 3).
- Source 7:
Fewer Stops, Faster Service: The Future of Freight Rail
Supporting excerpts (2)
Block Optimizer combines our team’s expertise with machine processing to identify opportunities to group rail cars earlier in their journey.
helps minimize re-sorting at terminals
- Source 8:
INFORM Enables High-Performance Hybrid Operations at PSA Antwerp's Europa Terminal
Supporting excerpts (2)
INFORM and PSA Antwerp announce the successful go-live of the Integrated Terminal Scheduler (ITS) at Europa Terminal in March 2026.
INFORM’s ITS was selected to optimize move schedules for Automated Stacking Cranes (ASCs), Straddle Carriers (SCs), and Quay Cranes (QCs) throughout all phases of the upgrade and beyond.
Comments
Start the conversation.
Invited members of the library comment here. Sign in to join the conversation.