In our project we implemented a program that solves cryptoquotes. A cryptoquote is effectively a simple substitution cipher, where each letter represents one letter and no two letters are represented by the same letter. This problem is interesting because it has direct and obvious applications in cryptography.

We approached this problem by representing it as a Constraint Satisfaction Problem. The variables are the encrypted letters, and their domains are the possible assignments for the letters. The domains begin as the English alphabet. The constraints are the following:

No two letters can represent the same letter

No two letters can be represented by the same letter

All of the decrypted words must be English words

Punctuation and word length are invariant

This problem was well-suited to the Constraint Satisfaction Problem structure because, although the state space is large (26! elements) there are many constraints which can be used to effectively reduce it to a much more manageable and computationally feasible size.

Most other work in this area involves using hill-climbing search, genetic algorithms, and other local search techniques. However, these techniques have a number of drawbacks not present in our model. These include:

The state space has many local minima which can, and often do, trap local search algorithms

Local search techniques tend to only find one solution, whereas our algorithm returns all the possible solutions

These algorithms fail to take advantage of certain structural patterns inherent in the problem relating word patterns to possible solutions

In summary, our constraint satisfaction method proved to be an extremely effective method; it always returned the correct solution, it found solutions very rapidly, and it scaled surprisingly well to larger inputs.