Skip to main content

How to Sort by Walking on a Tree

  • Conference paper
  • First Online:
Algorithms - ESA 2015

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9294))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Chapter  Google Scholar 

  2. 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)

    Article  MATH  Google Scholar 

  3. Edmonds, J.: Optimum branchings. Journal of Research of the National Bureau of Standards B 71(4), 233–240 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  4. Haddon, B.K.: Cycle-sort: a linear sorting method. The Computer Journal 33(4), 365–367 (1990)

    Article  Google Scholar 

  5. Hearn, R.A.: The complexity of sliding block puzzles and plank puzzles. Tribute to a Mathemagician, pp. 173–183 (2005)

    Google Scholar 

  6. Itai, A., Papadimitriou, C.H., Szwarcfiter, J.L.: Hamilton paths in grid graphs. SIAM Journal on Computing 11(4), 676–686 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  7. Karp, R.M.: A simple derivation of edmonds’ algorithm for optimum branchings. Networks 1(3), 265–272 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  8. Knuth, D.E.: The art of computer programming: sorting and searching, vol. 3. Pearson Education (1998)

    Google Scholar 

  9. Tarjan, R.E.: Finding optimum branchings. Networks 7(1), 25–35 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. Zwick, U.: Directed minimum spanning trees (April 2013), http://www.cs.tau.ac.il/~zwick/grad-algo-13/directed-mst.pdf

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daniel Graf .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics