CN114001747B - Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm - Google Patents
Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm Download PDFInfo
- Publication number
- CN114001747B CN114001747B CN202111368321.3A CN202111368321A CN114001747B CN 114001747 B CN114001747 B CN 114001747B CN 202111368321 A CN202111368321 A CN 202111368321A CN 114001747 B CN114001747 B CN 114001747B
- Authority
- CN
- China
- Prior art keywords
- intersection
- source point
- shortest path
- kth
- intersections
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/26—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
- G01C21/34—Route searching; Route guidance
- G01C21/3407—Route searching; Route guidance specially adapted for specific applications
- G01C21/3415—Dynamic re-routing, e.g. recalculating the route when the user deviates from calculated route or after detecting real-time traffic data or accidents
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/20—Instruments for performing navigational calculations
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/26—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
- G01C21/34—Route searching; Route guidance
- G01C21/3446—Details of route searching algorithms, e.g. Dijkstra, A*, arc-flags, using precalculated routes
Landscapes
- Engineering & Computer Science (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Automation & Control Theory (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Navigation (AREA)
Abstract
The invention discloses an urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm, which comprises the following steps: 1, acquiring a real-time urban road network diagram, and selecting a plurality of source point intersections; 2 if all the precursor intersections of an adjacent intersection of the intersection with the shortest path weight obtained by the previous iteration obtain the shortest path weight of the source point, updating the shortest path weight from the source point to the adjacent intersection, otherwise updating the upper bound of the shortest path weight of the adjacent intersection, and selecting the smallest updated shortest path weight; 3 backtracking the shortest path obtained in the iteration, and searching and updating the weight of the shortest path from other source points in the path to the intersection; and 4, ending the search and outputting when the shortest paths from all source points to all intersections in the intersection set are obtained, otherwise, continuing iteration. The method and the system can effectively improve the calculation efficiency of large-scale road network navigation planning and meet the travel demands of different travel points of multiple users at the same time.
Description
Technical Field
The invention belongs to the field of vehicle navigation path optimization, and particularly relates to an urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm.
Background
With the continuous expansion of the urban road network scale, road network nodes are correspondingly increased, and the existing shortest path navigation system firstly utilizes a single-source shortest algorithm or a full-source shortest algorithm to solve the travel demands of users, so that the calculation workload is huge, and the real-time and efficient requirements of people on navigation software are hardly met. The common full-source shortest algorithm is used in a large-scale urban road network, particularly when road network nodes are dense, the range involved in calculation is wide, time consumption and resource occupation are correspondingly increased, and the method for exchanging the quantity of resources for efficiency and quality is a common coping scheme.
In solving the shortest solution of the vehicle navigation core problem, different students design different algorithms, and the single-source shortest algorithm is adopted one by one for the application of the single-source shortest algorithm, so that some calculated weights can be repeatedly calculated, and a large amount of calculation redundancy is caused; the whole source shortest path algorithm (from all points to all points) is also unnecessary to carry out the single source point shortest path algorithm, so that the calculated amount is increased, and the concept of real-time navigation is not adapted.
Meanwhile, the path of the shortest path is single in the same algorithm at present, the traditional Dijistra algorithm is used for gradually obtaining the shortest path only by searching leaf nodes, and the efficiency is low. The improvement of the relevant scholars on the basis of the method is still based on the point, the efficiency improvement effect is poor, and the parallel realization is not facilitated.
Disclosure of Invention
The invention aims to solve the defects of the prior art, and provides an urban road network multisource shortest path acquisition method based on shared calculation and dijkstra algorithm, so that the problem of optimizing a vehicle-mounted navigation path can be solved by obtaining the weight of the shortest path in multiple ways, the calculation efficiency of large-scale road network navigation planning is effectively improved, and the travel demands of different travel points of multiple users at the same time are met.
In order to achieve the aim of the invention, the invention adopts the following technical scheme:
the invention discloses an urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm, which is characterized by comprising the following steps:
step 1: constructing an urban road network, defining parameters and initializing;
acquiring real-time road network data and obtaining an urban road network G= (V, A, W), wherein V represents an intersection set, and V= { V 1 ,v 2 ,v 3 ,…,v i ,…,v R },v i Represents the i-th intersection, i=1, 2,3, …, R is the total number of intersections in the urban road network G, a represents the set of road segments between intersections, and a= { (v) i ,v j )|i,j=1,2,3,…,R},(v i ,v j ) Represents the i-th intersection v i To the jth intersection v j Directed road segments in between, W represents the set of weights for road segments between intersections, w= { ω i,j |i,j=1,2,3,…,R},ω i,j Is a directed road section (v) i ,v j ) If the weight of the ith intersection v i To the jth intersection v j Between which there is a directed road section (v i ,v j ) Then the j-th intersection v j For the ith intersection v i An i-th intersection v i For the j-th intersection v j Precursor intersection of (a), and omega i,j Not less than 0; if the ith intersection v i To the jth intersection v j There is no directed road section (v) i ,v j ) Let omega i,j = + infinity; defining the current iteration number as t;
step 2: acquiring a source point intersection set:
selecting K source point intersections and forming a source point intersection set V '= { V' k I k=1, 2, …, K }, where v' k Representing the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V' k Sequence number s in intersection set V k I.e. Representing the s < th > in intersection set V k K is more than 1 and less than or equal to R at each intersection;
step 3: initializing the weights from the source point intersection to each intersection of the t-th iteration:
defining a kth source point intersection V ' from the source point intersection set V ' at the t-th iteration ' k To the ith intersection V in intersection set V i The upper bound of the weight of the shortest path of (a) isAnd initialize +.>Is +' infinity;
defining a kth source point intersection V 'from the set of source point intersections V' k To the ith intersection V in intersection set V i The shortest path of (a) is weighted as P k (v i ) And initialize P k (v i ) Is +' infinity;
initializing t=1;
initializing the kth source point intersection v 'under the t-th iteration' k To the s < th) k Each intersection v sk The upper bound of the weight of the shortest path of (a) isThen the kth source point intersection V ' in the source point intersection set V ' at the t-th iteration ' k To the s < th) k Each intersectionThe shortest path of (a) is given the weight +.>And will s k Crossing->Added to the previous t-1 iterations at the kth source point intersection v' k Intersection set with shortest path weight for source point +.>With the kth source point intersection v 'in the t-1 th iteration' k Intersection set with shortest path weight for source point +.>
Definition L k,i Representing the kth source point intersection V 'in the set of source point intersections V' k To the ith intersection V in intersection set V i Intersection set of shortest paths of (a) and initializing
Step 4: for the k source point intersection v 'in the t-1 iteration' k Intersection set that gets the shortest path weight for source pointForward searches are performed at all intersections in (a) and the shortest path weights are updated:
step 4.1: initializing k=1;
step 4.2: if the k-th source point intersection v 'is used in the previous t-1 iterations' k Intersection set that gets the shortest path weight for source pointAll intersections in the intersection set V are included, and the kth source point intersection V 'is used in the source point intersection set V' k Ending the shortest searching for the source point, and turning to the step 6, otherwise turning to the step 4.3;
step 4.3: initializing the kth iteration with the kth source point intersection v' k Intersection set that gets the shortest path weight for source point
Note that intersection v 'at kth source point in the t-1 th iteration' k Obtained as source pointsIntersection set of weights for shortest pathThe number of intersections in (a) is M t-1 The method comprises the steps of carrying out a first treatment on the surface of the Taking out the intersection with m < th > of the intersection>Let the mth intersection +.>Sequence number +.>I.e. < ->
Step 4.3.1: initializing m=1;
step 4.3.2: traversing the mth intersectionAll adjacent intersections of (2) and selecting from them all intersections not belonging to the intersection set +.>And add to the adjacency set +.>
Step 4.3.2.1: fetching contiguous setsThe q-th intersection of (a) is marked as the adjacency set +.>In (q) th intersection->Front of (2)The set of driving intersections is +.>Let adjacency set +.>In (q) th intersection->Number r in intersection set V q I.e. +.>
Step 4.3.2.2: initializing q=1;
step 4.3.2.3: traversing precursor intersection setsIf all intersections in (a) are set of precursor intersections +.>All intersections in (a) belong to the kth source point intersection v 'under the previous t-1 iterations' k Intersection set with shortest path weight for source point +.>Step 4.4 is carried out, otherwise step 4.5 is carried out;
step 4.4: acquiring v 'from the kth source point intersection' k To all precursor intersections are obtained as the kth source point intersection v' k The shortest weight of the intersection, which is the weight of the shortest path of the source point:
step 4.4.1: precursor intersection setThe number of intersections in the method is B, and the precursor intersection set is taken outB crossing of (a)>Let its serial number in intersection set V be n b I.e. +.>
Step 4.4.2: initializing b=1;
step 4.4.3: if it isWill->Assign to->And record the precursor intersection->Sequence number n of intersection set V b Assignment to the (r) th in intersection set V q Crossing->Number n of temporary precursor intersection b,min The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the kth source point intersection v' k To the nth of intersection set V b The right of shortest path of the intersection, < ->Represents the nth of intersection set V b Crossing->To the r q Crossing->Is used for the weight of the (c),represents the kth source point intersection v' k To the (r) th intersection set V q Crossing->The weight of the shortest path of (a);
step 4.4.4: assigning b+1 to B, proceeding to step 4.4.3 until b=b, thereby outputting the kth source point intersection v' k To the (r) th intersection set V q Each intersectionRight of shortest path->Sequence number n b,min And will be the r q Crossing->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the nth of intersection set V b,min Crossing->Intersection set of shortest path of +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the (r) th intersection set V q Crossing->Intersection set of shortest path of +.>I.e.Will be the r q Crossing->Added to the intersection v 'at the kth source point' k Obtaining the set of shortest weights for the source point +.>And the kth iteration with the kth source point intersection v' k Intersection set with shortest path weight for source point +.>I.e. < -> Turning to step 4.6;
step 4.6: if Q is not equal to Q, q+1 is assigned to Q, the step 4.3.2.3 is shifted, otherwise, m+1 is assigned to M, and M > M is judged t-1 If so, executing the step 4.7; otherwise, turning to step 4.3.2;
step 4.7: selecting an intersection with the smallest upper bound of the weight of the shortest path from the intersection set V at the t-th iterationAnd->Not belonging to the kth source point intersection v 'under the previous t iterations' k Intersection set with shortest path weight for source point +.>I.e. < ->If->Then the kth source point intersection v' k To the ith of intersection set V min Crossing->Upper bound of the weight of the shortest path of +.>Assigned to the kth source point intersection v' k To the ith of intersection set V min Crossing->Right of shortest path->And will be the ith min Crossing->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the intersection set V +.>Crossing->Is a shortest path intersection set +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the ith of intersection set V min Crossing->Is a shortest path intersection set +.>I.e. < ->And will be the ith min Each intersectionAdd to the collection->And intersection set->
Step 5: backtracking the kth source point intersection v 'under the tth iteration' k To intersection setThe shortest path of the intersection of (a):
step 5.1: note that the kth source point intersection v 'in the t-th iteration' k Intersection set that gets the shortest path weight for source pointThe number of intersections in (a) is M t Taking out the intersection with m < th > of the intersection>And will cross the mthMouth->Sequence number +.>I.e. < ->
Step 5.2: initializing m=1;
step 5.3: record the k-th source point intersection v' k Into intersection set VCrossing->Is>The number of the intermediate intersections in (a) is E m Marking the serial number rho of the epsilon-th intermediate intersection in the intersection set V ε ;
Step 5.3.1: initializing epsilon=1;
step 5.3.2: if it isThen assume->At the same time is the kth source point intersection V 'in the source point intersection set V' k′ I.e. +.>Then take the shortest path point set +.>In epsilon crossing->To E th m +2 intersections->All intersections as the kth 'source point intersection v' k′ To the intersection set V +.>Crossing->Is a shortest path intersection set +.>And will->Assign to->If k' > k, and will be +.>Crossing->Added to the previous t-1 iterations to k 'th source point intersection v' k′ Set of weights to get shortest path for source point +.>And the kth ' source point intersection v ' in the t-1 th iteration ' k′ Intersection set weighted for shortest path for source +.>Otherwise, go->Crossing->Add to the previous t iterations to kth 'source point intersection v' k′ Set of weights to get shortest path for source point +.>And the kth iteration with the kth 'source point intersection v' k′ Intersection set with shortest path weight for source point +.>
Step 5.3.3: judgment of ε=E m If so, turning to step 5.4, otherwise, assigning epsilon+1 to epsilon, and turning to step 5.3.2;
step 5.4: judging that m=m t If so, turning to the step 6, otherwise, assigning m+1 to m, and turning to the step 5.3;
step 6: judging whether k=k is satisfied, if so, turning to step 7, otherwise, assigning k+1 to K, and turning to step 4.2;
step 7: and if the shortest searching with all the source points as the source points in the source point intersection set V 'under the previous t iterations is finished, the shortest path from each source point intersection in the source point intersection set V' to any intersection in the intersection set V is obtained, otherwise, t+1 is assigned to t, and the step 4 is carried out.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention provides a partial source shortest path generation method between a single source shortest path algorithm and a full source shortest path algorithm, and provides an ingenious multi-source shortest path optimization method for solving the problem of complex calculation of a large-scale road network, wherein the shortest path weight of each source point can be calculated in a shared mode in the process of calculating the multi-source shortest path, and finally the shortest path weight is obtained in a multi-path mode through ideas such as shared calculation on the basis of dijkstra algorithm, so that the calculation efficiency is further improved, a large-scale road network diagram is processed more efficiently, resources are saved, the efficiency is ensured, the current situation of practical navigation application requirements is combined, unnecessary time loss is avoided, the calculation efficiency and the calculation quality are substantially improved, the calculation burden of navigation planning can be relieved, and the method is more practical.
2. In the existing full-source shortest path algorithm, the calculation efficiency is low when dealing with a complex large-scale map due to the intrinsic characteristics of the algorithm, and traversal search needs to be carried out on all intersection source points in the large-scale road network map, so that the efficiency is greatly reduced. The invention considers that only the source point expansion shortest path searching calculation with the user searching path requirement is selected, and omits the source point searching calculation without the user initiating the path searching, thereby carrying out a multi-source shortest path algorithm with higher efficiency under the condition of avoiding the parallel calculation of the full-source expansion path searching or the single-source shortest path algorithm, and providing a new solution for customizing the shortest path for a plurality of users at the same time for the navigation system.
3. Based on the theorem that the sub-path of a shortest path is always the shortest sub-path, when the shortest path from a source intersection to an intersection is obtained, the shortest paths from other source intersections possibly existing therein to the intersection can be traced back. The invention skillfully uses the point and records the weight of the shortest path traced back, avoids the independent calculation of each source point intersection, facilitates the utilization of the next iterative update and reduces the repeated calculation to cooperatively calculate, and forms a unique common calculation idea. This common computing idea complements the approach to obtain multi-source shortest paths, which reduces the computational effort as one of the new approaches to obtain the weights of the shortest paths.
4. The invention researches a directional traffic road network, namely, the road bidirectional traffic condition difference is considered in practical application, so that the road traffic road network is more accurately attached to practice. Meanwhile, the invention discovers that if all the precursor adjacent intersections of a certain intersection are searched for the shortest path taking the same source point intersection as a starting point, the weight of the shortest path from the source point intersection to the intersection can be directly calculated and obtained compared with the upper bound of the weight of the shortest path updated by continuing to perform dijkstra algorithm. With this, the present invention adds another approach to get the shortest path, which substantially increases the computational efficiency and quality. Meanwhile, the shortest path obtained by backtracking the common computing thought can be effectively utilized under certain conditions, so that the steps in the method can interact with each other, the work computing load is greatly reduced, and the shortest path searching of the large-scale road network graph is facilitated.
5. According to the method, under each iteration, after judging that the proper path for acquiring the shortest path is selected, the calculation of the two paths for acquiring the shortest path can be simultaneously carried out, and according to the characteristics, the method provides possibility for parallelization calculation under the multithreading condition, lays a foundation for fusion parallel multi-source search in the subsequent urban road network navigation planning work, is convenient to cooperate with graph dividing technology and parallel search, and further improves the speed for multi-user path planning.
Drawings
FIG. 1 is an overall flow chart of the present invention;
FIG. 2 is a flowchart of a multi-path acquisition shortest path in accordance with the present invention;
FIG. 3 is a schematic diagram of the main idea of the 4 th point (the right of the adjacent intersection can be directly calculated to obtain the shortest path) in the summary;
FIG. 4 is a simple city road network graph and weight table (with initial parameter values) of the present invention;
FIG. 5 shows the source point intersection v 'at iteration 3 of the present invention' 1 An upper bound table and a path diagram of the weight of the shortest path to each intersection;
FIG. 6 shows the source point intersection v 'at iteration 3 of the present invention' 2 An upper bound table and a path diagram of the weight of the shortest path to each intersection;
FIG. 7 is an upper bound table and path diagram of the weights of the shortest paths from each source point intersection to each intersection at iteration 6 of the present invention.
Detailed Description
In this embodiment, starting from the idea of solving a multi-source shortest path between a single source and a full source, an urban road network multi-source shortest path acquisition method based on a common calculation and dijkstra algorithm is provided, the specific flow steps are shown in fig. 1, the main idea framework is shown in fig. 2, and the main flows a, b, c, d in fig. 1 and 2 are in one-to-one correspondence, and the steps are as follows:
step 1: constructing an urban road network, defining parameters and initializing;
acquiring real-time road network data and obtaining an urban road network g= (V, a, W), taking the simple road network diagram in fig. 4 as an example, V represents an intersection set, and v= { V 1 ,v 2 ,v 3 ,…,v i ,…,v R },v i Represents the i-th intersection, i=1, 2,3, …, R is the total number of intersections in the urban road network G, a represents the set of road segments between intersections, and a= { (v) i ,v j )|i,j=1,2,3,…,R},(v i ,v j ) Represents the i-th intersection v i To the jth intersection v j Directed road segments in between, W represents the set of weights for road segments between intersections, w= { ω i,j |i,j=1,2,3,…,R},ω i,j Is a directed road section (v) i ,v j ) If the weight of the ith intersection v i To the jth intersection v j Between which there is a directed road section (v i ,v j ) Then the j-th intersection v j For the ith intersection v i An i-th intersection v i For the j-th intersection v j Precursor intersection of (a), and omega i,j Not less than 0; if the ith intersection v i To the jth intersection v j There is no directed road section (v) i ,v j ) Let omega i,j = + infinity; defining the current iteration number as t;
step 2: acquiring a source point intersection set:
selecting K source point intersections and forming a source point intersection set V '= { V' k I k=1, 2, …, K }, where v' k Representing the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V' k Sequence number s in intersection set V k I.e. Representing the s < th > in intersection set V k K is more than 1 and less than or equal to R, as shown by the V' set in the figure 4 and the intersections corresponding to the black italic fonts in the simple road network diagrams in the figures 4 to 7;
step 3: initializing the weights from the source point intersection to each intersection of the t-th iteration:
defining a kth source point intersection V ' from the source point intersection set V ' at the t-th iteration ' k To the ith intersection V in intersection set V i The upper bound of the weight of the shortest path of (a) isAnd initialize +.>Is +' infinity;
defining a kth source point intersection V 'from the set of source point intersections V' k To the ith intersection V in intersection set V i The shortest path of (a) is weighted as P k (v i ) And initialize P k (v i ) Is +' infinity;
initializing t=1;
initializing the kth source point intersection v 'under the t-th iteration' k To the s < th) k Each intersectionThe upper bound of the weight of the shortest path of (2) is +.>Then the kth source point intersection V ' in the source point intersection set V ' at the t-th iteration ' k To the s < th) k Each intersectionThe shortest path of (a) is given the weight +.>And will s k Crossing->Added to the previous t-1 iterations at the kth source point intersection v' k Intersection set with shortest path weight for source point +.>With the kth source point intersection v 'in the t-1 th iteration' k Intersection set with shortest path weight for source point +.>As S in FIG. 4 3 ,S 5 ,ΔS 3 ,ΔS 5 Shown;
definition L k,i Representing the kth source point intersection V 'in the set of source point intersections V' k To the ith intersection V in intersection set V i Intersection set of shortest paths of (a) and initializing
Step 4: for the k source point intersection v 'in the t-1 iteration' k Intersection set that gets the shortest path weight for source pointForward searches are performed at all intersections in (a) and the shortest path weights are updated:
step 4.1: initializing k=1;
step 4.2: if the k-th source point intersection v 'is used in the previous t-1 iterations' k Intersection set that gets the shortest path weight for source pointAll intersections in the intersection set V are included, and the kth source point intersection V 'is used in the source point intersection set V' k The shortest search for the source point is ended and goes to step 6, S as illustrated in FIG. 7 3 Stop pairs at source point intersection V =v' k Searching for the shortest path of the source point, otherwise, turning to step 4.3;
step 4.3: initializing the kth iteration with the kth source point intersection v' k Intersection set that gets the shortest path weight for source point
Note that intersection v 'at kth source point in the t-1 th iteration' k Intersection set that gets the shortest path weight for source pointThe number of intersections in (a) is M t-1 The method comprises the steps of carrying out a first treatment on the surface of the Taking out the intersection with m < th > of the intersection>Let mth intersection->Sequence number +.>I.e. < ->
Step 4.3.1: initializing m=1;
step 4.3.2: traversing the mth intersectionAll adjacent intersections of (2) and selecting from them all intersections not belonging to the intersection set +.>And add to the adjacency set +.>
Step 4.3.2.1: fetching contiguous setsThe q-th intersection of (a) is marked as the adjacency set +.>In (q) th intersection->The precursor intersection set of (1) is +.>Let adjacency set +.>In (q) th intersection->Number r in intersection set V q I.e. +.>
Step 4.3.2.2: initializing q=1;
step 4.3.2.3: traversing precursor intersection setsIf all intersections in (a) are set of precursor intersections +.>All intersections in (a) belong to the kth source point intersection v 'under the previous t-1 iterations' k Intersection set with shortest path weight for source point +.>Step 4.4 is entered, otherwise step 4.5 is entered, v as shown in fig. 5 1 Is adjacent to intersection v of 2 Precursor intersection v of (2) 1 ,v 5 All have obtained the shortest path, i.e.>And v 1 Another adjacent intersection v of (a) 6 Precursor intersection v of (2) 8 The shortest path is not obtained, so v 1 Go to step 4.4, v 6 Go to step 4.5.
Step 4.4: acquiring v 'from the kth source point intersection' k To all precursor intersections are obtained as the kth source point intersection v' k The shortest-path weight of the intersection, i.e. the flow a in fig. 2, is the shortest-path weight of the source point, and the overall ideas and steps are as shown in fig. 3:
step 4.4.1: precursor intersection setThe number of intersections in the method is B, and the precursor intersection set is taken outB crossing of (a)>Let its serial number in intersection set V be n b I.e. +.>
Step 4.4.2: initializing b=1;
step 4.4.3: if it isWill->Assign to->And record the precursor intersection->Sequence number n of intersection set V b Assignment to the (r) th in intersection set V q Crossing->Number n of temporary precursor intersection b,min The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the kth source point intersection v' k To the nth of intersection set V b The right of shortest path of the intersection, < ->Represents the nth of intersection set V b Crossing->To the r q Crossing->Is used for the weight of the (c),represents the kth source point intersection v' k To the (r) th intersection set V q Crossing->The weight of the shortest path of (a);
step 4.4.4: assigning b+1 to B, proceeding to step 4.4.3 until b=b, thereby outputting the kth source point intersection v' k To the (r) th intersection set V q Each intersectionRight of shortest path->Sequence number n b,min And is combined withWill be the r q Crossing->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the nth of intersection set V b,min Crossing->Intersection set of shortest path of +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the (r) th intersection set V q Crossing->Intersection set of shortest path of +.>I.e.Will be the r q Crossing->Added to the intersection v 'at the kth source point' k Obtaining the set of shortest weights for the source point +.>And the kth iteration with the kth source point intersection v' k Intersection set with shortest path weight for source point +.>Go to step 4.6, v in FIG. 5 1 Is adjacent to intersection v of 2 For example, calculate the intersection v from the source point 3 Go through v respectively 2 Precursor intersection v of (2) 1 、v 5 Arrive v 2 Is the shortest path of (a)And selecting the smallest shortest path weight update as v 3 To v 2 The shortest path weight, P 3 (v 2 )=min{P 3 (v 1 )+ω 1,2 ,P 3 (v 5 )+ω 5,2 } =15, and record that the precursor node is v at this time 5 I.e. lambda 3,2 =v 5 Will v 2 Added to L 3 (v 5 ) In (1) to obtain L 3 (v 2 )=L 3 (v 5 )∪{v 2 }={v 3 ,v 4 ,v 5 ,v 2 Simultaneously v 2 Adding to set S 3 And->In, S 3 =S 3 ∪{v 2 },/>
Step 4.5: if it isWill->Assign to->Otherwise go to step 4.6, v in FIG. 4 1 Is adjacent to intersection v 6 For example, P 3 (v 5 )+ω 5,6 =14<T 3 3 (v 6 ) Thus updating T 3 3 (v 6 )=P 3 (v 5 )+ω 5,6 =14, corresponding to scheme b in fig. 2;
step 4.6: if Q is not equal to Q, q+1 is assigned to Q, the step 4.3.2.3 is shifted, otherwise, m+1 is assigned to M, and M > M is judged t-1 If so, executing the step 4.7; otherwise, turning to step 4.3.2;
step 4.7: from the intersection at the t-th iterationThe intersection with the smallest upper bound of the weights of the shortest path in the set VAnd->Not belonging to the kth source point intersection v 'under the previous t iterations' k Intersection set with shortest path weight for source point +.>I.e. < ->If->Then the kth source point intersection v' k To the ith of intersection set V min Crossing->Upper bound of the weight of the shortest path of +.>Assigned to the kth source point intersection v' k To the ith of intersection set V min Crossing->Right of shortest path->And will be the ith min Crossing->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the intersection set V +.>Crossing->Is a shortest path intersection set +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the ith of intersection set V min Crossing->Is a shortest path intersection set +.>I.e. < ->And will be the ith min Each intersectionAdd to the collection->And intersection set->Corresponding to the flow diagram in FIG. 2, according to FIG. 4 with respect to the source point v 3 The upper bound of the shortest path weight to each intersection is selected not to belong to S 3 Intersection v corresponding to the minimum upper limit value of (2) 6 ,At the same time v 6 Adding to set S 3 And->In, S 3 =S 3 ∪{v 6 },/>Obtain v 3 To v 6 Is the shortest path L of (1) 3 (v 6 );
Step 5: backtracking the kth source point intersection v 'under the tth iteration' k To intersection setThe shortest path of the intersection in (a), namely the step idea as in the flow d in fig. 1:
step 5.1: note that the kth source point intersection v 'in the t-th iteration' k Intersection set that gets the shortest path weight for source pointThe number of intersections in (a) is M t Taking out the intersection with m < th > of the intersection>And the mth intersection +.>Sequence number +.>I.e. < ->
Step 5.2: initializing m=1;
step 5.3: record the k-th source point intersection v' k Into intersection set VCrossing->Is>The number of the intermediate intersections in (a) is E m Marking the serial number rho of the epsilon-th intermediate intersection in the intersection set V ε ;
Step 5.3.1: initializing epsilon=1;
step 5.3.2: if it isThen assume->At the same time is the kth source point intersection V 'in the source point intersection set V' k′ I.e. +.>Then take the shortest path point set +.>In epsilon crossing->To E th m +2 intersections->All intersections as the kth 'source point intersection v' k′ To the intersection set V +.>Crossing->Is a shortest path intersection set +.>And will->Assign to->If k' > k, and will be +.>Crossing->Added to the previous t-1 iterations to k 'th source point intersection v' k′ Set of weights to get shortest path for source point +.>And the kth ' source point intersection v ' in the t-1 th iteration ' k′ Intersection set weighted for shortest path for source +.>I.e. Otherwise, go->Crossing->Add to the previous t iterations to kth 'source point intersection v' k′ Set of weights to get shortest path for source point +.>And the kth iteration with the kth 'source point intersection v' k′ Intersection set with shortest path weight for source point +.>Order of the gameWith v in FIG. 5 2 For example, L 3 (v 2 )={v 3 ,v 4 ,v 5 ,v 2 The 2 nd intermediate intersection (excluding v) 3 And v 2 )v 5 Belongs to the source intersection set V' and +.>Then v will be taken 5 To v 2 All intersections between are added to L 5 (v 2 ) In (1) to obtain L 5 (v 2 )={v 5 ,v 2 },P 5 (v 2 )=P 3 (v 2 )-P 3 (v 5 ) At the same time v 2 Added to v 5 Is a set S of source points 5 And->In, S 5 =S 5 ∪{v 2 },/>I.e. as shown in fig. 6;
step 5.3.3: judgment of ε=E m If so, turning to step 5.4, otherwise, assigning epsilon+1 to epsilon, and turning to step 5.3.2;
step 5.4: judging that m=m t If so, turning to the step 6, otherwise, assigning m+1 to m, and turning to the step 5.3;
step 6: judging whether k=k is satisfied, if so, turning to step 7, otherwise, assigning k+1 to K, and turning to step 4.2;
step 7: if the shortest path searching with all source points as source points in the source point intersection set V 'under the previous t iterations is finished, the shortest path from each source point intersection in the source point intersection set V' to any intersection in the intersection set V is obtained, if the shortest path searching from all source point intersections to each intersection is completed under the 6 th iteration in fig. 7, the shortest path values (as in table 1) from all source point intersections to each intersection and the corresponding shortest paths (as in table 2) are output; otherwise, t+1 is assigned to t, and the process goes to step 4.
The shortest path values from each source point to each intersection point obtained in this embodiment are shown in table 1:
TABLE 1 shortest Path values from Source points to intersections of the invention
The shortest paths from each source point to each intersection point obtained in this embodiment are shown in table 2:
table 2 shortest path acquisition results of the present invention
L | v 1 | v 2 | v 3 | v 4 | v 5 | v 6 | v 7 | v 8 | v 9 |
v 3 | v 3 ,v 4 ,v 1 | v 3 ,v 4 ,v 5 ,v 2 | v 3 | v 3 ,v 4 | v 3 ,v 4 ,v 5 | v 3 ,v 4 ,v 5 ,v 6 | v 3 ,v 4 ,v 7 | v 3 ,v 4 ,v 7 ,v 8 | v 3 ,v 4 ,v5,v 6 ,v 9 |
v 5 | v 5 ,v 4 ,v 1 | v 5 ,v 2 | v 5 ,v 4 ,v 3 | v 5 ,v 4 | v 5 | v 5 ,v 6 | v 5 ,v 4 ,v 7 | v 5 ,v 6 ,v 9 ,v 8 | v 5 ,v 6 ,v 9 |
As can be seen from tables 1 and 2, at this time, all the intersections of the source point have been searched to obtain the shortest paths to all the intersections in the road network, and the calculation is finished, so that the efficiency is obviously improved.
Claims (1)
1. A city road network multisource shortest path acquisition method based on shared calculation and dijkstra algorithm is characterized by comprising the following steps:
step 1: constructing an urban road network, defining parameters and initializing;
acquiring real-time road network data and obtaining an urban road network G= (V, A, W), wherein V represents an intersection set, and V= { V 1 ,v 2 ,v 3 ,…,v i ,…,v R },v i Represents the i-th intersection, i=1, 2,3, …, R is the total number of intersections in the urban road network G, a represents the set of road segments between intersections, and a= { (v) i ,v j )|i,j=1,2,3,…,R},(v i ,v j ) Represents the i-th intersection v i To the jth intersection v j Directed road segments in between, W represents the set of weights for road segments between intersections, w= { ω i,j |i,j=1,2,3,…,R},ω i,j Is a directed road section (v) i ,v j ) If the weight of the ith intersection v i To the jth intersection v j Between which there is a directed road section (v i ,v j ) Then the j-th intersection v j For the ith intersection v i An i-th intersection v i For the j-th intersection v j Precursor intersection of (a), and omega i,j Not less than 0; if the ith intersection v i To the jth intersection v j There is no directed road section (v) i ,v j ) Let omega i,j = + infinity; defining the current iteration number as t;
step 2: acquiring a source point intersection set:
selecting K source point intersections and forming a source point intersection set V '= { V' k I k=1, 2, …, K }, where v' k Representing the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V' k Sequence number s in intersection set V k I.e. Representing the s < th > in intersection set V k K is more than 1 and less than or equal to R at each intersection;
step 3: initializing the weights from the source point intersection to each intersection of the t-th iteration:
defining a kth source point intersection V ' from the source point intersection set V ' at the t-th iteration ' k To the ith intersection V in intersection set V i The upper bound of the weight of the shortest path of (a) isAnd initialize +.>Is +' infinity;
defining a kth source point intersection V 'from the set of source point intersections V' k To the ith intersection V in intersection set V i The shortest path of (a) is weighted as P k (v i ) And initialize P k (v i ) Is +' infinity;
initializing t=1;
initializing the kth source point intersection v 'under the t-th iteration' k To the s < th) k Each intersectionThe upper bound of the weight of the shortest path of (a) isThen the kth source point intersection V ' in the source point intersection set V ' at the t-th iteration ' k To the s < th) k Crossing->Is the shortest of (a)The right of the diameter is->And will s k Crossing->Added to the previous t-1 iterations at the kth source point intersection v' k Intersection set with shortest path weight for source point +.>With the kth source point intersection v 'in the t-1 th iteration' k Intersection set with shortest path weight for source point +.>
Definition L k,i Representing the kth source point intersection V 'in the set of source point intersections V' k To the ith intersection V in intersection set V i Intersection set of shortest paths of (a) and initializing
Step 4: for the k source point intersection v 'in the t-1 iteration' k Intersection set that gets the shortest path weight for source pointForward searches are performed at all intersections in (a) and the shortest path weights are updated:
step 4.1: initializing k=1;
step 4.2: if the k-th source point intersection v 'is used in the previous t-1 iterations' k Intersection set that gets the shortest path weight for source pointAll intersections in intersection set V are included, then pair sourceWith the kth source point intersection V 'in the set of point intersections V' k Ending the shortest searching for the source point, and turning to the step 6, otherwise turning to the step 4.3;
step 4.3: initializing the kth iteration with the kth source point intersection v' k Intersection set that gets the shortest path weight for source point
Note that intersection v 'at kth source point in the t-1 th iteration' k Intersection set that gets the shortest path weight for source pointThe number of intersections in (a) is M t-1 The method comprises the steps of carrying out a first treatment on the surface of the Taking out the intersection with m < th > of the intersection>Let the mth intersection +.>Sequence number +.>I.e. < ->
Step 4.3.1: initializing m=1;
step 4.3.2: traversing the mth intersectionAll adjacent intersections of (2) and selecting from them all intersections not belonging to the intersection set +.>And add to the adjacency set +.>
Step 4.3.2.1: fetching contiguous setsThe q-th intersection of (a) is marked as the adjacency set +.>In (q) th intersection->The precursor intersection set of (1) is +.>Let adjacency set +.>In (q) th intersection->Number r in intersection set V q I.e. +.>
Step 4.3.2.2: initializing q=1;
step 4.3.2.3: traversing precursor intersection setsIf all intersections in (a) are precursor intersections setAll intersections in (a) belong to the kth source point intersection v 'under the previous t-1 iterations' k Intersection set with shortest path weight for source point +.>Step 4.4 is carried out, otherwise step 4.5 is carried out;
step 4.4: acquiring v 'from the kth source point intersection' k To all precursor intersections are obtained as the kth source point intersection v' k The shortest weight of the intersection, which is the weight of the shortest path of the source point:
step 4.4.1: precursor intersection setThe number of intersections in the method is B, and the precursor intersection set is taken outB crossing of (a)>Let its serial number in intersection set V be n b I.e. +.>
Step 4.4.2: initializing b=1;
step 4.4.3: if it isWill->Assign to->And record the precursor intersection->Sequence number n of intersection set V b Assignment to the (r) th in intersection set V q Crossing->Number n of temporary precursor intersection b,min The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the kth source point intersection v' k To the nth of intersection set V b The right of shortest path of the intersection, < ->Represents the nth of intersection set V b Crossing->To the r q Crossing->Weight of->Represents the kth source point intersection v' k To the (r) th intersection set V q Crossing->The weight of the shortest path of (a);
step 4.4.4: assigning b+1 to B, proceeding to step 4.4.3 until b=b, thereby outputting the kth source point intersection v' k To the (r) th intersection set V q Each intersectionRight of shortest path->Sequence number n b,min And will be the r q Each crossMouth->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the nth of intersection set V b,min Crossing->Intersection set of shortest path of +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the (r) th intersection set V q Crossing->Intersection set of shortest path of +.>I.e.Will be the r q Crossing->Added to the intersection v 'at the kth source point' k Obtaining the set of shortest weights for the source point +.>And the kth iteration with the kth source point intersection v' k Intersection set with shortest path weight for source point +.>I.e. < -> Turning to step 4.6;
step 4.6: if Q is not equal to Q, q+1 is assigned to Q, the step 4.3.2.3 is shifted, otherwise, m+1 is assigned to M, and M > M is judged t -1 If so, executing the step 4.7; otherwise, turning to step 4.3.2;
step 4.7: selecting an intersection with the smallest upper bound of the weight of the shortest path from the intersection set V at the t-th iterationAnd->Not belonging to the kth source point intersection v 'under the previous t iterations' k Intersection set with shortest path weight for source point +.>I.e. < ->If->Then the kth source point intersection v' k To the ith of intersection set V min Crossing->Upper bound of the weight of the shortest path of +.>Assigned to the kth source point intersection v' k To the ith of intersection set V min Crossing->Right of shortest path->And will be the ith min Crossing->Adding to the k-th source point intersection V 'in the source point intersection set V' k To the intersection set V +.>Crossing->Is a shortest path intersection set +.>Thereby obtaining the kth source point intersection V 'in the source point intersection set V' k To the ith of intersection set V min Crossing->Is a shortest path intersection set +.>I.e. < ->And will be the ith min Crossing->Add to the collection->And intersection set->
Step 5: backtracking the kth source point intersection v 'under the tth iteration' k To intersection setThe shortest path of the intersection of (a):
step 5.1: note that the kth source point intersection v 'in the t-th iteration' k Intersection set that gets the shortest path weight for source pointThe number of intersections in (a) is M t Taking out the intersection with m < th > of the intersection>And the mth intersection +.>Sequence number +.>I.e. < ->
Step 5.2: initializing m=1;
step 5.3: record the k-th source point intersection v' k Into intersection set VCrossing->Is set of shortest path pointsThe number of the intermediate intersections in (a) is E m Marking the serial number rho of the epsilon-th intermediate intersection in the intersection set V ε ;
Step 5.3.1: initializing epsilon=1;
step 5.3.2: if it isThen assume->At the same time is the kth source point intersection V 'in the source point intersection set V' k′ I.e. +.>Then take the shortest path point set +.>In epsilon crossing->To E th m +2 intersections->All intersections as the kth 'source point intersection v' k′ To the intersection set V +.>Crossing->Is a shortest path intersection set +.>And will->Assign to->If k' > k, and will be +.>Crossing->Added to the previous t-1 iterations to k 'th source point intersection v' k′ Set of weights to get shortest path for source point +.>And the kth ' source point intersection v ' in the t-1 th iteration ' k′ Intersection set weighted for shortest path for source +.>Otherwise, go->Crossing->Add to the previous t iterations to kth 'source point intersection v' k′ Obtaining the shortest for the source pointSet of weights for diameter->And the kth iteration with the kth 'source point intersection v' k′ Intersection set with shortest path weight for source point +.>
Step 5.3.3: judgment of ε=E m If so, turning to step 5.4, otherwise, assigning epsilon+1 to epsilon, and turning to step 5.3.2;
step 5.4: judging that m=m t If so, turning to the step 6, otherwise, assigning m+1 to m, and turning to the step 5.3;
step 6: judging whether k=k is satisfied, if so, turning to step 7, otherwise, assigning k+1 to K, and turning to step 4.2;
step 7: and if the shortest searching with all the source points as the source points in the source point intersection set V 'under the previous t iterations is finished, the shortest path from each source point intersection in the source point intersection set V' to any intersection in the intersection set V is obtained, otherwise, t+1 is assigned to t, and the step 4 is carried out.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111368321.3A CN114001747B (en) | 2021-11-18 | 2021-11-18 | Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111368321.3A CN114001747B (en) | 2021-11-18 | 2021-11-18 | Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114001747A CN114001747A (en) | 2022-02-01 |
CN114001747B true CN114001747B (en) | 2023-06-27 |
Family
ID=79929686
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111368321.3A Active CN114001747B (en) | 2021-11-18 | 2021-11-18 | Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114001747B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115394109B (en) * | 2022-08-30 | 2023-05-02 | 合肥工业大学 | K-pair single-source single-sink shortest searching method based on shared calculation and application |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017101277A1 (en) * | 2015-12-14 | 2017-06-22 | 华南理工大学 | City cognitive map generating method based on internet word frequency |
CN112435498A (en) * | 2020-11-23 | 2021-03-02 | 合肥工业大学 | Urban road network shortest path acquisition method based on directivity induction |
-
2021
- 2021-11-18 CN CN202111368321.3A patent/CN114001747B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017101277A1 (en) * | 2015-12-14 | 2017-06-22 | 华南理工大学 | City cognitive map generating method based on internet word frequency |
CN112435498A (en) * | 2020-11-23 | 2021-03-02 | 合肥工业大学 | Urban road network shortest path acquisition method based on directivity induction |
Non-Patent Citations (1)
Title |
---|
大数据环境下的动态最短路径算法;徐建闽;王钰;林培群;;华南理工大学学报(自然科学版)(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114001747A (en) | 2022-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108197739B (en) | Urban rail transit passenger flow prediction method | |
Liu et al. | Energy-efficient UAV crowdsensing with multiple charging stations by deep learning | |
CN106020230B (en) | A kind of multiple no-manned plane method for allocating tasks under power consumption constraint | |
CN108021686B (en) | Method for quickly matching bus routes and road networks in electronic map | |
Liang et al. | Applying genetic algorithm and ant colony optimization algorithm into marine investigation path planning model | |
CN104462190B (en) | A kind of online position predicting method excavated based on magnanimity space tracking | |
Kumar et al. | Federated control with hierarchical multi-agent deep reinforcement learning | |
CN113359849B (en) | Multi-unmanned aerial vehicle collaborative rapid search method for moving target | |
CN112013829A (en) | Multi-UAV/UGV (unmanned aerial vehicle/user generated Unit) cooperative long-term operation path planning method based on multi-objective optimization | |
CN112784968A (en) | Hybrid pipeline parallel method for accelerating distributed deep neural network training | |
CN110334838B (en) | AGV trolley cooperative scheduling method and system based on ant colony algorithm and genetic algorithm | |
CN113781817B (en) | Urban road network multisource shortest path obtaining method based on shared computation | |
CN114001747B (en) | Urban road network multi-source shortest path acquisition method based on shared calculation and dijkstra algorithm | |
CN114553661B (en) | Mobile user equipment clustering training method for wireless federal learning | |
CN110782178B (en) | Traffic network planning aid decision-making method and device | |
CN110440822B (en) | Automobile welding spot path planning method based on slime mold-ant colony fusion algorithm | |
CN113808424B (en) | Method for acquiring K shortest paths of urban road network based on bidirectional Dijkstra | |
CN102065019A (en) | IP (Internet Protocol) core fast mapping method for network on chip based on region division | |
CN106453096A (en) | Dynamic network community discovery method and apparatus | |
CN108225333A (en) | A kind of optimal path generation method for flight course planning | |
CN105447595A (en) | Scenic spot route recommending method based on spectral clustering algorithm | |
CN114969234A (en) | Vector characterization method for full-quantity city road network | |
Zhao et al. | An improved ant colony optimization algorithm for recommendation of micro-learning path | |
CN112229409B (en) | Unmanned aerial vehicle collaborative flight path planning method based on Bayes and evolutionary algorithm | |
CN114442664A (en) | Power transmission line unmanned aerial vehicle formation cooperative inspection task allocation method considering airspace conflicts |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |