Modeling the Inglenook Shunting Puzzle

dc.contributor.authorSimonis, Helmuten
dc.contributor.authorQuesada, Luisen
dc.contributor.funderScience Foundation Irelanden
dc.contributor.funderEuropean Regional Development Funden
dc.date.accessioned2025-07-31T15:30:54Z
dc.date.available2025-07-31T15:30:54Z
dc.date.issued2025-08-11en
dc.description.abstractWe present different models for the Inglenook shunting puzzle, a well known problem for model railway enthusiasts. The puzzle consists of rearranging wagons in a railyard with the help of a shunting locomotive to form a train with selected wagons in a specific order. This can also be seen as a deterministic planning problem, where the length of the plan to be generated is not known in advance. Traditionally, these puzzles are solved by hand, there is only limited literature analyzing the puzzle as a combinatorial problem. We present different models of the problem, and compare their efficiency on the different problem sizes. For the default problem size, all states (350k) and moves (2.2M) can be precomputed, the resulting directed graph can then be analyzed using Dijkstra’s shortest path algorithm. We present an alternative view as a Constraint Satisfaction Problem modelled with large table constraints, which we test with different solver backends. Another alternative model uses string constraints to describe the allowed moves, without enumerating all states, we use the Z3 solver to search for solutions. A third model also does not rely on precomputed states, but models the states for a fixed-length path as constraints over finite domain variables. While there is an interest in solving this puzzle on its own, it also provides a scalable benchmark problem to test CP systems with large table constraints, string constraints, or complex logic formulas over finite domains.en
dc.description.statusPeer revieweden
dc.description.versionAccepted Versionen
dc.format.mimetypeapplication/pdfen
dc.identifier.citationSimonis, H. and Quesada, L. (2025) 'Modeling the Inglenook Shunting Puzzle', ModRef 2025: The 24th workshop on Constraint Modelling and Reformulation, part of CP 2025: The 31st International Conference on Principles and Practice of Constraint Programming, 10-15 August, Glasgow, Scotland.en
dc.identifier.endpage35en
dc.identifier.startpage1en
dc.identifier.urihttps://hdl.handle.net/10468/17768
dc.language.isoenen
dc.publisherModRef 2025en
dc.relation.ispartofModRef 2025: The 24th workshop on Constraint Modelling and Reformulationen
dc.relation.projectinfo:eu-repo/grantAgreement/SFI/Research Centres Programme::Phase 2/12/RC/2289_P2/IE/INSIGHT_Phase 2 /en
dc.rights© 2025, the Authors . This publication has emanated from research conducted with the financial support of Science Foundation Ireland under Grant number 12/RC/2289-P2 at Insight the SFI Research Centre for Data Analytics at UCC, which is co-funded under the European Regional Development Fund. For the purpose of Open Access, the author has applied a CC BY public copyright licence to any Author Accepted Manuscript version arising from this submission.en
dc.rights.urihttps://creativecommons.org/licenses/by/4.0/en
dc.subjectPlanningen
dc.subjectConstraint programmingen
dc.subjectTable constrainten
dc.subjectInglenook puzzleen
dc.titleModeling the Inglenook Shunting Puzzleen
dc.typeConference itemen
Files
Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
main.pdf
Size:
462.95 KB
Format:
Adobe Portable Document Format
Description:
Accepted Version
License bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
2.71 KB
Format:
Item-specific license agreed upon to submission
Description: