Tianjin subway travel route planning project needs analysis and analysis of design ideas

 

 Tianjin subway travel route planning project needs analysis and analysis of design ideas

 

Project Summary

The following is a general view of the subway line in Tianjin, the audience of the project by the software, access to Tianjin subway travel most convenient and fastest routes recommended.

 

 

 

demand analysis

  1. Assist in the realization of a subway travel route planning command-line program.
  2. Support changing subway lines, site changes, cancellations and additions, and the partial closure of the line.
  3. Line support queries of all sites.
  4. Ways to support queries to a minimum termination site of the site of the route.

Data storage structure analysis

Since a single line table and the Sites table can not represent such a complex subway line situations.

A plurality of sites, such as the precursor: and a plurality of subsequent sites such as: This case can not be processed by only two tables, it is introduced into the third side of the table

 

  • Line table with the Sites table is one to many relationship
  • Line table and side table is one to many relationship
  • Side table with the Sites table is many relationship

Main Algorithm Analysis

  • Because it is the least way to query the site lines, the distance between the station and the station can be seen as both 1, then such an action would be to ignore the physical distance between the station and the station, which processed only logical distance handle the entire subway lines, then the minimum requirements of the site becomes a way to find the shortest path between the two sites.
  • Tianjin subway lines and because much of the total number of points is sparse graphs, it is used on a sparse graph with excellent performance spfa algorithm.
  • Figure on construction, because of the existence side table, side table so only need to be built to map, and will not lead to loss of information, and there will be no redundant information. (With one side only once)
  • And because the side table, the change line becomes very easy, as long as the first changes to the site table, side table to modify.

Raw data input format

It can be used between each site, the site with the direct input line route each line in accordance with ':' No. separated, dried between the sites and the site ',' spaced apart, facilitating batch operation.

Such as:

One line: Liu Yuan, West Cross embankment .....

Second line: a small lake, high yield river .....

Guess you like

Origin www.cnblogs.com/Archer-Luo/p/11546387.html