Understanding and thinking Tianjin Metro project

 Understanding and thinking Tianjin Metro project

A project overview

  Subway as a public transport, it can greatly facilitate people have to travel, while alleviating road traffic pressure to some extent.

  Tianjin subway line as shown in FIG. Project to design a set of read, search, query as one of the program to facilitate passenger travel.

 

Two project requirements

2.1 Data Format subway

  Subway site name, line name and other specific information should be stored at subway.txt file, determine the data stored in the form of a document requiring the program can be easily read, user modifications.

2.2 line query capabilities

  User specified input line, the program may be output from the line start point to the end of all the sites.

2.3 shortest route calculation

  The user input starting point and destination, the program can calculate the shortest route and transfer information, and writes the result in routine.txt.

 

Three design ideas

3.1 Data Format subway

  Metro station names and lines can be simply a "line sites" is saved in txt file, for a line repeated several times to save the site. E.g:

Thrifty Road 1 
Honghuli 1 
West Station 1 
...... 
West Station 6 
North bamboo 6 
......

3.2 line query capabilities

   Program may be read line by line and stored as a junction site, for the same line name for the site on the same line, the same line names the domain name to be different from the transfer station.

3.3 shortest route calculation

  Program reads the stored information and subway.txt site and undirected graph, the shortest route weights may be weight minimum number of stations, may be assigned additional weights on line distance (edges), using the algorithm to solve Floyed two inter-site line program.

 

Four summary

  The essence of the program is to resolve without seeking to chart the shortest path between two points, back-end implementation is available on C, C ++ or java, you need to do a good front-end user interface to enhance the user experience.

Guess you like

Origin www.cnblogs.com/Dongtr/p/11545178.html