English

Wordle is NP-hard

Computational Complexity 2022-05-17 v2

Abstract

Wordle is a single-player word-guessing game where the goal is to discover a secret word ww that has been chosen from a dictionary DD. In order to discover ww, the player can make at most \ell guesses, which must also be words from DD, all words in DD having the same length kk. After each guess, the player is notified of the positions in which their guess matches the secret word, as well as letters in the guess that appear in the secret word in a different position. We study the game of Wordle from a complexity perspective, proving NP-hardness of its natural formalization: to decide given a dictionary DD and an integer \ell if the player can guarantee to discover the secret word within \ell guesses. Moreover, we prove that hardness holds even over instances where words have length k=5k = 5, and that even in this case it is NP-hard to approximate the minimum number of guesses required to guarantee discovering the secret word. We also present results regarding its parameterized complexity and offer some related open problems.

Cite

@article{arxiv.2203.16713,
  title  = {Wordle is NP-hard},
  author = {Daniel Lokshtanov and Bernardo Subercaseaux},
  journal= {arXiv preprint arXiv:2203.16713},
  year   = {2022}
}

Comments

Accepted at FUN2022

R2 v1 2026-06-24T10:32:43.322Z