Skip to main content
Log in

Matchstick Puzzles on a Grid

  • Original Paper
  • Published:
Graphs and Combinatorics Aims and scope Submit manuscript

Abstract

In this paper, we consider two kinds of matchstick puzzles. In both puzzles, matchsticks can be placed only on the edges of a square grid. The first problem is to make a given placement of matchsticks by moving the designated number of matchsticks. We show an algorithm to solve this problem using string matching with errors that is faster than exhaustive search. The second problem is to make the designated number of squares by moving the designated number of matchsticks. We show that this problem is NP-complete by reduction from circuit-SAT. We also show that the problem can be solved in polynomial time if the width of the grid is bounded by a constant.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

References

  1. Hearn, R.A., Demaine, E.D.: Games, Puzzles, and Computation. A.K. Peters, Natick (2009)

    Book  Google Scholar 

  2. Andersson, D.: Hashiwokakero is NP-complete. Inf. Process. Lett. 109(19), 1145–1146 (2009)

    Article  MathSciNet  Google Scholar 

  3. Kölker, J.: Kurodoko is NP-complete. J. Inf. Process. 20(3), 694–706 (2012)

    Google Scholar 

  4. Takenaga, Y., Aoyagi, S., Iwata, S., Kasai, T.: Shikaku and Ripple Effect are NP-complete. Congressus Numerantium 216, 119–127 (2013)

    MathSciNet  MATH  Google Scholar 

  5. Ishibashi, A., Sato, Y., Iwata, S.: NP-completeness of two pencil puzzles: Yajilin and Country Road. Util. Math. 88, 237–246 (2012)

    MathSciNet  MATH  Google Scholar 

  6. Amir, A., Lewenstein, M., Porat, E.: Faster algorithm for string matching with \(k\) mismatches. J. Algorithms 50(2), 257–275 (2004)

    Article  MathSciNet  Google Scholar 

  7. Nocolae, M., Rajasekaran, S.: On string matching with mismatches. Algorithms 8(2), 248–270 (2015)

    Article  MathSciNet  Google Scholar 

  8. Goldschlager, L.M.: The monotone and planar circuit value problems are log space complete for P. SIGACT News 9(2), 25–29 (1977)

    Article  Google Scholar 

Download references

Acknowledgements

This work was partially supported by JSPS KAKENHI Grant number 15K00505.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yasuhiko Takenaga.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Takenaga, Y., Mishiba, S. & Sugiyama, H. Matchstick Puzzles on a Grid. Graphs and Combinatorics 36, 347–357 (2020). https://doi.org/10.1007/s00373-019-02078-3

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00373-019-02078-3

Keywords

Mathematics Subject Classification

Navigation