Skip to main content

An Improvement of the Greedy Algorithm for the \((n^2-1)\)-Puzzle

  • Conference paper
  • First Online:
Computational Science and Its Applications -- ICCSA 2015 (ICCSA 2015)

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

Included in the following conference series:

  • 2324 Accesses

Abstract

For \(n\ge 4\), the \((n^2-1)\)-Puzzle is a generalization of the well known 15-Puzzle. Ratner et al. showed that finding a sequence of moves of minimum length for the \((n^2-1)\)-Puzzle is NP-hard, and many researches have been devoted to it. For the \((n^2-1)\)-Puzzle, a real-time algorithm is proposed by Parberry, which completes the puzzle in at most \(5n^3 - 9n^2/2 + 19n/2 -89\) moves and needs O(1) computation time per move, although there is no guarantee that the number of moves is minimum. In this paper, we follow the direction of the research by Parberry, and present an algorithm, which is obtained by modifying Parberry’s algorithm and giving a tight analysis. The number of moves by the new algorithm is smaller; it needs at most \(5n^3 -21n^2/2 + 35n/2 - 141\) moves.

This work was supported by JSPS KAKENHI Grant Number 25330018.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. Bhasin, H., Singla, N.: Genetic based algorithm for N-puzzle problem. Int. J. Computer Applications 51(22), 44–50 (2012)

    Article  Google Scholar 

  2. Brüngger, A., Marzetta, A., Fukuda, K., Nievegelt, J.: The parallel search bench ZRAM and its applications. Annals of Operations Research 90, 45–63 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  3. Johnson, W., Story, W.E.: Notes on the “15” puzzle. American Journal of Mathematics 2(4), 397–404 (1879)

    Article  MATH  MathSciNet  Google Scholar 

  4. Levitin A., Papalaskari, M.-A.: Using puzzles in teaching algorithms. In: Proc. SIGCSE 2002, pp. 292–296 (2002)

    Google Scholar 

  5. Parberry, I.: A real-time algorithm for the (\(n^2-1\))-puzzle. Information Processing Letters 56, 23–28 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  6. Ratner, D., Warmuth, M.: The \((n^2-1)\)-puzzle and related relocation problems. J. Symbolic Computation 10, 111–137 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  7. Reinefeld, A.: Complete solution of the eight-puzzle and the benefit of node ordering in IDA*. In: Proc. Int. Joint Conf. Artificial Intelligence, pp. 248–253 (1993)

    Google Scholar 

  8. Schofield, P.D.A.: Complete solution of the eight puzzle. Machine Intelligence 1, 125–133 (1967)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yuichi Asahiro .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Utsunomiya, K., Asahiro, Y. (2015). An Improvement of the Greedy Algorithm for the \((n^2-1)\)-Puzzle. In: Gervasi, O., et al. Computational Science and Its Applications -- ICCSA 2015. ICCSA 2015. Lecture Notes in Computer Science(), vol 9156. Springer, Cham. https://doi.org/10.1007/978-3-319-21407-8_33

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-21407-8_33

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-21406-1

  • Online ISBN: 978-3-319-21407-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics