I learned some new tricks from your code :)
But i think that my way is better ;)
The main advantage of my solution over yours is the possibility of work with given words not included in the dictionary: e.g. the script can find find a path from 'phil' to 'kate'.
And the second advantage is speed — my script works only with data stored in memory, and your uses the hard disk very much. So, as i have measured, my transform function is about 3 times faster than your findpath.
Bug fixed :)
Thank you :)