Design and Analysis of Tianjin Metro Line project
Project needs analysis:
information stored file 1. Design subway lines, such as subway.txt
2. To achieve basic query operations (to achieve specified subway line through the site's query)
3. To achieve the shortest path calculation, you can query the shortest path departure station and destination station
Design ideas:
1. Using java programming language
2 subway line data format:
Line 1: Site 1 Site 2 ... Line 2: Site 1 Site 2 ... Line 3: Site 1 Site 2 ...
......
using subway.txt stores the output file format and other operations
3 Honghuli West Point Line 6 road rehabilitation
using routine.txt file format for storing the output operation, etc.
Analysis of the main functions to achieve:
1. The schematic diagram of the data structure used, site as a node, a line between the edges of adjacent sites considered.
2. Use breadth-first algorithm Dijkstra shortest path algorithm obtained.
3. When the query site does not exist, an error is thrown.