Skip to main content

Complexity of Regex Crosswords

  • Conference paper
  • First Online:
Language and Automata Theory and Applications (LATA 2019)

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

  • 532 Accesses

Abstract

In a regular expression crossword puzzle, one is given two non-empty lists \(\langle {} \langle {} R_1,\ldots , R_m \rangle {}\) and \(\langle {} C_1, \ldots , C_n \rangle {} \rangle {}\) over some alphabet, and the challenge is to fill in an \(m\times n\) grid of characters such that the string formed by the \(i^\text {th}\) row is in \(L(R_i)\) and the string in the \(j^\text {th}\) column is in \(L(C_j)\). We consider a restriction of this puzzle where all the \(R_i\) are equal to one another and similarly the \(C_j\). We consider a 2-player version of this puzzle, showing it to be -complete. Using a reduction from , we also give a new, simple proof of the known result that the existence problem of a solution for the restricted (1-player) puzzle is -complete.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Glen Takahashi posted this question to Stack Exchange in 2012 [13], but it has been asked by others independently.

  2. 2.

    In the same paper, a restriction of where the unique row and column regexes are equal to each other was also shown -complete.

  3. 3.

    More precisely, the question is whether the sentence \(\exists x_0 \forall y_0 \cdots \exists x_{k-1} \forall y_{k-1}\exists x_k [\tilde{\varphi }(x_0, y_0, \ldots , x_{k-1}, y_{k-1}, x_k) = \textsc {True}]\) holds in the two-element Boolean algebra \((\{\textsc {False},\textsc {True}\},\mathrel {\wedge },\mathrel {\vee },\lnot )\).

  4. 4.

    For the last move of the game, Rose or Colin may encounter a row or column, respectively, that is already completely filled in. In this case, she or he wins if and only if the row or column matches the corresponding regular expression.

References

  1. http://regexcrossword.com

  2. http://www.regexcrosswords.com

  3. MIT Mystery Hunt. http://www.mit.edu/~puzzle

  4. Royal dinner. http://regexcrossword.com/challenges/experienced/puzzles/1

  5. Slashdot discussion, February 2013. http://games.slashdot.org/story/13/02/13/2346253/can-you-do-the-regular-expression-crossword

  6. Berger, R.: The undecidability of the domino problem. No. 66 in memoirs of the American Mathematical Society. American Mathematical Society, Providence, Rhode Island (1966). mR0216954

    Article  MathSciNet  Google Scholar 

  7. Black, L.: Can you do the regular expression crossword? I programmer, February 2013. http://www.i-programmer.info/news/144-graphics-and-games/5450-can-you-do-the-regular-expression-crossword.html

  8. Fenner, S.: The complexity of some regex crossword problems (2014)

    Google Scholar 

  9. Giammarresi, D., Restivo, A.: Recognizable picture languages. Int. J. Pattern Recogn. Artif. Intell. 31–46 (1992)

    Google Scholar 

  10. Giammarresi, D., Restivo, A.: Two-dimensional languages. In: Rozenberg, G., Salomaa, A. (eds.) Handbook of Formal Languages, vol. 3, pp. 215–267. Springer, Heidelberg (1997). https://doi.org/10.1007/978-3-642-59126-6_4. Chap. 96

    Chapter  Google Scholar 

  11. Latteux, M., Simplot, D.: Recognizable picture languages and domino tiling. Theor. Comput. Sci. 178(1–2), 275–283 (1997). Note

    Article  MathSciNet  Google Scholar 

  12. Rosenfeld, A., Rheinboldt, W.: Picture Languages: Formal Models for Picture Recognition. Computer Science and Applied Mathematics. Elsevier Inc., Academic Press Inc., New York (1979)

    MATH  Google Scholar 

  13. Takahashi, G.: Are regex crosswords NP-hard? cS Stack Exchange question 30143, answered by FrankW, September 2014. http://cs.stackexchange.com/questions/30143/are-regex-crosswords-np-hard

  14. Takahashi, G.: Are regex crosswords NP-hard? CS Stack Exchange question 30143, answered by FrankW (2014). http://cs.stackexchange.com/questions/30143/are-regex-crosswords-np-hard

Download references

Acknowledgments

We would like to thank Thomas Thierauf for several interesting discussions on this topic and to Joshua Cooper for finding for us a particularly challenging and fun regex crossword puzzle. We are also grateful to Klaus-Jörn Lange for suggesting the connection between our work and the theory of picture languages.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Stephen Fenner or Daniel Padé .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Fenner, S., Padé, D. (2019). Complexity of Regex Crosswords. In: Martín-Vide, C., Okhotin, A., Shapira, D. (eds) Language and Automata Theory and Applications. LATA 2019. Lecture Notes in Computer Science(), vol 11417. Springer, Cham. https://doi.org/10.1007/978-3-030-13435-8_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-13435-8_16

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-13434-1

  • Online ISBN: 978-3-030-13435-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics