CSCI 311 -- Algorithms and Data Structures

Wordgame Project

60 Points Total

Posted Friday 22 November 2019
Part 2 due Tuesday 10 December 2019 (35 points)

Please work in pairs.
If that would be a problem for you, please contact your instructor.

In this assignment you are to write a Java program that implements a word game based on manipulating five-letter words. The idea behind the game is to transform a given word into another given word by repeatedly changing either one or two letters. Each transformation must result in a legal word (the set of legal words is specified in a dictionary file that is read in when the program is started). A solution is scored as follows: Each single-letter change has a cost of one point, and each two-letter change has a cost of five points. Following these rules, the word GOOFY can be transformed into the word YAHOO by the following steps:

GOOFY, GOOFS, HOOFS, HOOKS, HOCKS, HACKS, WACKS, WACKO, WAHOO, YAHOO

This sequence has a cost of 13 points ( 13 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 5 + 1 ).

You are to write a program that, given the dictionary file and two input words, finds a minimum-cost sequence that transforms the first input word to the second. This involves representing the dictionary as a weighted graph: Vertices in the graph represent words; edges represent legal moves in the game, with weights equal to the costs of the moves (1 or 5 points). The minimum-cost sequence is determined using a graph search algorithm.

You are to implement the project in two stages. In the first, you are to write a program that reads in the dictionary and constructs the graph of legal moves. In the second, you are to write the graph search algorithm and implement the game.

Part 1 (due Friday 11/22/2019):

Your program for Part 1 must do the following:

Part 2 (due Tuesday 12/10/2019):

Your program for Part 2 must do the following: