Google's Search for Winner Ends

A piece of code that helps localize search results wins first prize in the popular search engine's programming contest. By Farhad Manjoo.

A 27-year-old New York computer scientist was named the winner of Google's first programming contest on Thursday for creating a location-based search tool that could allow Google users to restrict their search results to specific geographic regions.

Daniel Egnor won $10,000 in cash and a trip to Google's headquarters in Mountain View, California, where he'll have the chance to run his code on some of Google's systems. According to the contest's rules, Google can now use his code in its own systems, but company representative said they had no plans to implement the tool in the publicly available search engine.

If added to Google, Egnor's code would allow a searcher to ask for pages that match a keyword and are based in a particular location. The usual million-plus results that come up for the ever-popular search of "Britney Spears," for example, could be shortened to just a few hundred thousand if all one really needed were Britney pages based in Bangladesh.

But Egnor wrote in an e-mail that his program would be more practical as a kind of Google-powered Yellow Pages for the Web.

The idea was "something I've wanted for a long time," Egnor wrote. "I've been thinking about it for years, and this was finally an opportunity to see if it works."

The Yellow Pages work just fine for what they're designed for -- businesses that aren't unusual -- but it's "a closed system and the content is pretty limited; it's just a list of big stores categorized in one particular way," Egnor explained.

"I wanted the same geographical search ability -- find stuff that's near me -- but on the Web as a whole, so I could find not just big stores but smaller stores and parks and events that are going on and just whatever anyone wanted to make a Web page about. So if somebody out there wanted to make a Web page that listed all the coffeeshops that also offer 802.11b Internet access, I could search for that and get a map of the ones nearest me."

The program determines where a page is located by scanning it for street addresses. "It has a thing that can recognize a lot of different ways people format addresses in text, and it uses a database the U.S. Census Bureau puts out to turn those into geographical coordinates," Egnor wrote.

Jen McGrath, a software engineer at Google, said Egnor's entry was chosen not just because he had developed a useful application but also because he had "clean" code and, importantly, because his code showed the possibility of "scaling" to work across the entire Web.

Contestants were given a small piece of Google's database -- 900,000 pages culled from the dot-edu domain -- but their challenge, McGrath said, was to build applications that could work on much larger data sets. Google's search engine database has more than 1 billion pages in it; McGrath said that while Google's engineers didn't test Egnor's program using that huge index, they did test it on sets large enough to prove it scaled well.

Egnor, who received his computer science degree at the California Institute of Technology in 1996 and now works at an investment banking firm in New York, said that winning the contest "definitely seemed like a long shot."

"Google had some trouble getting it to work at first -- turns out there were bugs in the version of the Unix 'sort' command they had installed, of all things -- and when I stopped hearing from them I was sure they had given up on it and I was doomed. So I was pretty amazed to hear that I actually won. I guess they must have gotten it to work!"

And what's Egnor going to do with the money? "I hadn't really thought about that part," he said.

Five other entries received honorable mention status in Google's contest.

One of the more interesting of these is Zhenlei Cai's project, which scans through sets of pages and, after analyzing what words tended to occur often in a single document, determines sets of different phrases that might have similar meaning. ("Bay Area" and "San Francisco," for example.)