1 research outputs found

    The complexity of some regex crossword problems

    Full text link
    In a typical regular expression (regex) crossword puzzle, you are given two nonempty lists R1,…,RmR_1,\ldots,R_m and C1,…,CnC_1,\ldots,C_n of regular expressions over some alphabet, and your goal is to fill in an mΓ—nm\times n grid with letters from that alphabet so that the string formed by the iith row is in L(Ri)L(R_i), and the string formed by the jjth column is in L(Cj)L(C_j), for all 1≀i≀m1\le i\le m and 1≀j≀n1\le j\le n. Such a grid is a solution to the puzzle. It is known that determining whether a solution exists is NP-complete. We consider a number of restrictions and variants to this problem where all the RiR_i are equal to some regular expression RR, and all the CjC_j are equal to some regular expression CC. We call the solution to such a puzzle an (R,C)(R,C)-crossword. Our main results are the following: 1. There exists a fixed regular expression CC over the alphabet {0,1}\{0,1\} such that the following problem is NP-complete: "Given a regular expression RR over {0,1}\{0,1\} and positive integers mm and nn given in unary, does an mΓ—nm\times n (R,C)(R,C)-crossword exist?" This improves the result mentioned above. 2. The following problem is NP-hard: "Given a regular expression EE over {0,1}\{0,1\} and positive integers mm and nn given in unary, does an mΓ—nm\times n (E,E)(E,E)-crossword exist?" 3. There exists a fixed regular expression CC over {0,1}\{0,1\} such that the following problem is undecidable (equivalent to the Halting Problem): "Given a regular expression RR over {0,1}\{0,1\}, does an (R,C)(R,C)-crossword exist (of any size)?" 4. The following problem is undecidable (equivalent to the Halting Problem): "Given a regular expression EE over {0,1}\{0,1\}, does an (E,E)(E,E)-crossword exist (of any size)?"Comment: 25 pages, 3 figures; three references added with explanation, citation added to Corollary 5, more detail in proof of Theorem 8, other minor corrections (results unchanged
    corecore