AMC's "The Walking Dead;" video screenshot by Eric Mack/CNET

Farmhouses, fenced-in compounds, even the thick concrete of a penitentiary. Post-apocalyptic zombie fiction has taught us that these are good options for hiding out to protect your delicious brains from the undead, but eventually the zombies typically overrun the walls.

Fortunately, science has now provided a better long-term strategy for surviving the walking dead: Head for the hills. Specifically, you should probably get familiar now with the general location of Glacier National Park so that when it all goes down, you can start heading in that direction.

A team of researchers at Cornell University was inspired by the book "World War Z"by Max Brooks, as well as by a statistical-mechanics class, to model how an actual zombie outbreak might unfold. They will present their findings, meant to be an overview of modern epidemiology modeling, at a meeting of the American Physical Society on Thursday in San Antonio, Texas.

"Modeling zombies takes you through a lot of the techniques used to model real diseases, albeit in a fun context," Cornell graduate student Alex Alemi said in a release.

The model examined how an outbreak might spread in a population of about 300 million people.

"If there is a zombie outbreak, it is usually assumed (in works of fiction) to affect all areas at the same time, and some months after the outbreak you're left with small pockets of survivors," Alemi explained. "But in our attempt to model zombies somewhat realistically, it doesn't seem like this is how it would actually go down."

Now playing: Watch this: Scariest Zombies

Alemi believes cities would succumb to the zombie scourge quickly, but the infection rate would slow down significantly in more sparsely populated areas and could take months to reach places like the Northern Rockies and Glacier National Park.

But even if you don't have the means to make it to Montana or Idaho to hideout, just about any less densely populated area is preferable to the big city.

"Given the dynamics of the disease, once the zombies invade more sparsely populated areas, the whole outbreak slows down--there are fewer humans to bite, so you start creating zombies at a slower rate," Alemi said. "I'd love to see a fictional account where most of New York City falls in a day, but upstate New York has a month or so to prepare."

Of course, once you hit Montana and Idaho, you might as well keep heading farther north into the Canadian Rockies and all the way up to Alaska, where other data sets indicate you're most likely to survive the zombie apocalypse. Or, if you're just not the traveling type, you might be better off just hunkering down in your backyard in this zombie-proof cabin with a 10-year guarantee.

Where's your zombie safe house? Let us know in the comments below or tweet @crave using the hashtag #MyZombieHideout.