Modeling the Inglenook Shunting Puzzle
dc.contributor.author | Simonis, Helmut | en |
dc.contributor.author | Quesada, Luis | en |
dc.contributor.funder | Science Foundation Ireland | en |
dc.contributor.funder | European Regional Development Fund | en |
dc.date.accessioned | 2025-07-31T15:30:54Z | |
dc.date.available | 2025-07-31T15:30:54Z | |
dc.date.issued | 2025-08-11 | en |
dc.description.abstract | We 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.status | Peer reviewed | en |
dc.description.version | Accepted Version | en |
dc.format.mimetype | application/pdf | en |
dc.identifier.citation | Simonis, 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.endpage | 35 | en |
dc.identifier.startpage | 1 | en |
dc.identifier.uri | https://hdl.handle.net/10468/17768 | |
dc.language.iso | en | en |
dc.publisher | ModRef 2025 | en |
dc.relation.ispartof | ModRef 2025: The 24th workshop on Constraint Modelling and Reformulation | en |
dc.relation.project | info: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.uri | https://creativecommons.org/licenses/by/4.0/ | en |
dc.subject | Planning | en |
dc.subject | Constraint programming | en |
dc.subject | Table constraint | en |
dc.subject | Inglenook puzzle | en |
dc.title | Modeling the Inglenook Shunting Puzzle | en |
dc.type | Conference item | en |