From the favelas of Rio de Janeiro to the streets of London, maintaining law and order is a constant battle for authorities.
With cities rapidly expanding in size and population, police forces around the world are continually on the lookout for ways to fight and prevent crime.
But what – like Tom Cruise's PreCrime police force in "Minority Report" - if they could get to the scene of a crime before it even happened?
Professor Shane Johnson, of University College London's Department for Security and Crime Science, has been conducting research on "predictive crime-mapping" for more than 10 years. His work has been concerned with trying to understand patterns of where and when in a city crimes occur.
"In about 2000, we started using techniques from epidemiology to see whether the risk of burglary spreads like disease," Johnson told CNBC.
"And that's what we found: if a burglary occurs at one location, very swiftly others nearby are more likely."
As part of his research, Johnson also spoke with offenders about their methods, and how they pick areas to target and commit crimes.
"They go back to places with which they're familiar, but they don't stay too long because the risk is increased," he said.
"One of the theories we've developed to explain this is by drawing on the ecology literature and looking at offenders as 'foragers'. What an animal does is try to minimise the risk of its foraging activity, but maximise reward: if they find a location where there is good grazing to be had, they'll return. But they won't keep returning because, firstly, there is nothing left to graze on, and secondly, they're probably going to attract attention."
(Read more: Busted! Police Turn to Social Media to Fight Crime)
During interviews with offenders, Johnson was struck by the similarities he found. "It's quite amazing – they told us things which are really consistent with what I've just described," he said.
"They'd say things like, 'I'd go to this area for a couple of days but then I'd know the police were going to know, so I'd move on and do exactly the same thing elsewhere.'"
Using these interviews, as well as analysing crime data, Johnson and his colleagues developed algorithms to generate maps which predicted where crimes would occur. It may sound like the stuff of science fiction. Yet predictive crime mapping has had some practical successes.
In 2010, Matt Fielding, an Intelligence Analyst at Greater Manchester Police, read a report reviewing the research conducted by Johnson and his colleagues. Working with his supervisor, Fielding developed his own predictive software and rolled it out in Trafford, a borough of Greater Manchester.
"We deploy resources to high-risk areas based on the mapping of burglaries," he told CNBC.com. "Rather than just patrolling and having an officer say, 'I know that on a Tuesday it's busier over there', we deploy patrols based on the risk previous burglaries generate."
This tactic of targeted deployment based on mapping models has produced results.
"After the first year of running it, we saw a 26 per cent decrease in burglaries in Trafford," Fielding said. "Over two years we saw a 38 per cent decrease in burglaries. Since then we have seen a slight increase, for various reasons – with a reduction of staff we've seen our ability to patrol these areas diminishing. But overall, we've still seen a massive reduction in terms of where we were three years ago."
Predictive mapping is not restricted to Manchester. The Metropolitan Police – the UK's largest police force – is currently using its own model in twenty two of its thirty two boroughs, while the Los Angeles Policing Department is using PredPol, another crime prediction service.
"The old adage is that it's always cheaper to prevent crime than detect crime," Fielding added.
Follow us on Twitter: