How to calculate fares dynamically using the subway start and end points? Ideas
Doubt: 1.A Station to station B can have n transfer plan, how to determine the best route?
2.A Station to station B there are N transfer stations, how to determine the distance?
Reply content:
How to calculate fares dynamically using the subway start and end points? Ideas
Doubt: 1.A Station to station B can have n transfer plan, how to determine the best route?
2.A Station to station B there are N transfer stations, how to determine the distance?
Each station is a unique point, marking, the distance between every two points is the weight value. Use Digetsla algorithm what, multi-point path algorithm quite a lot of, you can Baidu Baidu.
First, three-dimensional problems are processed into two-dimensional mathematical problems, most of them have predecessors of the "wheel" can be used
Station is the point, the route is the edge, distance is the distance, together is a figure, billing generally directly take the shortest distance (ignoring the number of transfers) of the route, then is the basic shortest path problem, the algorithm a search has
If you want to give the result of a different strategy such as the shortest time/minimum transfer like the map app, think again.