Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

January 5, 2014

Turning Cats into Dogs in Hanoi

Filed under: Clojure,Graphs,Visualization — Patrick Durusau @ 12:06 pm

Fun with Clojure: Turning Cats into Dogs in Hanoi by Justin Kramer.

From the post:

I’ve been having fun brushing up on basic graph theory lately. It’s amazing how many problems can be modeled with it. To that end, I did a code kata the other day that lent itself to a graph-based solution:

. . . the challenge is to build a chain of words, starting with one particular word and ending with another. Successive entries in the chain must all be real words, and each can differ from the previous word by just one letter.

One way to approach this is to think of all valid words as nodes in a graph, where words that differ from each other by one letter are connected. To find a path between one word, say “cat”, and another, “dog”, traverse the graph breadth-first starting at the “cat” node until you find the “dog” node.

The post caught my attention because of the “turning cats into dogs” phrase. Sounds like a good idea to me. 😉

The graph library mentioned in the post is Loom, which is now found at: https://github.com/aysylu/loom. (Yes, it is the same Loom mentioned in: Loom and Graphs in Clojure.)

Great visualizations including solving the Tower of Hanoi puzzle.

Do you think a Hanoi Tower with eight (8) disks would be sufficient for testing candidates for public office? Should the test be timed or least number of moves?

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress