Fix bug in Dijkstra predecessors calculation

Fixes #34.
Merge pull request #35 from agouge/34

Fix bug in Dijkstra predecessors calculation