Strategies for Winning Wordle: Greedy vs. Clique-Based Algorithms
Explore two algorithms designed to improve Wordle guessing strategies.
― 6 min read
Table of Contents
Wordle is a popular word game where players try to guess a hidden 5-letter word within 6 attempts. The game became well-known in October 2021, and many people enjoy it. Players keep track of their performance and compete to see how quickly they can guess the word. To help improve guessing, researchers have developed methods to analyze and solve the game. This article discusses two main strategies: the Greedy Algorithm and the Clique-Based Algorithm.
Overview of Wordle
In Wordle, players guess a series of words to determine the correct hidden word. After each guess, players receive Feedback in the form of colors indicating how close they are to the correct answer. A green color means the letter is correct and in the right position, yellow indicates the letter is in the word but in the wrong position, and gray signifies that the letter is not in the word at all.
Problem Statement
To play effectively, a player needs to find the hidden word from a list of possible words. The vocabulary can range from 3 to 9 letters in length. The goal is to guess the hidden word with the least number of attempts possible.
Game Board
The board in Wordle displays the guesses made by the player and the corresponding feedback. Each guess reveals information that can help reduce the possible words left in the vocabulary. The game ends when the player guesses the correct word or runs out of attempts.
Player Moves
When playing, a player inputs their guess and receives feedback. Depending on whether they are playing the hard or easy mode, the rules for using previously guessed letters differ. In hard mode, correctly guessed letters must be used in the same position in later attempts. In easy mode, players can choose to ignore letters that have already been guessed.
Goals of the Algorithms
The two algorithms aim to minimize the number of guesses required to find the hidden word. They consider the current state of the game, including the words that have already been guessed and the feedback received.
Greedy Algorithm
The Greedy Algorithm is a straightforward approach to play Wordle. This algorithm reduces the list of possible words based on previous guesses. It tries to select a guess that will eliminate the most remaining words from the vocabulary.
How the Greedy Algorithm Works
Initial Setup: It starts by taking the full list of words that can be guessed and the hidden word that needs to be found.
Making a Guess: The algorithm will choose a word based on the strategy that minimizes the worst-case scenario of remaining words.
Feedback Processing: After a guess is made, the algorithm checks the feedback and prunes the vocabulary to remove words that cannot be the hidden word.
Repeat: This process continues until the hidden word is found or the list of possible words is reduced to one.
Claims of the Greedy Algorithm
- Each guess provides a pattern that narrows down the possibilities.
- The algorithm ensures that it will find the hidden word in a finite number of guesses.
- The size of the vocabulary decreases with each guess, leading to fewer remaining options.
Time Complexity of the Greedy Algorithm
The time complexity for the Greedy Algorithm is based on two parts: the time taken for each guess and the total number of guesses. The calculations take into consideration the size of the vocabulary and the length of the words in that vocabulary.
Clique-Based Algorithm
The Clique-Based Algorithm is more complex and focuses on finding groups of words that can provide valuable information on the hidden word. This method builds a graph to represent relationships between the words in the vocabulary.
How the Clique Algorithm Works
Word Graph Formation: It creates a graph where each word is a node, and edges connect words that have no letters in common.
Finding Cliques: A clique in the graph is a set of words that can be guessed together. The algorithm searches for these cliques to maximize the information gained with each guess.
Processing Cliques: After finding a clique, the algorithm attempts to guess the words in that group. The goal is to cover the highest number of unseen letters to narrow down the possibilities further.
Final Guessing: If not all letters of the hidden word are found, the algorithm continues to guess remaining words until it either identifies the hidden word or exhausts the options.
Claims of the Clique Algorithm
- The state of the game is accurately tracked after each guess.
- The algorithm relies on forming connections between words, ensuring that no extra edges are formed in the graph.
- It works to reduce the number of possibilities with each guess effectively.
Time Complexity of the Clique Algorithm
The complexity for the Clique Algorithm can escalate due to the need to find all possible combinations of words in the form of cliques. As the number of words grows, the time taken to find cliques can increase significantly, making it less efficient than the Greedy Algorithm.
Comparison of the Two Algorithms
Both algorithms were developed to improve the chances of guessing the hidden word in Wordle. However, they have different strengths and weaknesses.
Greedy Algorithm: Tends to be more efficient with a polynomial time complexity. It works well in both hard and easy modes, ensuring constraints are followed strictly in hard mode.
Clique-Based Algorithm: Provides a deeper analysis but has an exponential time complexity, making it less practical for larger vocabularies.
Experimental Results
Several experiments were conducted to evaluate the performance of both algorithms.
Greedy Algorithm Experiments
Best First Guess: The greedy algorithm consistently identifies the best first word to guess based on the vocabulary, leveraging common letters that maximize the chance of scoring well.
Average Number of Guesses: As the length of the word increases, the average number of guesses decreases, indicating longer words are easier to pinpoint.
Win Percentage: A win percentage chart indicated that higher attempts correlated with an increased win rate, showcasing the effectiveness of the algorithm across various attempts.
Worst Hidden Words: Identifying the most difficult to guess words provided insight into the challenges players might face.
Clique Algorithm Experiments
Time Analysis: The computations required for finding cliques increased significantly with longer words, reflecting the higher complexity of this method.
Vocabulary Size Impact: The size of the vocabulary heavily influenced the performance of the clique algorithm, especially in terms of time taken to form cliques and guess the hidden word.
Conclusion
The study of algorithms to solve Wordle illustrates how different approaches can yield various results. While the Greedy Algorithm proves to be efficient and straightforward, the Clique-Based Algorithm offers a complex structure that can provide deeper insights but at a cost of efficiency.
Future work may include optimizing these algorithms further or exploring new methods to improve word guessing strategies that can handle larger vocabularies or incorporate repeated letters. The insights gained from this analysis contribute to a better understanding of both human and algorithmic approaches to word games like Wordle.
Title: Deterministic Algorithmic Approaches to Solve Generalised Wordle
Abstract: Wordle is a single-player word-based game where the objective is to guess the 5-letter word in a maximum of 6 tries. The game was released to the public in October 2021 and has since gained popularity with people competing against each other to maintain daily streaks and guess the word in a minimum number of tries. There have been works using probabilistic and reinforcement learning based approaches to solve the game. Our work aims to formulate and analyze deterministic algorithms that can solve the game and minimize the number of turns required to guess the word and do so for any generalized setting of the game. As a simplifying assumption, for our analysis of all the algorithms we present, we assume that all letters will be unique in any word which is part of our vocabulary. We propose two algorithms to play Wordle - one a greedy based approach, and other based on Cliques. The Greedy approach is applicable for both hard and easy modes of Wordle, while the Clique formation based approach only works on the Easy mode. We present our analysis on both approaches one by one, next.
Authors: Aditya Lahiri, Naigam Shah, Shivaank Agarwal, Vignesh Nandakumar
Last Update: 2023-05-24 00:00:00
Language: English
Source URL: https://arxiv.org/abs/2305.14756
Source PDF: https://arxiv.org/pdf/2305.14756
Licence: https://creativecommons.org/licenses/by/4.0/
Changes: This summary was created with assistance from AI and may have inaccuracies. For accurate information, please refer to the original source documents linked here.
Thank you to arxiv for use of its open access interoperability.