The Travelling Salesman

Ontario has 413 uniquely named municipalities comprising 99.3% of its total population of 13,448,494 (2016). Suppose you wanted to visit each of them in your jet-powered helicopter starting from Toronto. What order of cities results in the shortest total path? This is variation on the classic travelling salesman problem (TSP) that has intrigued and bedevilled computational mathematicians for years. It is the rare mathematical challenge that is understandable by everyone and yet efforts to solve it have involved computer science, complexity theory, optimization theory and linear programming and influenced fields as diverse as logistics, genetics, manufacturing, telecommunications, astronomy, and neuroscience. [Read More]

Where Do Refugees Go?

Hint: It's Not North America

Imagine you’ve been forced from your home and country for fear for your life. Unbeknownst to you you are joining twenty million fellow travellers in a quest for safety. You quickly realize that you have three choices. Join a UNHCR sponsored refugee camp where you will be sheltered and fed but usually not allowed to work for fear of driving down domestic wages - living a life on hold. Live in urban areas without support and work illegally and potentially face exploitation. [Read More]

The Beauty of Strange Attractors

Dynamic systems are those where something changes over time according to a set of rules. They are found in many fields of study including, physics, chemistry, geology, biology and economics. Examples include, the planets orbiting around the sun, the vibration of an airplane wing, and the diffusion of drugs in your body. In mathematics, the something that changes over time can be points in a plane that change according to the rules of a function, which in a general form looks like this: [Read More]

Mapping Trees in Toronto

As cities go, Toronto is often ranked as one of the greener ones. The city has a database of trees that reside mostly on public land and consists of more than 560,000 trees and 246 species. I used Shiny and Leaflet-R to visualize the distribution of different species across the city. You can see it here. The drop down allows you to select tree species by common name or Latin name. [Read More]

Tree Taxonomy in Toronto

The city of Toronto has a large (> 567,000) database of the trees that live on public land. There are 246 types of trees and shrubs in Toronto, which is about one quarter of all the tree species in North America. However tropical forests win the diversity crown with tens of thousands of species. Usually when you start to look at a new dataset its a good idea to look at its overall structure. [Read More]

Leaflet Map

The Toronto Police make public the data for all the crimes committed in the city. Recently, the data for 2014 to 2017 became available. Since I wanted to learn about interactive maps in R, I thought it would be interesting to see a heat map of break and enter crimes across the city’s 140 neighbourhoods. Leaflet is a popular open-source JavaScript library for interactive maps. [Read More]

Climate Change at Home

In Al Gore’s latest movie, An Inconvenient Sequel: Truth to Power (2017), I was struck by the image of a plot of summer temperatures moving to the right as time progressed. I thought I’d see whether that shift held true for downtown Toronto. Environment Canada has Toronto temperature records going back to 1840. I chose to begin in 1848 so I could group the data into decades ending at the end of 2017. [Read More]

Is it Windy Outside?

Or, What's Up With The Great Lakes Image?

NOTE: The blog header image has been replaced by Clifford attractors. A static archived wind map can be seen here My earlier experience with Wordpress made me think there had to be a better way to do simple, reliable sites online. A blog is static, meaning everyone sees the same content. Yihui Xie from RStudio created what for my needs is a better way to host content - blogdown. The web is built with HTML, Javascript and css. [Read More]