2810ICT-Assignment-1

The goal of a ladder-gram is to transform a source word into the target word in the least number of steps. During each step, you must replace one letter in the previous word so that a new word is formed, but without changing the positions of the other letters. All words must exist in the supplied dictionary (dictionary.txt). For example, we can achieve the alchemist's dream of changing “lead” to “gold” in 3 steps (lead->load->goad->gold), or “hide” to “seek” in 6 steps (hide->side->site->sies->sees->seek). You have been supplied with a Python program (word_ladder.py) for this problem that was written by an obviously brilliant Python programmer who unfortunately did not believe in documentation nor that users would make any mistakes. Even worse, this code has been modified by a somewhat less talented programmer and it no longer works as efficiently as it used to.