ENH: Add "limit" parameter to dijkstra calculation

This is pretty straightforward. Tests pass, and I have also tried it with a real example with > 100,000 nodes. Results are identical (to numerical precision) with C code someone else wrote. Using a `limit` in my use-case speeds up computation by a factor of 20.