Tuesday, September 05, 2006

Geek alert. Flying back from the states, I came across a contest called "Crossing Capitals" in the back of Games Magazine. The object is to take the 50 US state capitals, plus all of the Canadian capitals, and fit as many as possible into a 19 by 19 grid, crossword puzzle style. This is a regular sort of contest they do, called a "stuffer" contest.

This sounded like a fun thing to write a program to solve, so I set to the task, and was soon generating some pretty good results. I started running it overnight at home, and pretty much constantly at work -- I'd estimate a good eight weeks of total computing time. I'm not sure how many million combinations were tried, but it was a lot. I also did a lot of fine tuning of the algorithm.

The deadline is now passed -- here are the results of the effort:





















MONTPELIER CONCORD
C A E
OLYMPIA HALIFAX S
L T E B M
U TRENTON I TORONTO
M P G I I
B PIERRE CHARLESTON
I Q K H T A E E
ALBANY A A L N S
L A R AUSTIN
COLUMBUS L N I B
H I G BOSTON I
E STPAUL T A G S S
Y A S T R T M
E N S T DENVER J A
N T A A T G DOVER
N A L PHOENIX H C
E F E W N N K
EDMONTON MADISON


That's thirty-four capitals. The tie breaker is the total count of letters used; my total is 243.

Unfortunately, I found a forum for people who do this sort of thing all the time, and it looks like at least three people managed to fit in 35 capitals. At least one did it by hand, too, without computer help! I would have thought that everyone in contention to win would have done it by program -- interesting that brains and computers are so evenly matched.

No comments: