Beijing subway station route planning

Project Description

  Design a planning process Beijing subway line

Development language

  java

demand analysis

  1. The user can see the route planning situation, they can choose their own route

  2. Enter the start and end users can query and transfer station at least minimal route

Implementation

  1. Site information is stored in two-dimensional array

  2. the Dijkstra shortest path algorithm

  3. The resulting shortest path is stored in a table

  4. Press the shortest path table stored in the feedback information to the user

  The recursive algorithm to obtain the least transfer lines

  6. Calculate the least transfer lines after the total number of sites, with a small total number of covering a large total number of feedback to the user

 

Test Examples

  Entry

Start: Site 1 
end: Site 2

  Export

The shortest route: 
Site 1 -> 1 stop -> ...-> Site 2 
Minimum Transfer: 
Station 1 -> 1 stop -> ...-> Site 2

 

Experimental summary

  In case the number of sites is not much better situation is to save up in advance the optimal solution, users can read the data directly when obtaining data instead of repeatedly computing

 

Guess you like

Origin www.cnblogs.com/wqf2019/p/11567528.html