Data Structure --- 01 bus lines hint system

Today started making bus lines hint system
Description: Before doing Shijiazhuang subway ticketing system because the algorithm knowledge of shortages and build errors table does not solve the shortest path problem; so this time chose a similar bus routes question, the determination must be done successfully .
Because this system done before a similar, probably clear;
So proceed directly to the core issue today: to find the shortest path;
I chose to use Dijkstra's shortest path algorithm derived optimal solution, Dijkstra algorithm (Dijkstra) is a typical shortest path routing algorithm for calculating the shortest path to a node to all other nodes. The main features of the layers is a starting point for the center outward expansion, up until the end of the extension.
 
We do today: to understand familiar with the Dijkstra algorithm;
Today difficulty:
file read node;
because reading is the adjacency matrix, so few cars to determine the number becomes a problem according to the path;
initial thoughts: Another write a document, save the site each line of the line; the last query determines the path No. few vehicles.

Guess you like

Origin www.cnblogs.com/sengzhao666/p/11121821.html