A method and system for solving the shortest path of subway network nodes
By constructing a fully directed subway network model and setting appropriate arc weights, the problem of path calculation errors caused by differences in road rights of transfer nodes in the existing technology is solved, and the accurate shortest path solution for OD trips in the subway network is achieved, ensuring that passengers Travel route accuracy and passenger flow management.
Patent Information
- Application Number
- CN202310167994.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-02-27
AI Technical Summary
The existing subway shortest path solution method cannot effectively reflect the difference between the right of way between transfer stations and other rights of way when calculating the OD trip, resulting in path calculation errors.
Construct a fully directed subway network model by setting the arc weight between transfer nodes to 1 and the arc weight between adjacent non-transfer nodes to 10, and use the Dijkstra or Floyd algorithm to calculate the theoretical shortest path of the OD trip, according to the correction rules Corrections are made to the start and end stations to obtain the actual shortest path.
It solves the problem of undirected or partially directed networks outputting wrong paths due to ignoring the right of way between transfer nodes, achieving an accurate reflection of the difference between the right of way of transfer nodes and other rights of way, ensuring the accuracy of passenger travel paths and passenger flow. precise allocation.
Smart Images

Figure CN116307317B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transportation networks, and in particular to a method and system for solving the shortest path of subway network nodes. Background Art
[0002] With the large-scale and rapid development of subways and the continuous increase in passenger flow, both transportation demand and passenger flow control have put forward new requirements for the fine management of subway operations. Among them, a more accurate and reasonable origin-destination (OD) shortest path solution method is conducive to promoting the fine management of subway operations.
[0003] The OD shortest path problem in the field of subway operations aims to find the shortest path between any OD pairs in the subway network and output the shortest path distance. The existing subway shortest path solution methods use undirected or partially directed networks, which use nodes and arcs to represent undirected stations and road sections respectively, where only one node is used to represent the transfer station. When using the subway network model to calculate the OD journey, the right of way is set according to the distance of the actual path, or the weight of each arc is set to 1, and the weight between transfer stations is set to 0. The core ideas of the existing Dijkstra algorithm and Floyd algorithm are explained in detail below.
[0004] The core idea of Dijkstra algorithm: The weight of each edge represents the distance between two vertices and is a non-negative real number. This algorithm can find the shortest path from a certain node to all other nodes. S is the set of endpoints starting from a certain point N, and the number of endpoints from point N to the remaining points N is i The possible distance is D(N i ), where the initial value of the unreachable node distance is set to ∞; in each iteration, select the node N with the shortest distance N in the previous iteration j , S=S∪{N j},D(N j )=Min{D(N i )|N i ∈NS}; Update the shortest distance from N to the nodes in VS.
[0005] The core idea of Floyd's algorithm: The weight of each edge represents the distance between two vertices. The algorithm uses the idea of dynamic programming to find the shortest path from any node to all other nodes. For a graph with n nodes, set an n-order initial distance matrix and set its diagonal elements to 0. If there is an edge N i N j , then the corresponding element of the square matrix is the weight, otherwise it is ∞. i and N j , try to insert an intermediate node N between the two points k, if from N i To N k Then to N j If it is shorter than the known path, update N i To N j Otherwise, keep the original value.
[0006] Whether using the Dijkstra algorithm or the Floyd algorithm to solve the shortest path of the subway network, there are the following limitations:
[0007] (1) When calculating OD trips using subway network models, the existing method for setting road rights is to calculate according to the actual length of the path, or to set the weight of each arc to 1 and the weight between transfer stations to 0. However, this weight setting method cannot reflect the difference between the road rights between transfer stations and other road rights. Although the transfer occurs within a station, it takes time for passengers and increases the walking distance. Therefore, the weight of the transfer arc cannot be ignored when calculating the OD route.
[0008] (2) The traditional subway network structure model is undirected or partially directed. If the transfer station is only regarded as a node, the wrong shortest path will be output. Figure 1 As shown in the figure, assuming that the passenger starts from O and goes to D, the correct path passes through A, B, and C in sequence. However, when the transfer station is only a node, that is, the ordinary right of way is 1 and the right of way between transfer stations is 0, the path O-A-B1-C-D will be output. Although the weight is also 4, this path is not the shortest path and is wrong. Figure 2 shown.
[0009] Therefore, there is an urgent need for a subway node shortest path calculation method that takes into account transfer trips and directed subway networks. Summary of the invention
[0010] To this end, an embodiment of the present invention provides a method and system for solving the shortest path of subway network nodes, which is used to solve the problem that the road right setting method in the prior art cannot reflect the difference between the road right between transfer stations and other road rights, and the undirected or partially directed network outputs an incorrect path due to ignoring the road right between transfer nodes.
[0011] In order to solve the above problem, an embodiment of the present invention provides a method for solving the shortest path of a subway network node, the method comprising:
[0012] S1: Obtain station data and section data of the subway network;
[0013] S2: Based on the station data and the road section data, a completely directed subway network model G(N,A) is constructed with stations as directed nodes and road sections as directed arcs; wherein N and A represent directed nodes and directed arcs, respectively;
[0014] S3: Initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A);
[0015] S4: Calculate the theoretical shortest path of the OD trip, and correct the OD trip according to the set correction rules; wherein the correction rules specifically include:
[0016] Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected;
[0017] Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station;
[0018] Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station;
[0019] S5: Calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
[0020] Preferably, in step S3, initializing the parameters of the subway network model G(N,A) specifically includes: inputting an adjacent node matrix and setting arc weights, wherein the arc weights include arc weights between transfer nodes and arc weights between adjacent non-transfer nodes.
[0021] Preferably, the weight of the arcs between the transfer nodes is smaller than the weight of the arcs between the adjacent non-transfer nodes.
[0022] Preferably, the weights of the arcs between the transfer nodes cannot be set to zero.
[0023] Preferably, the weight of the arcs between the transfer nodes is set to 1, and the weight of the arcs between the adjacent non-transfer nodes is set to 10.
[0024] Preferably, the Dijkstra algorithm or the Floyd algorithm is used to calculate the theoretical shortest path of the OD trip.
[0025] Preferably, the method further comprises the passenger planning a travel route according to the actual shortest path matrix of all OD trips finally obtained and the shortest path target value.
[0026] The embodiment of the present invention further provides a system for solving the shortest path of a subway network node, the system comprising:
[0027] Data collection module, used to obtain station data and section data of the subway network;
[0028] A directed subway network model construction module is used to construct a completely directed subway network model G(N,A) based on the station data and the road section data, with the stations as directed nodes and the road sections as directed arcs; wherein N and A represent directed nodes and directed arcs respectively;
[0029] An initialization module, used to initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A);
[0030] The shortest path correction module is used to calculate the theoretical shortest path of the OD trip and correct the OD trip according to the set correction rules; wherein the correction rules specifically include:
[0031] Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected;
[0032] Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station;
[0033] Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station;
[0034] The output module is used to calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
[0035] Preferably, the system further comprises a path planning module, which is used for passengers to plan travel paths according to the actual shortest path matrix of all OD trips finally obtained and the shortest path target value.
[0036] An embodiment of the present invention also provides a travel APP, including any one of the above-mentioned methods for solving the shortest path of subway network nodes.
[0037] It can be seen from the above technical solutions that the present invention has the following advantages:
[0038] The embodiment of the present invention provides a method and system for solving the shortest path of a subway network node. The present invention constructs a fully directed network model, adds road rights between transfer nodes, and corrects the calculated theoretical shortest path to obtain the actual shortest path, thereby solving the problem that an undirected or partially directed network outputs an erroneous path due to ignoring the road rights between transfer nodes; the present invention sets the weight of arcs between transfer nodes to 1, and sets the weight of arcs between adjacent non-transfer nodes to 10, and the result can clearly show the number of stops and the number of transfers of the passenger, thereby solving the problem that the existing road right setting method cannot reflect the difference between the road rights between transfer nodes and other road rights; the present invention can realize the accurate distribution of passenger flow, locate passengers to specific one-way stops, facilitate passengers' travel, and solve the problem that the existing network cannot accurately predict the situation when one-way failures occur. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0040] Figure 1 This is a schematic diagram of the correct result of the shortest path OD in the traditional subway network structure model;
[0041] Figure 2 It is a schematic diagram of the shortest path OD error result in the traditional subway network structure model;
[0042] Figure 3 It is a flowchart of a method for solving the shortest path of a subway network node provided in an embodiment;
[0043] Figure 4 It is a schematic diagram of the correct result of the shortest path OD in the fully directed subway network structure model;
[0044] Figure 5 It is a schematic diagram of the shortest path OD error result in the fully directed subway network structure model;
[0045] Figure 6It is a schematic diagram of a completely directed subway network;
[0046] Figure 7 This is a model diagram of Shenzhen Metro network;
[0047] Figure 8 This is a schematic diagram of the fully directed model of Shenzhen Metro Line 1;
[0048] Fig. 9 Schematic diagram of the shortest path distance matrix. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] like Figure 3 As shown, an embodiment of the present invention provides a method for solving the shortest path of a subway network node, the method comprising:
[0051] S1: Obtain station data and section data of the subway network;
[0052] S2: Based on the station data and the road section data, a completely directed subway network model G(N,A) is constructed with stations as directed nodes and road sections as directed arcs; wherein N and A represent directed nodes and directed arcs, respectively;
[0053] S3: Initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A);
[0054] S4: Calculate the theoretical shortest path of the OD trip, and correct the OD trip according to the set correction rules; wherein the correction rules specifically include:
[0055] Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected;
[0056] Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station;
[0057] Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station;
[0058] S5: Calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
[0059] The embodiment of the present invention proposes a method for solving the shortest path of a subway network node. According to the station data and section data of the existing subway network, a fully directed subway network model G(N,A) is constructed. By adding road rights between transfer nodes and correcting the calculated theoretical shortest path, an actual shortest path is obtained, thereby solving the problem that an undirected or partially directed network outputs an erroneous path due to ignoring the road rights between transfer nodes; by setting the weight of the arc between the transfer nodes to 1 and the weight of the arc between adjacent non-transfer nodes to 10, the number of stations and the number of transfers of the passenger can be clearly seen from the results, thereby solving the problem that the existing road right setting method cannot reflect the difference between the road rights between transfer nodes and other road rights; in addition, passengers can plan their travel paths according to the actual shortest path matrix of all OD trips and the shortest path target value finally obtained, so as to realize the accurate distribution of passenger flow while facilitating passenger travel.
[0060] The present invention first obtains the site data and the section data of the existing subway network; based on the site data and the section data, a completely directed subway network model G(N,A) is constructed with the sites as directed nodes and the sections as directed arcs; wherein N and A represent directed nodes and directed arcs, respectively.
[0061] Then the parameters of the fully directed subway network model G(N,A) are initialized: the adjacent node matrix is input and the arc weights are set, wherein the arc weights include the arc weights between transfer nodes and the arc weights between adjacent non-transfer nodes.
[0062] Furthermore, the present invention sets the weight of the arc between transfer nodes to 1, and the weight of the arc between adjacent non-transfer nodes to 10, which solves the problem that the existing road right setting method cannot reflect the difference between the road right between transfer nodes and other road rights. Figure 4 shown.
[0063] The road right setting method of the present invention is described in detail below:
[0064] 1. The weight of the arc between transfer nodes is less than the weight of the arc between adjacent non-transfer nodes. Transfer is from one station on one subway line to another station on another subway line. It should be noted that the arcs between transfer nodes are only proposed for calculating the OD path, and they are not included in the subway network model. Because the distance cost, time cost and fare cost of the transfer arc are generally less than the cost of other arcs, the weight of the arc between transfer nodes should be less than the weight of the arc between adjacent non-transfer nodes.
[0065] 2. The weight of the arcs between transfer nodes cannot be set to zero. Although the arcs between transfer nodes are in the same transfer station, they cannot be set to zero. On the one hand, transfers take time for passengers, and on the other hand, a zero value will lead to incorrect results for the shortest path, such as Figure 5 shown.
[0066] 3. The weight of the arc between transfer nodes is set to 1, and the weight of the arc between adjacent non-transfer nodes is set to 10. This effectively distinguishes transfer nodes from other nodes. Assuming that the maximum number of transfers in a transfer trip does not exceed 10, it is easy to get the number of transfer stations and the number of other stations passed in an OD trip. For example: y represents the shortest path distance of the output, then the number of transfers n t for The number of non-transfer stations in the route n nt for Specifically, the output shortest path distance is 73, the number of transfers is 3, and the number of non-transfer stations in the path is 7.
[0067] Furthermore, the Dijkstra algorithm or the Floyd algorithm is used to calculate the theoretical shortest path of the OD trip, and the starting station and the terminal station of the OD path are corrected through the correction rules, and the invalid path is eliminated to obtain the actual shortest path.
[0068] The amendment rules specifically include:
[0069] Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected;
[0070] Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station;
[0071] Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest ODt The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second to last node station is the actual terminal station.
[0072] In order to make the correction rules of the present invention clearer, further explanation is given below in combination with specific drawings and actual conditions.
[0073] like Figure 6 The above provides a completely directed network diagram, where the N ij 、N -ij and N of line i' i′j′ 、N -i′j′ Intersection. index represents a directed node, i and i' represent the line number, j and j' represent the station number, and the subscript symbol represents the running direction; A index Indicates a directed road segment. Its subscript has the same meaning as N index .
[0074] Example 1: For OD t Stroke N i(j-1) N -ij , the initial output theoretical shortest path is: N i(j-1) —N ij —N -ij However, due to N ij and N -ij They are both at the same transfer station, so N i(j-1) N -ij The corresponding actual travel should be: N i(j-1) N ij , the corrected shortest path is: N i(j-1) —N ij (According to Rule 3, due to OD t The line numbers of the penultimate node station and the penultimate node station in the path are different, so the penultimate node station is the actual terminal station.)
[0075] Example 2: For O t D Stroke N ij N -i′(j′+1) , the initial output theoretical shortest path is: N ij —N -i′j′ —N -i′(j′+1) The actual stroke should be: N -i′j′ N -i′(j′+1) , the corrected shortest path should be: N -i′j′ —N -i′(j′+1) . (According to Rule 2, since O tThe line numbers of the first node station and the second node station in the D path are different, so the second node station is the actual starting station. )
[0076] After the above correction, the actual shortest path matrix and the shortest path target value of all OD trips are obtained, and the passengers plan their travel routes based on the actual shortest path matrix and the shortest path target value of all OD trips finally obtained.
[0077] In order to further illustrate the technical solutions and advantages of the present invention, a description is given below in conjunction with specific embodiments.
[0078] The method of the present invention is applied to Shenzhen Metro. As of December 2013, Shenzhen Metro has 5 lines and 118 stations (including 13 transfer stations). A Shenzhen Metro network model diagram is established, such as Figure 7 shown.
[0079] 1. Setting the weight of road sections
[0080] like Figure 8 As shown in the figure, Line 1 is used as an example to illustrate the section weight setting of this method. The identification numbers and symbols in the node and arc subscripts in the figure represent their positions and running directions in the subway system respectively. The code of an arc is the same as its starting node, such as N 102 indicates the second station on Line 1, while A 102 Indicates the N on Line 1 going up 102 To N 103 The road section between -102 Indicates that Line 1 is down N -103 To N -102 In particular, a station located at a terminal (non-transfer station) is regarded as a node, such as N 101 , because the origin / destination station only provides train service in one direction.
[0081] The road section with a weight of 1: Baoan Center (N 124 )—>Baoan Center(N -504 ), Baoan Center(N 124 )—>Baoan Center(N 504 ), Baoan Center(N -124 )—>Baoan Center(N 504 ), Baoan Center(N -124 )—>Baoan Center(N -504 ), Baoan Center(N 504 )—>Baoan Center(N -124 ), Baoan Center(N 504 )—>Baoan Center(N 124 ), Baoan Center(N -504 )—>Baoan Center(N124 ), Baoan Center(N -504 )—>Baoan Center(N -124 ), Qianhaiwan(N 122 )—>Qianhaiwan(N 501 ), Qianhaiwan(N -122 )—>Qianhaiwan(N 501 ), Qianhaiwan(N 501 )—>Qianhaiwan(N 122 ), Qianhaiwan(N 501 )—>Qianhaiwan(N -122 ), Window of the World (N 115 )—>Window of the World(N 212 ), Window of the World (N 115 )—>Window of the World(N -212 ), Window of the World (N -115 )—>Window of the World(N 212 ), Window of the World (N -115 )—>Window of the World(N -212 ), Window of the World (N 212 )—>Window of the World(N 115 ), Window of the World (N 212 )—>Window of the World(N -115 ), Window of the World (N -212 )—>Window of the World(N 115 ), Window of the World (N -212 )—>Window of the World(N -115 ), Shopping Park (N 109 )—>Shopping Park(N 303 ), Shopping Park (N 109 )—>Shopping Park(N -303 ), Shopping Park (N -109 )—>Shopping Park(N 303 ), Shopping Park (N -109 )—>Shopping Park(N -303 ), Shopping Park (N 303 )—>Shopping Park(N 109 ), Shopping Park (N 303 )—>Shopping Park(N -109 ), Shopping Park (N -303 )—>Shopping Park(N 109 ), Shopping Park (N -303 )—>Shopping Park(N -109 )、Convention and Exhibition Center(N 108 )—>Convention and Exhibition Center(N 413 )、Convention and Exhibition Center(N 108 )—>Convention and Exhibition Center(N -413 )、Convention and Exhibition Center(N-108 )—>Convention and Exhibition Center(N 413 )、Convention and Exhibition Center(N -108 )—>Convention and Exhibition Center(N -413 )、Convention and Exhibition Center(N 413 )—>Convention and Exhibition Center(N 108 )、Convention and Exhibition Center(N 413 )—>Convention and Exhibition Center(N -108 )、Convention and Exhibition Center(N -413 )—>Convention and Exhibition Center(N 108 )、Convention and Exhibition Center(N -413 )—>Convention and Exhibition Center(N -108 ), Grand Theatre(N 104 )—>Grand Theater(N 226 ), Grand Theatre(N 104 )—>Grand Theater(N -226 ), Grand Theatre(N -104 )—>Grand Theater(N 226 ), Grand Theatre(N -104 )—>Grand Theater(N -226 ), Grand Theatre(N 226 )—>Grand Theater(N 104 ), Grand Theatre(N 226 )—>Grand Theater(N -104 ), Grand Theatre(N -226 )—>Grand Theater(N 104 ), Grand Theatre(N -226 )—>Grand Theater(N -104 ), Old Street(N 103 )—>Old Street(N 310 ), Old Street(N 103 )—>Old Street(N -310 ), Old Street(N -103 )—>Old Street(N 310 ), Old Street(N -103 )—>Old Street(N -310 ), Old Street(N 310 )—>Old Street(N 103 ), Old Street(N 310 )—>Old Street(N -103 ), Old Street(N -310 )—>Old Street(N 103 ), Old Street(N -310 )—>Old Street(N -103 )
[0082] The weight of the road segment is 10: the weight of other road segments is 10.
[0083] 2. Shortest Path Results
[0084] Fig. 9 The shortest path distance matrix from some stations on Line 2 to some stations on Line 1 solved by the shortest path solving method of the present invention.
[0085] Example of shortest path result
[0086] ①Wanxia(N 206 )—>Huaqiao East(N -113 )
[0087] Shortest path: N 206 -N 207 -N 208 -N 209 -N 210 -N 211 -N 212 -N -115 -N -114 -N -113
[0088] Shortest path distance: 81
[0089] Interpretation of the shortest path distance: The "1" in "81" means that the journey requires 1 transfer; "8" means that the journey passes through a total of 8 ordinary stations (Note: ordinary stations refer to stations other than transfer stations, the same below).
[0090] ② Lotus West 220 )—>Science Museum(N -105 )
[0091] Shortest path: Lianhua West (N 220 )-Fukuda(N 221 )-Civic Center(N 222 )-Civic Center(N 412 )-Convention and Exhibition Center(N 413 )-Convention and Exhibition Center(N -108 )-Gangxia(N -107 )-Huaqiang Road(N -106 )-Science Museum(N -105 )
[0092] Shortest path distance: 62
[0093] Interpretation of the shortest path distance: The "2" in "62" means that the journey requires 2 transfers; the "6" means that the journey passes through 6 ordinary stations in total.
[0094] The present invention provides a subway network node shortest path solving system, the system comprising:
[0095] Data collection module, used to obtain station data and section data of the subway network;
[0096] A directed subway network model construction module is used to construct a completely directed subway network model G(N,A) based on the station data and the road section data, with the stations as directed nodes and the road sections as directed arcs; wherein N and A represent directed nodes and directed arcs respectively;
[0097] An initialization module, used to initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A);
[0098] The shortest path correction module is used to calculate the theoretical shortest path of the OD trip and correct the OD trip according to the set correction rules; wherein the correction rules specifically include:
[0099] Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected;
[0100] Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station;
[0101] Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station;
[0102] The output module is used to calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
[0103] The system also includes a path planning module, which is used for passengers to plan travel paths according to the actual shortest path matrix of all OD trips finally obtained and the shortest path target value.
[0104] The system is used to implement the above-mentioned method for solving the shortest path of subway network nodes. In order to avoid redundancy, it will not be described here.
[0105] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0109] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims
1. A method for solving the shortest path of subway network nodes. It is characterized in that include: S1: Obtain station data and section data of the subway network; S2: Based on the station data and the road section data, a completely directed subway network model G(N,A) is constructed with stations as directed nodes and road sections as directed arcs; wherein N and A represent directed nodes and directed arcs, respectively; S3: Initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A); The initialization of the parameters of the subway network model G(N,A) specifically includes: inputting an adjacent node matrix and setting arc weights, wherein the arc weights include arc weights between transfer nodes and arc weights between adjacent non-transfer nodes; The weight of the arc between the transfer nodes is less than the weight of the arc between the adjacent non-transfer nodes; The weights of the arcs between the transfer nodes cannot be set to zero; S4: Calculate the theoretical shortest path of the OD trip, and correct the OD trip according to the set correction rules; wherein the correction rules specifically include: Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected; Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station; Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station; S5: Calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
2. The method for solving the shortest path of subway network nodes according to claim 1, It is characterized in that The weight of the arcs between the transfer nodes is set to 1, and the weight of the arcs between the adjacent non-transfer nodes is set to 10.
3. The method for solving the shortest path of subway network nodes according to claim 1, It is characterized in that In step S4, the Dijkstra algorithm or the Floyd algorithm is used to calculate the theoretical shortest path of the OD trip.
4. The method for solving the shortest path of subway network nodes according to claim 1, It is characterized in that The method also includes the passenger planning a travel route according to the actual shortest path matrix of all OD trips finally obtained and the shortest path target value.
5. A subway network node shortest path solution system, It is characterized in that The system is used to implement the method for solving the shortest path of a subway network node according to any one of claims 1 to 4, comprising: Data collection module, used to obtain station data and section data of the subway network; A directed subway network model construction module is used to construct a completely directed subway network model G(N,A) based on the station data and the road section data, with the stations as directed nodes and the road sections as directed arcs; wherein N and A represent directed nodes and directed arcs respectively; An initialization module, used to initialize the parameters of the subway network model G(N,A), and obtain all OD trips based on the subway network model G(N,A); The shortest path correction module is used to calculate the theoretical shortest path of the OD trip and correct the OD trip according to the set correction rules; wherein the correction rules specifically include: Rule 1: When neither the starting station nor the terminal station of the trip is a transfer node, then the starting station and the terminal station of the trip do not need to be corrected; Rule 2: When the starting point of the trip is a transfer node O t When comparing each shortest O t D is the line number of the first node station and the second node station in the path. If the line numbers are the same, the transfer node O t It is the actual starting station. If the line number is different, the second node station is the actual starting station; Rule 3: When the final stop of the trip is a transfer node D t When comparing each shortest OD t The line numbers of the penultimate node station and the penultimate node station in the path. If the line numbers are the same, the transfer node D t It is the actual terminal station. If the line number is different, the second-to-last node station is the actual terminal station; The output module is used to calculate and record the actual shortest path matrix and shortest path target value of all OD trips.
6. The subway network node shortest path solving system according to claim 5, It is characterized in that The system also includes a path planning module, which is used for passengers to plan travel paths according to the actual shortest path matrix of all OD trips finally obtained and the shortest path target value.
7. A travel app, It is characterized in that The method for solving the shortest path of a subway network node comprises the method described in any one of claims 1 to 4.
