Complexity of Regex Crosswords

  • Stephen FennerEmail author
  • Daniel PadéEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11417)


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 Open image in new window -complete. Using a reduction from Open image in new window , 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 Open image in new window -complete.


Complexity Regular expressions Regex crossword Picture language NP-complete 



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.


  1. 1.
  2. 2.
  3. 3.
    MIT Mystery Hunt.
  4. 4.
  5. 5.
  6. 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). mR0216954MathSciNetCrossRefGoogle Scholar
  7. 7.
    Black, L.: Can you do the regular expression crossword? I programmer, February 2013.
  8. 8.
    Fenner, S.: The complexity of some regex crossword problems (2014)Google Scholar
  9. 9.
    Giammarresi, D., Restivo, A.: Recognizable picture languages. Int. J. Pattern Recogn. Artif. Intell. 31–46 (1992)Google Scholar
  10. 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). Chap. 96CrossRefGoogle Scholar
  11. 11.
    Latteux, M., Simplot, D.: Recognizable picture languages and domino tiling. Theor. Comput. Sci. 178(1–2), 275–283 (1997). NoteMathSciNetCrossRefGoogle Scholar
  12. 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)zbMATHGoogle Scholar
  13. 13.
    Takahashi, G.: Are regex crosswords NP-hard? cS Stack Exchange question 30143, answered by FrankW, September 2014.
  14. 14.
    Takahashi, G.: Are regex crosswords NP-hard? CS Stack Exchange question 30143, answered by FrankW (2014).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.University of South CarolinaColumbiaUSA

Personalised recommendations