How do I make a simple bus route search Engine?

后端 未结 3 2098
挽巷
挽巷 2020-12-30 16:29

[Not:e user is asking this again at Development of railway enquiry system, how to model Trains, Stations and Stops? ] My Problem Description:

Suppos

3条回答
  •  春和景丽
    2020-12-30 17:25

    I think the bus_numbers aren't important because you can look them up later. Maybe what you need is to create a 2d matrix with the bus_stops in a big matrix having them all and then use a graph traversing algorithm like dijkstra to find the shortest path from A to B. When you got that you can easily lookup the bus_numbers and show them to the client. Thus I think your database is already very good.

提交回复
热议问题