CSCI 311 -- Data Structures

Final Project Part 2

60 Points Total

Posted Monday 24 April
Part 2 due Monday 1 May (35 points)

In this assignment you are to write a Java or Python 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 single-source shortest paths 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 (was due Monday 04/24/2017):

Your program for Part 1 must do the following:

Part 2 (due Wednesday 05/01/2017):

Your program for Part 2 must do the following: