Three Canadian cities have placed in the top 10 of a global ranking by the Economist Intelligence Unit of the world's most livable cities, with Vienna dethroning perennial favourite Melbourne for the first spot.

Calgary placed fourth, Vancouver was sixth and Toronto ranked seventh.

Every year, the research and analysis arm of the London-based publisher of the Economist magazine ranks 140 cities and scores them based on 30 different factors, boiled down to five categories:

Stability (based on local rates of crime, terrorism and military unrest).

Quality of local health care.

Local culture and environment (everything from weather to quality of local restaurants).

Quality of education.

Quality of infrastructure (everything from transit to electrical grids and telecommunications networks).

Melbourne was first seven years in a row before being displaced by the Austrian capital.

Vienna was perfect in every category except culture and environment, where it scored 96.3 out of 100.

The Canadian cities in the top 10 break down this way:

Calgary was given perfect scores in most categories, except culture and environment, where it got a 90.

Vancouver scored a 95 in stability and a 92.9 in infrastructure, with a perfect score in the rest.

Toronto scored 89.3 in infrastructure, and 97.2 in culture and environment, earning a perfect score on the rest.

Perfect rankings don't imply those cities are perfect in those regards, just that they are superior compared to others in those categories.

Typically, mid-sized cities tend to do well on the rankings, while large global metropolises tend to be punished for their successes by having higher costs of living and weaker public infrastructure due to higher demand on them.

Other noted cities and their rankings include: