Abstract
Consider a graph G with n vertices. On each vertex we place a box. These n vertices and n boxes are both numbered from 1 to n and initially shuffled according to a permutation π ∈ S n . We introduce a sorting problem for a single robot: In every step, the robot can walk along an edge of G and can carry at most one box at a time. At a vertex, it may swap the box placed there with the box it is carrying. How many steps does the robot need to sort all the boxes?
We present an algorithm that produces a shortest possible sorting walk for such a robot if G is a tree. The algorithm runs in time \(\mathcal{O}(n^2)\) and can be simplified further if G is a path. We show that for planar graphs the problem of finding a shortest possible sorting walk is \(\mathcal{NP}\)-complete.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Büsing, C., Maue, J.: Robust algorithms for sorting railway cars. In: de Berg, M., Meyer, U. (eds.) ESA 2010, Part I. LNCS, vol. 6346, pp. 350–361. Springer, Heidelberg (2010)
Carlo, H.J., Vis, I.F., Roodbergen, K.J.: Storage yard operations in container terminals: Literature overview, trends, and research directions. European Journal of Operational Research 235(2), 412–430 (2014)
Edmonds, J.: Optimum branchings. Journal of Research of the National Bureau of Standards B 71(4), 233–240 (1967)
Haddon, B.K.: Cycle-sort: a linear sorting method. The Computer Journal 33(4), 365–367 (1990)
Hearn, R.A.: The complexity of sliding block puzzles and plank puzzles. Tribute to a Mathemagician, pp. 173–183 (2005)
Itai, A., Papadimitriou, C.H., Szwarcfiter, J.L.: Hamilton paths in grid graphs. SIAM Journal on Computing 11(4), 676–686 (1982)
Karp, R.M.: A simple derivation of edmonds’ algorithm for optimum branchings. Networks 1(3), 265–272 (1971)
Knuth, D.E.: The art of computer programming: sorting and searching, vol. 3. Pearson Education (1998)
Tarjan, R.E.: Finding optimum branchings. Networks 7(1), 25–35 (1977)
Yamanaka, K., Demaine, E.D., Ito, T., Kawahara, J., Kiyomi, M., Okamoto, Y., Saitoh, T., Suzuki, A., Uchizawa, K., Uno, T.: Swapping labeled tokens on graphs. In: Ferro, A., Luccio, F., Widmayer, P. (eds.) FUN 2014. LNCS, vol. 8496, pp. 364–375. Springer, Heidelberg (2014)
Zwick, U.: Directed minimum spanning trees (April 2013), http://www.cs.tau.ac.il/~zwick/grad-algo-13/directed-mst.pdf
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Graf, D. (2015). How to Sort by Walking on a Tree. In: Bansal, N., Finocchi, I. (eds) Algorithms - ESA 2015. Lecture Notes in Computer Science(), vol 9294. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-48350-3_54
Download citation
DOI: https://doi.org/10.1007/978-3-662-48350-3_54
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-48349-7
Online ISBN: 978-3-662-48350-3
eBook Packages: Computer ScienceComputer Science (R0)