Dijkstra's algorithm

closes #8