# Sunday Times Teaser 2787 – Crime-Writers Convention

*by Graham Smithers*

#### Published: 21 February 2016 (link)

A group of twelve crime writers attended a convention. They were Bonfiglioli, Durrenmatt, Fyfield, Hiaasen, Highsmith, Hill, Innes, James, Knox, Le Carre, Rendell and Sayers, They sat in one long row on the stage, with Hiaasen further to the left than Hill. It turned out that, for any two sitting next to each other, there was just one letter of the alphabet that occurred (perhaps more than once) in both their surnames.

List the initial of each author from left to right along the row.

3 Comments
Leave one →

This is pretty easy puzzle to solve recursively. Here’s a Python 3 solution:

My solution is similar to a mix of Brian’s and Jim’s solutions.

I thought it would be useful to write a general purpose function to find Hamiltonian paths in a graph. There are some functions already available on the web that do this, but the one that is most readily found with a google search, http://www.ieor.berkeley.edu/~faridani/python.htm, isn’t particularly efficient, as it searches all pairs of possible start and end points.