News for hackers. Stuff that matters.
Re:On Dijkstra's Algorithm by tristramg on Tuesday April 21, 2015 @07:21AM (#9413290)
Dijkstra’s algorithm is well known in computer science, but as other comments say it, Google uses a much more advanced algorithm. Furthermore the complexity O(n×log(n)) we know dates from the 80’s. Many years after Dijktra’s original article.

I wrote a year ago a small blog post where I tried to show the chronology: http://blog.tristramg.eu/short-history-of-routes-computation...

Re:On Dijkstra's Algorithm by bunderbunder on Tuesday April 21, 2015 @01:11PM (#9415482)
Paraphrasing an observation that was shared with me last week, "Dijkstra was an asshole. All his stuff runs in exponential time."
Re:On Dijkstra's Algorithm by farresito on Tuesday April 21, 2015 @08:04AM (#9413428)
Thank you for your article. Pretty interesting. Will finish reading it when I get home.
Re:On Dijkstra's Algorithm by jgrahamc on Tuesday April 21, 2015 @06:36AM (#9413149)
Before there was Dijkstra's Algorithm there was still need to solve these problems. Here's a talk I gave about computing shortest paths for British Rail in 1955.

https://www.youtube.com/watch?v=pcBJfkE5UwU

Re:On Dijkstra's Algorithm by sjtrny on Tuesday April 21, 2015 @06:43AM (#9413172)
You forgot the link.
Re:On Dijkstra's Algorithm by jgrahamc on Tuesday April 21, 2015 @06:48AM (#9413189)
Oops. Thanks.
Re:On Dijkstra's Algorithm by elwell on Tuesday April 21, 2015 @08:53AM (#9413660)
Link says talk was given in 2012 not 1955.
Re:On Dijkstra's Algorithm by IanCal on Tuesday April 21, 2015 @09:15AM (#9413765)
Assuming this is a serious comment, it's:

Here's a talk I gave (about computing shortest paths for British Rail in 1955).

Rather than

Here's a talk I gave (about computing shortest paths for British Rail) in 1955.

That is, the topic is computing shortest paths in 1955 for British Rail and the talk was given in 2012.

Re:On Dijkstra's Algorithm by zimpenfish on Tuesday April 21, 2015 @12:01PM (#9414955)
I have to admit it gave me momentary pause for "Wow, I didn't think jgrahamc was -that- old".
Re:On Dijkstra's Algorithm by jgrahamc on Tuesday April 21, 2015 @12:21PM (#9415116)
:-) True. 1955 < my_dob
Re:On Dijkstra's Algorithm by elwell on Tuesday April 21, 2015 @02:17PM (#9415901)
Ha, no I was just kidding.
Re:On Dijkstra's Algorithm by michaelt on Tuesday April 21, 2015 @06:21AM (#9413112)
Nowerdays, Google Maps is most likely using more modern algorithms, like 'contraction hierarchies' [1] - the algorithm inserts shortcuts into the graph in a structured way, so you only switch from a higher-numbered shortcut to a lower-numbered shortcut (or non-shortcut) at the very start or end of the route. This radically reduces the number of edges that need to be explored.

[1] https://www.youtube.com/watch?v=-0ErpE8tQbw

Re:On Dijkstra's Algorithm by lorenzhs on Tuesday April 21, 2015 @06:51AM (#9413199)
Calling Contraction Hierarchies 'a variation' of Dijstra's algorithm, as the article does, is a bit of an understatement though.

For anyone interested in route planning algorithms, there is a wide variety of interesting speed-up techniques. Some more key words: Arc Flags, Landmarks, Multi-Layer Dijkstra, Customizable Route Planning, Hub Labelling, Highway Hierarchies, PHAST. For transportation networks, also have a look at RAPTOR. A list of interesting references is available at http://i11www.iti.uni-karlsruhe.de/teaching/sommer2014/route... (the slides are in German, unfortunately)

Re:On Dijkstra's Algorithm by amelius on Tuesday April 21, 2015 @06:50AM (#9413196)
A hierarchical approach makes a lot of sense, intuitively. It makes me wonder why it took so long before such method was considered.
Re:On Dijkstra's Algorithm by lorenzhs on Tuesday April 21, 2015 @06:53AM (#9413206)
The area of route planning research got a large boost with the 9th DIMACS Implementation challenge in 2005/06, this is where most of the research into fast and exact route planning algorithms started. (What sat nav vendors did and are still doing usually isn't exact, they were using inexact heuristics that were based on the 'natural' hierarchy in the road network)
Re:On Dijkstra's Algorithm by crypt1d on Tuesday April 21, 2015 @07:08AM (#9413246)
FYI, one of the most popular routing protocols (used in internal networks) is OSPF[1], which is based on Dijkstra's algorithm.

[1] http://en.wikipedia.org/wiki/Open_Shortest_Path_First

Re:On Dijkstra's Algorithm by windexh8er on Tuesday April 21, 2015 @10:37AM (#9414289)
When I saw the headline of the article, and being a network engineer by trade, I thought for sure this article was on OSPF. Was intrigued to see Google Maps leveraging Dijkstra's algorithm. Makes you think about traffic a bit different - I wonder if Google has the concept of backbone, stub and transit "areas" within maps? Next time I use a mapping solution I'll definitely think about it much differently, very cool.

Does anyone know how costs are assigned in a mapping application that may use something like Dijkstra's? In the network world cost is derived by link speed and distance, being a general oversimplification, but I wonder how general areas are broken up into routing domains? By city or state?

Very interesting...

Re:On Dijkstra's Algorithm by varjag on Tuesday April 21, 2015 @11:13AM (#9414565)
A bunch of weighing schemes possible, including speed limit, distance, congestion and toll fees. The routing algorithms for electric vehicles seem to prioritize elevation (or rather lack of) as well, to preserve battery.
Re:On Dijkstra's Algorithm by nsxwolf on Tuesday April 21, 2015 @10:47AM (#9414374)
As a student, this was one of the first important algorithms I ever successfully implemented in C using only a formal description of it. This and A* just make me giddy inside. The results are just magical.
Re:On Dijkstra's Algorithm by eamsen on Tuesday April 21, 2015 @02:15PM (#9415890)
Nicely written article, but the writer failed to do any research on practical solutions for route planning.

"The result of such an explosion is that problems, like shortest path problems, grow so quickly as to become practically incomputable, taking a practically infinite amount of time to solve."

This is exactly the reason why neither Dijkstra nor a variant thereof is a feasible solution for real-world route planning (we would be talking about hours instead of ms per query). However, variants of Dijkstra are used in the pre-computational steps for the actual routing algorithms like Contraction Hierarchies or Transit Node Routing.

Re:On Dijkstra's Algorithm by kelukelugames on Tuesday April 21, 2015 @12:33PM (#9415206)
This is a very dumb question. I understand how to implement Dijkstra's Algorithm. But if I want to get from point A to point B then how do I find the exact path?

I have to do some processing after running the algorithm, right?

Re:On Dijkstra's Algorithm by teraflop on Tuesday April 21, 2015 @01:22PM (#9415548)
Dijkstra's has the property that it computes the cost from A to every node that is closer to A than B is. (For this reason, the distance ordering of vertices from a starting point is sometimes called their Dijkstra rank.) You can use this to backtrack and compute the actual path.

Let d(x,y) be the single-edge distance between two adjacent nodes, and S(A,y) be the computed shortest path. If S(A,C) + d(C,B) == S(A,B), then any shortest path from A-C is also part of a minimal path from A-B. Starting from B, you can check all its neighbors to find one that is a predecessor on a shortest path, and then just repeat that process until you get back to the starting point.

(If you look at other dynamic programming problems, like longest common subsequence, they often use similar tricks to reconstruct a solution after the initial computation is done.)

Re:On Dijkstra's Algorithm by lorenzhs on Wednesday April 22, 2015 @07:06AM (#9419558)
During relaxation (if you found a new, shorter path to a node), you don't just update the cost of getting there, but also save how you got there (i.e., from which node). Then it's just a matter of retracing the steps from B to A!
Re:On Dijkstra's Algorithm by csom on Tuesday April 21, 2015 @10:13AM (#9414117)
Route Planning in Transportation Networks http://arxiv.org/abs/1504.05140

Shortest-Path Queries in Static Networks http://www.sommer.jp/spq-survey.pdf

Re:On Dijkstra's Algorithm by waynecochran on Tuesday April 21, 2015 @11:35AM (#9414742)
I wonder how many computers are running a version of Dijkstra's Algorithm as I write this? 100,000? This very post will be processed by a Dijkstra's algorithm multiple times... a truly ubiquitous algorithm...
Re:On Dijkstra's Algorithm by lucasmullens on Tuesday April 21, 2015 @02:25PM (#9415953)
When would this post be used by Dijkstra's algorithm?