All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General > Word Problems
Word Meld 7 (Posted on 2005-01-22) Difficulty: 4 of 5
Previous "Word Meld" puzzles consisted of a pair of words for which to find the shortest sequence of common words, each differing from the previous by only one letter, which began with one word of the pair and ended with the other.

For this problem, find the pair of words that has a shortest solution of maximum possible length.

  Submitted by David Shin    
Rating: 2.6667 (3 votes)
Solution: (Hide)
This problem is really a computer science problem in disguise, so this solution necessarily assumes some basic computer science knowledge. In particular, one must know what the breadth-first-search algorithm is. This algorithm is one that finds the set of all nodes reachable from some node x in a graph. It also outputs the shortest distance from x to those nodes. The implementation of it can easily be found by an Internet search.

Construct a graph where each node is a word and where an edge connects any two words that differ in exactly one letter position. Find the diameter of this graph by solving the all-pairs shortest-path problem. (This problem is to find the shortest path from s to t for all pairs (s,t) of nodes in a graph).

Solving the all-pairs shortest-path problem can be done as follows:

1. Pick a node n and perform a breadth-first search from it to find the distance of the node furthest from n.
2. Repeat for every node in the graph, and output the largest distance found.

A smart (and necessary) optimization is to first partition the set of words into equivalence classes, where word1 is equivalent to word2 if there exists a path from word1 to word2. This can be done by doing a breadth-first-search from a node to find the equivalence class containing that node, and then repeating on the remaining set of unclassified nodes until all nodes have been classified.

Then all-pairs shortest-path only need be run on each equivalence class.

When using the Scrabble dictionary (which only contains words of length 8 or less), the answer turns out to be the two words "effaces" and "cabaret":

[effaces, enfaces, enlaces, unlaces, unlades, unladed, unfaded, unfaked, uncaked, uncakes, uncases, uneases, ureases, creases, cresses, crosses, crosser, crasser, crasher, brasher, brasier, brakier, beakier, peakier, peckier, pickier, dickier, dickies, hickies, hackies, hackles, heckles, deckles, deciles, defiles, defiled, deviled, develed, reveled, raveled, ravened, havened, havered, wavered, watered, catered, capered, tapered, tabered, tabored, taboret, tabaret, cabaret]

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Puzzle Thoughts K Sengupta2023-03-27 23:13:30
4-letter exampleowl2005-01-26 04:13:04
re(2): 3-letters with a better list (spoiler)owl2005-01-25 21:22:49
Questionre: 3-letters with a better list (spoiler)Charlie2005-01-23 14:34:01
3-letters with a better list (spoiler)owl2005-01-23 04:58:13
re(2): 3-letter nomination (spoiler)owl2005-01-23 03:29:53
re: 3-letter nomination (spoiler)Charlie2005-01-23 01:43:44
Solution3-letter nomination (spoiler)owl2005-01-22 22:33:31
Solution3-letter nominations (Spoiler)owl2005-01-22 21:47:56
Some Thoughtsre(2): thoughtsJay Schamel2005-01-22 21:00:16
re: thoughtsowl2005-01-22 20:17:59
Some ThoughtsthoughtsCharlie2005-01-22 15:53:45
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (19)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information