Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

OK, but how does it figure the shortest route?

figure Ok route shortest
0
Posted

OK, but how does it figure the shortest route?

0

A The applet reads a small data file from the web site that contains information about every subway station, and about the links between each station. Each link contains additional information about which line connects the two stations, what time the two stations are connected using this line, and a weight. The weight is used to account for longer runs between stations, such as those that cross under the East River. Special links are included in the data to represent transfers between stations. The CGI program that runs the Google Maps version is the same, except that the data file lives on the web server, and the CGI program reads it from there. When you select two subway stations, the applet uses a “priority-first search” algorithm. Starting at the first station, it builds a potential subway route to each station that has a link to that station. It puts that route in a “priority queue”. Once it’s done that for the current station, it removes the link with the smallest total weight fr

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123