In the article "Query algorithm" has implemented the transfer algorithm, but, using stored procedures InquiryT2 query from "Dong Pu" to "car road intersection" of the bus route, found that it took 5 minutes to find out the results, such efficiency is clearly not suitable for practical applications. Therefore, it is necessary to optimize and improve the original transfer algorithm. In this paper, we will give an improved transfer algorithm, compared with the original algorithm, the improved algorithm is more powerful and more efficient.
1. "Compression" RouteT0
Suppose RouteT0 has the following lines
As shown in the following figure, when the query S1 to S4 two transfer routes, will produce 3x2x4=24 results
As you can see from the diagram, the 3 lines in the 1th segment are the same starting point and site (2nd, 3), in fact, the transfer query is concerned about the two sites have wireless access, and do not care what route, so you can compress RouteT0 to: