This is an Objective-C implementation of the Dijkstra algorithm