CN114001747A - Urban road network multisource shortest path obtaining method based on common calculation and dijkstra algorithm - Google Patents
Urban road network multisource shortest path obtaining method based on common calculation and dijkstra algorithm Download PDFInfo
- Publication number
- CN114001747A CN114001747A CN202111368321.3A CN202111368321A CN114001747A CN 114001747 A CN114001747 A CN 114001747A CN 202111368321 A CN202111368321 A CN 202111368321A CN 114001747 A CN114001747 A CN 114001747A
- Authority
- CN
- China
- Prior art keywords
- intersection
- source point
- shortest path
- weight
- 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.)
- Granted
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 a method for acquiring a multisource shortest path of an urban road network based on common calculation and dijkstra algorithm, which comprises the following steps: 1, acquiring a real-time urban road network map, and selecting a plurality of source point intersections; 2 if all predecessor intersections of an adjacent intersection of the intersections which obtain the weight of the shortest path in the previous iteration obtain the weight of the shortest path of the source point, updating the weight of the shortest path from the source point to the adjacent intersection, or else updating the upper bound of the weight of the shortest path of the adjacent intersection, and selecting the minimum weight which is updated to the shortest path; 3 backtracking the shortest path obtained by the iteration, and searching and updating the weight of the shortest path from other source points in the path to the intersection; and 4, when the shortest paths from all the source points to all the intersections in the intersection set are obtained, ending the search and outputting, and otherwise, continuing the iteration. The method 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 a method for acquiring a multisource shortest path of an urban road network based on common calculation and dijkstra algorithm.
Background
With the continuous expansion of the scale of urban road networks and the corresponding increase of road network nodes, the existing shortest path navigation system firstly utilizes a single-source shortest path algorithm or a full-source shortest path algorithm to meet the travel requirements of users, the calculation workload is huge, and the real-time and efficient requirements of people on navigation software are difficult to meet. The common full-source shortest path algorithm is used in a large-scale urban road network, particularly when nodes of the road network are dense, the calculation range is wide, time consumption and resource occupation are correspondingly increased, and the method for exchanging the quantity of resources for the efficiency and the quality is a common coping scheme.
Different scholars design different algorithms in solving the shortest path of the vehicle navigation core problem, and the single-source shortest path algorithm is independently adopted one by one in application of the single-source shortest path algorithm, so that calculated weights can be repeatedly calculated, and a large amount of calculation redundancy is caused; the full-source shortest path algorithm (from all points to all points) performs unnecessary single-source point shortest path algorithm, and the calculated amount is increased, so that the method is not suitable for the concept of real-time navigation.
Meanwhile, the same algorithm is single in the path of obtaining the shortest path at present, and the traditional Dijisra algorithm only obtains the shortest path step by searching leaf nodes, so that 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 not good, and the parallel implementation is not facilitated.
Disclosure of Invention
The invention aims to solve the defects in the prior art, and provides an urban road network multisource shortest path acquisition method based on common calculation and dijkstra algorithm, so that the problem of vehicle-mounted navigation path optimization can be solved by obtaining the weight of the shortest path through multiple paths, the calculation efficiency of large-scale road network navigation planning is effectively improved, and the travel requirements of different travel points of multiple users at the same time are met.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention relates to a method for acquiring a multisource shortest path of an urban road network based on common calculation and dijkstra algorithm, which is characterized by comprising the following steps of:
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), V represents an intersection set, and V ═ V1,v2,v3,…,vi,…,vR},viDenotes the ith intersection, i is 1,2,3, …, R is the total number of intersections in the urban road network G, a denotes the set of links between intersections, and a is { (v)i,vj)|i,j=1,2,3,…,R},(vi,vj) Indicates the ith intersection viTo the jth intersection vjW represents a set of weights for links between intersections, W ═ ωi,j|i,j=1,2,3,…,R},ωi,jAs directed links (v)i,vj) If the ith intersection viTo the jth intersection vjThere is a directed road section (v) in betweeni,vj) Then the jth intersection vjIs the ith intersection viAdjacent intersection, i-th intersection viFor the jth intersection vjPrecursor of (2)At an intersection, and ωi,jNot less than 0; if the ith intersection viTo the jth intersection vjThere is no directed link (v) betweeni,vj) Then let ω bei,jInfinity, +,; defining the current iteration times as t;
step 2: acquiring a source point intersection set:
k source point intersections are selected and a source point intersection set V ' ═ V ' is formed 'k1,2, …, K, where v'kRepresenting the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V'kThe serial number in the intersection set V is skI.e. by Represents the s th in the intersection set VkAt each intersection, K is more than 1 and less than or equal to R;
and step 3: initializing the weights from the source point intersection to each intersection of the t iteration:
defining the kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kThe ith intersection V in the intersection set ViThe upper bound of the weight of the shortest path of (1) isAnd initializeIs + ∞;
defining the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViWeight of the shortest path of Pk(vi) And initializes Pk(vi) Is + ∞;
initializing t ═ 1;
initializing kth source point intersection v 'under the t iteration'kTo skV. of each intersectionskThe upper bound of the weight of the shortest path of (1) isThe kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kTo skIndividual intersectionHas the weight of the shortest path ofAnd will bekIndividual intersectionAdd to t-1 iterations before crossing v 'with the kth Source Point'kIntersection set for obtaining weight of shortest path for source pointAnd intersecting v 'with the k source point in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source point
Definition of Lk,iRepresenting the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViAnd initializing intersection sets of shortest paths
And 4, step 4: intersecting v 'with k source point in t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointAll intersections in (1) perform forward search and update the weight of the shortest path:
step 4.1: initializing k to 1;
step 4.2: if t-1 times beforeIntersection v 'with k-th source point under iteration'kIntersection set for obtaining weight of shortest path for source pointIf the intersection set V contains all the intersections in the intersection set V, the kth source point intersection V ' in the source point intersection set V ' is subjected to intersection treatment 'kEnding the shortest path search of the source point, and turning to the step 6, otherwise, turning to the step 4.3;
step 4.3: initializing intersection v 'with k source point in t iteration'kIntersection set for obtaining weight of shortest path for source point
Recording the k source point intersection v 'in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is Mt-1(ii) a Taking out the m-th intersection and marking asOrder the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 4.3.1: initializing m to 1;
step 4.3.2: traverse the m-th intersectionAnd selecting all the adjacent intersections from the intersection set which does not belong toAnd join into an adjacency set
Step 4.3.2.1: fetching contiguous collectionsAt the q-th intersection in (1), recording the adjacency setMiddle q intersectionThe set of the front driving intersections isMake the adjacent setMiddle q intersectionThe serial number in the intersection set V is rqI.e. by
Step 4.3.2.2: initializing q to be 1;
step 4.3.2.3: traversing precursor intersection setIf all the intersections in (1) are set in the front-driving intersectionAll intersections in (1) belong to the intersection v 'of the kth source point under the first t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointThen step 4.4 is carried out, otherwise step 4.5 is carried out;
step 4.4: acquiring v 'from k-th source point intersection'kObtaining a k source point intersection v 'from all the precursor intersections'kThe shortest path weight of the intersection which is the weight of the shortest path of the source point:
step 4.4.1: precursor-memory intersection setThe number of the intersections in the tree is B, and a precursor intersection set is taken outThe b-th intersection in (1)The serial number of the intersection in the intersection set V is nbI.e. by
Step 4.4.2: initializing b to be 1;
step 4.4.3: if it isThen will beIs assigned toAnd memory forerunner intersectionSequence number n of intersection set VbAssigning to the r-th in the intersection set VqIndividual intersectionNumber n of temporary predecessor intersectionb,min(ii) a Wherein the content of the first and second substances,represents the kth source point intersection v'kN-th in intersection set VbThe weight of the shortest path of each intersection,represents the n-th in the intersection set VbIndividual intersectionTo the r < th > rqIndividual intersectionThe weight of (a) is determined,represents the kth source point intersection v'kR-th in intersection set VqIndividual intersectionThe weight of the shortest path of (1);
step 4.4.4: b +1 is assigned to B, the step 4.4.3 is carried out until B is equal to B, and therefore the k source point intersection v 'is output'kR-th in intersection set VqIndividual intersectionWeight of shortest path ofAnd number nb,minAnd will r beqIndividual intersectionAdding the source point intersection V ' to the kth source point intersection V ' in the source point intersection set V 'kN-th in intersection set Vb,minIndividual intersectionIntersection set of shortest paths ofThereby obtaining the kth source point intersection V 'in the source point intersection set V'kR-th in intersection set VqIndividual intersectionIntersection set of shortest paths ofNamely, it isWill r toqIndividual intersectionTo k source point intersection v'kSet of weights to get the shortest path for a source pointAnd intersecting v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointNamely, it is Turning to step 4.6;
step 4.6: if Q is not equal to Q, assigning Q +1 to Q, and turning to step 4.3.2.3, otherwise, assigning M +1 to M, and judging that M is larger than Mt-1If yes, executing step 4.7; otherwise, turning to the step 4.3.2;
step 4.7: selecting an intersection with the minimum upper bound of the weight of the shortest path from the intersection set V under the t iterationAnd isDoes not belong to the intersection v 'with the k source point under the previous t iterations'kIntersection set for obtaining weight of shortest path for source pointNamely, it isIf it is notThen the kth source point is intersected by v'kThe ith in the intersection set VminIndividual intersectionUpper bound of weight of shortest path ofAssigning to k source point intersection v'kThe ith in the intersection set VminIndividual intersectionWeight of shortest path ofAnd will be the ithminIndividual intersectionAdding the source point intersection V ' to the kth source point intersection V ' in the source point intersection set V 'kThe first in the intersection set VIndividual intersectionShortest path intersection setThereby obtaining the kth source point intersection V 'in the source point intersection set V'kThe ith in the intersection set VminIndividual intersectionShortest path intersection setNamely, it isAnd will be the ithminIndividual intersectionJoin to a collectionIntersection set
And 5: backtracking kth source point intersection v 'under the tth iteration'kSet of intersectionsShortest path at intersection (iii):
step 5.1: recording the intersection v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is MtAnd taking out the m-th intersection asAnd the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 5.2: initializing m to 1;
step 5.3: recording k source point intersection v'kThe first in the intersection set VIndividual intersectionSet of shortest path points ofThe number of each intermediate crossing is EmAnd the serial number of the epsilon middle crossing in the crossing set V is recorded as rhoε;
Step 5.3.1: initializing epsilon to be 1;
step 5.3.2: if it is notThen assume thatSimultaneously, the source point intersection V ' at the k ' th source point intersection in the source point intersection set V 'k′I.e. byThen take the shortest path point setMiddle epsilon intersectionTo Em+2 crossingsAll intersections are used as k 'source point intersections v'k′The first in the intersection set VIndividual intersectionShortest path intersection setAnd will beIs assigned toIf k' > k, thenIndividual intersectionAdd to t-1 previous iterations to intersect v ' at the k ' th source point 'k′Set of weights to get shortest path for source pointAnd the kth ' source point intersection v ' in the t-1 iterations 'k′Intersection set for obtaining weight of shortest path for sourceOtherwise, it will beIndividual intersectionAdd to k ' th Source Point intersection v ' of the previous t iterations 'k′Set of weights to get shortest path for source pointAnd intersecting v ' with the k ' source point in the t iteration 'k′Intersection set for obtaining weight of shortest path for source point
Step 5.3.3: judging E ═ EmIf yes, turning to step 5.4, otherwise, assigning epsilon +1 to epsilon, and turning to step 5.3.2;
step 5.4: judging M as MtIf yes, turning to step 6, otherwise, assigning m +1 to m, and turning to step 5.3;
step 6: judging whether K is true or not, if so, turning to a step 7, otherwise, assigning K +1 to K, and turning to a step 4.2;
and 7: and if the shortest path search with all the source point intersections as source points in the source point intersection set V 'under the previous t iterations is finished, indicating that the shortest path from each source point intersection in the source point intersection set V' to any one intersection in the intersection set V is obtained, otherwise, assigning t +1 to t, and turning to the step 4.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention provides a method for generating partial source shortest paths between a single-source shortest path algorithm and a full-source shortest path algorithm, and provides that in the process of calculating the multisource shortest path, the shortest path weights of all source points can be calculated in a shared mode, and finally the weights of the shortest paths are obtained through ideas such as shared calculation and the like on the basis of a dijkstra algorithm, so that the calculation efficiency is further improved, a large-scale road network graph is processed more efficiently, the efficiency is guaranteed while resources are saved, the current situation of actual navigation application requirements is combined, unnecessary time loss is avoided, a smart multisource shortest path optimization method is provided for the problem of complexity in calculation of the large-scale road network, the calculation efficiency and the solution quality are substantially improved, the calculation burden of navigation planning can be relieved, and the actual application is more fit.
2. In the existing full-source shortest-path algorithm, due to the essential characteristics, the calculation efficiency is not high when a complex large-scale graph is handled, and traversal search needs to be performed on all intersection source points in the large-scale road network graph, so that the efficiency is greatly reduced. The invention considers that only the source point with the user search path requirement is selected to expand the shortest path search calculation, and the source point search calculation without the user initiated path search is omitted, thereby carrying out a multisource shortest path algorithm with higher efficiency under the condition of avoiding the parallel calculation of the full-source expanded path search or the single-source shortest path algorithm, and providing a new solution for the navigation system to simultaneously provide the customized shortest path for a plurality of users.
3. Based on the theorem that the sub-path of one shortest path is always the shortest sub-path, after the shortest path from a source intersection to a certain intersection is obtained, the shortest paths from other source intersections to the intersection which may exist in the shortest path can be traced back. The invention skillfully utilizes the point and records the weight of the shortest path of backtracking, avoids independent calculation of each source point intersection, facilitates the utilization of subsequent iterative update and reduces repeated calculation to carry out cooperative operation, and forms a unique common calculation idea. The common calculation idea complements with a method for acquiring the shortest path of multiple sources, and is used as one of new ways for acquiring the weight of the shortest path, so that the calculation workload is reduced.
4. The invention researches a directional traffic network, namely, the bidirectional traffic transportation condition difference of roads is considered in practical application, and the invention is more accurately fit with the reality. Meanwhile, the invention finds that if all the predecessor adjacent intersections of a certain intersection have searched for the shortest path with the intersection of the same source point as the 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 the dijkstra algorithm. With this, the present invention adds another way to get the shortest path, substantially improving computational efficiency and computational quality. Meanwhile, the shortest path obtained by backtracking of the common calculation idea can be effectively utilized under certain conditions, so that the steps in the invention can interact, the work calculation amount is greatly reduced, and the shortest path search of the large-scale road network graph is facilitated.
5. According to the invention, under each iteration, after the suitable path for obtaining the shortest path is judged and selected, the calculation of the two paths for obtaining the shortest path can be carried out simultaneously, and according to the characteristics, the invention provides possibility for parallel calculation under the condition of multithreading, lays a foundation for fusing parallel multi-source search in the subsequent urban road network navigation planning work, is convenient to be matched with a graph division technology and parallel search, and further speeds up the multi-user path planning.
Drawings
FIG. 1 is an overall flow chart of the present invention;
FIG. 2 is a flow chart of the present invention for obtaining shortest paths in multiple paths;
FIG. 3 is a schematic diagram of the main idea of point 4 (adjacent intersection can directly calculate the right to obtain the shortest path) in the summary of the invention;
FIG. 4 is a simple city road network graph and weight table (containing initial parameter values) of the present invention;
FIG. 5 shows source point intersection v 'at iteration 3 of the invention'1An upper bound table and a path graph of the weight of the shortest path to each intersection;
FIG. 6 shows source point intersection v 'at iteration 3 of the invention'2An upper bound table and a path graph of the weight of the shortest path to each intersection;
fig. 7 is an upper bound table and a path diagram of the weight from each source intersection to the shortest path of each intersection in the 6 th iteration of the present invention.
Detailed Description
In this embodiment, starting from an idea of solving a multisource shortest path between a single source and a full source, a method for obtaining a multisource shortest path of an urban road network based on common computation and dijkstra algorithm is provided, and specific process steps are shown in fig. 1, a main body thought framework is shown in fig. 2, and main processes a, b, c, and d in fig. 1 and fig. 2 correspond to one another and are performed according to the following steps:
step 1: constructing an urban road network, defining parameters and initializing;
the real-time road network data is acquired to obtain an urban road network G ═ (V, a, W), and in the following, taking the simple road network graph in fig. 4 as an example, V denotes an intersection set, and V ═ V1,v2,v3,…,vi,…,vR},viDenotes the ith intersection, i is 1,2,3, …, R is the total number of intersections in the urban road network G, a denotes the set of links between intersections, and a is { (v)i,vj)|i,j=1,2,3,…,R},(vi,vj) Indicates the ith intersection viTo the jth intersection vjW represents a set of weights for links between intersections, W ═ ωi,j|i,j=1,2,3,…,R},ωi,jAs directed links (v)i,vj) If the ith intersection viTo the jth intersection vjThere is a directed road section (v) in betweeni,vj) Then the jth intersection vjIs the ith intersection viAdjacent intersection, i-th intersection viFor the jth intersection vjAt a front-drive intersection of, and ωi,jNot less than 0; if the ith intersection viTo the jth intersection vjThere is no directed link (v) betweeni,vj) Then let ω bei,jInfinity, +,; defining the current iteration times as t;
step 2: acquiring a source point intersection set:
k source point intersections are selected and a source point intersection set V ' ═ V ' is formed 'k1,2, …, K, where v'kRepresenting the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V'kThe serial number in the intersection set V is skI.e. by Represents the s th in the intersection set VkK is more than 1 and less than or equal to R at each intersection, as shown by a V' set in the figure 4 and the intersections corresponding to black italic fonts in the simple road network diagram in the figures 4 to 7;
and step 3: initializing the weights from the source point intersection to each intersection of the t iteration:
defining the kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kThe ith intersection V in the intersection set ViThe upper bound of the weight of the shortest path of (1) isAnd initializeIs + ∞;
defining the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViWeight of the shortest path of Pk(vi) And initializes Pk(vi) Is + ∞;
initializing t ═ 1;
initializing kth source point intersection v 'under the t iteration'kTo skIndividual intersectionThe upper bound of the weight of the shortest path of (1) isThe kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kTo skIndividual intersectionHas the weight of the shortest path ofAnd will bekIndividual intersectionAdd to t-1 iterations before crossing v 'with the kth Source Point'kIntersection set for obtaining weight of shortest path for source pointAnd intersecting v 'with the k source point in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source pointSuch as S in fig. 43,S5,ΔS3,ΔS5Shown;
definition of Lk,iRepresenting the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViAnd initializing intersection sets of shortest paths
And 4, step 4: intersecting v 'with k source point in t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointAll intersections in (1) perform forward search and update the weight of the shortest path:
step 4.1: initializing k to 1;
step 4.2: if it is beforet-1 iterations through the k-th source point intersection v'kIntersection set for obtaining weight of shortest path for source pointIf the intersection set V contains all the intersections in the intersection set V, the kth source point intersection V ' in the source point intersection set V ' is subjected to intersection treatment 'kThe shortest search for the source point is ended and the process goes to step 6, which takes fig. 7 as an example, S3V ', stopping the source point intersection V'kSearching for the shortest path of the source point, otherwise, turning to the step 4.3;
step 4.3: initializing intersection v 'with k source point in t iteration'kIntersection set for obtaining weight of shortest path for source point
Recording the k source point intersection v 'in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is Mt-1(ii) a Taking out the m-th intersection and marking asOrder the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 4.3.1: initializing m to 1;
step 4.3.2: traverse the m-th intersectionAnd selecting all the adjacent intersections from the intersection set which does not belong toAnd join into an adjacency set
Step 4.3.2.1: fetching contiguous collectionsAt the q-th intersection in (1), recording the adjacency setMiddle q intersectionThe set of the front driving intersections isMake the adjacent setMiddle q intersectionThe serial number in the intersection set V is rqI.e. by
Step 4.3.2.2: initializing q to be 1;
step 4.3.2.3: traversing precursor intersection setIf all the intersections in (1) are set in the front-driving intersectionAll the intersections in (1) belong toCrossing v 'with the kth source point at the previous t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointGo to step 4.4 otherwise go to step 4.5 as shown in fig. 5, v1Adjacent intersection v of2Front-drive intersection v1,v5Have all obtained the shortest path, i.e.And v is1Is adjacent to the other intersection v6Front-drive intersection v8The shortest path is not obtained, so v1Go to step 4.4, v6And (5) transferring to the step 4.5.
Step 4.4: acquiring v 'from k-th source point intersection'kObtaining a k source point intersection v 'from all the precursor intersections'kThe shortest path weight of the intersection, which is the weight of the shortest path of the source point, i.e. flow a in fig. 2, the overall idea and steps are shown in fig. 3:
step 4.4.1: precursor-memory intersection setThe number of the intersections in the tree is B, and a precursor intersection set is taken outThe b-th intersection in (1)The serial number of the intersection in the intersection set V is nbI.e. by
Step 4.4.2: initializing b to be 1;
step 4.4.3: if it isThen will beIs assigned toAnd memory forerunner intersectionSequence number n of intersection set VbAssigning to the r-th in the intersection set VqIndividual intersectionNumber n of temporary predecessor intersectionb,min(ii) a Wherein the content of the first and second substances,represents the kth source point intersection v'kN-th in intersection set VbThe weight of the shortest path of each intersection,represents the n-th in the intersection set VbIndividual intersectionTo the r < th > rqIndividual intersectionThe weight of (a) is determined,represents the kth source point intersection v'kR-th in intersection set VqIndividual intersectionThe weight of the shortest path of (1);
step 4.4.4: b +1 is assigned to B, the step 4.4.3 is carried out until B is equal to B, and therefore the k source point intersection v 'is output'kR-th in intersection set VqIndividual intersectionWeight of shortest path ofAnd number nb,minAnd will r beqIndividual intersectionAdding the source point intersection V ' to the kth source point intersection V ' in the source point intersection set V 'kN-th in intersection set Vb,minIndividual intersectionIntersection set of shortest paths ofThereby obtaining the kth source point intersection V 'in the source point intersection set V'kR-th in intersection set VqIndividual intersectionIntersection set of shortest paths ofNamely, it isWill r toqIndividual intersectionTo k source point intersection v'kSet of weights to get the shortest path for a source pointAnd intersecting v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointGo to step 4.6, v in FIG. 51Adjacent intersection v of2For example, calculate intersection v from the origin3Starting respectively through v2Front-drive intersection v1、v5Reaches v2And the weight of the shortest path selected as the minimum is updated to v3To v2Weight of the shortest path of (1), P3(v2)=min{P3(v1)+ω1,2,P3(v5)+ω5,215 and record the predecessor node at this time as v5I.e. λ3,2=v5V is to be2Is added to L3(v5) In (b) to obtain L3(v2)=L3(v5)∪{v2}={v3,v4,v5,v2V, simultaneously2Join into set S3Andin, i.e. S3=S3∪{v2},
Step 4.5: if it is notThen will beIs assigned toOtherwise, go to step 4.6, using v in FIG. 41Is adjacent to the intersection v6For example, P3(v5)+ω5,6=14<T3 3(v6) Thus updating T3 3(v6)=P3(v5)+ω 5,614, i.e. corresponding to the scheme b in fig. 2;
step 4.6: if Q is not equal to Q, thenAssigning q +1 to q, and turning to step 4.3.2.3, otherwise, assigning M +1 to M, and judging that M is larger than Mt-1If yes, executing step 4.7; otherwise, turning to the step 4.3.2;
step 4.7: selecting an intersection with the minimum upper bound of the weight of the shortest path from the intersection set V under the t iterationAnd isDoes not belong to the intersection v 'with the k source point under the previous t iterations'kIntersection set for obtaining weight of shortest path for source pointNamely, it isIf it is notThen the kth source point is intersected by v'kThe ith in the intersection set VminIndividual intersectionUpper bound of weight of shortest path ofAssigning to k source point intersection v'kThe ith in the intersection set VminIndividual intersectionWeight of shortest path ofAnd will be the ithminIndividual intersectionIs added toK source point intersection V 'in source point intersection set V'kThe first in the intersection set VIndividual intersectionShortest path intersection setThereby obtaining the kth source point intersection V 'in the source point intersection set V'kThe ith in the intersection set VminIndividual intersectionShortest path intersection setNamely, it isAnd will be the ithminIndividual intersectionJoin to a collectionIntersection setCorresponding to the flow shown in FIG. 2, according to FIG. 4 with respect to the source point v3Selecting the upper bound of the shortest path right to each intersection, which does not belong to S3The intersection v corresponding to the minimum upper bound value6,At the same time v6Join into set S3Andin, i.e. S3=S3∪{v6},To obtain v3To v6Shortest path of (L)3(v6);
And 5: backtracking kth source point intersection v 'under the tth iteration'kSet of intersectionsThe shortest path at the intersection in (1), i.e. the step thought of the flow d in fig. 1:
step 5.1: recording the intersection v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is MtAnd taking out the m-th intersection asAnd the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 5.2: initializing m to 1;
step 5.3: recording k source point intersection v'kThe first in the intersection set VIndividual intersectionSet of shortest path pointsCombination of Chinese herbsThe number of each intermediate crossing is EmAnd the serial number of the epsilon middle crossing in the crossing set V is recorded as rhoε;
Step 5.3.1: initializing epsilon to be 1;
step 5.3.2: if it is notThen assume thatSimultaneously, the source point intersection V ' at the k ' th source point intersection in the source point intersection set V 'k′I.e. byThen take the shortest path point setMiddle epsilon intersectionTo Em+2 crossingsAll intersections are used as k 'source point intersections v'k′The first in the intersection set VIndividual intersectionShortest path intersection setAnd will beIs assigned toIf k' > k, thenIndividual intersectionAdd to t-1 previous iterations to intersect v ' at the k ' th source point 'k′Set of weights to get shortest path for source pointAnd the kth ' source point intersection v ' in the t-1 iterations 'k′Intersection set for obtaining weight of shortest path for sourceNamely, it is Otherwise, it will beIndividual intersectionAdd to k ' th Source Point intersection v ' of the previous t iterations 'k′Set of weights to get shortest path for source pointAnd intersecting v ' with the k ' source point in the t iteration 'k′Intersection set for obtaining weight of shortest path for source pointInstant gameV in FIG. 52For example, L3(v2)={v3,v4,v5,v2The 2 nd intermediate crossing (excluding v)3And v2)v5Belongs to a source point intersection set V', andthen v will be taken5To v2All intersections in between add to L5(v2) In (b) to obtain L5(v2)={v5,v2},P5(v2)=P3(v2)-P3(v5) At the same time v2Is added to5As a set S of source points5Andin, i.e. S5=S5∪{v2},As shown in fig. 6;
step 5.3.3: judging E ═ EmIf yes, turning to step 5.4, otherwise, assigning epsilon +1 to epsilon, and turning to step 5.3.2;
step 5.4: judging M as MtIf yes, turning to step 6, otherwise, assigning m +1 to m, and turning to step 5.3;
step 6: judging whether K is true or not, if so, turning to a step 7, otherwise, assigning K +1 to K, and turning to a step 4.2;
and 7: if the shortest path search with all source point intersections as source points in the source point intersection set V 'is finished under the previous t iterations, 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 search from all source point intersections to all intersections is finished under the 6 th iteration in FIG. 7, the shortest path values (such as table 1) from all source point intersections to all intersections and the corresponding shortest paths (such as table 2) are output; otherwise, assigning t +1 to t, and going to step 4.
The shortest path values from each source point to each intersection point obtained in this example are shown in table 1:
table 1 shortest path value from each source point to each intersection according to the present invention
The shortest path from each source point to each intersection point obtained in this embodiment is shown in table 2:
table 2 shortest path acquisition result of the present invention
L | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | v9 |
v3 | v3,v4, v1 | v3,v4, v5,v2 | v3 | v3,v4 | v3,v4,v5 | v3,v4, v5,v6 | v3,v4, v7 | v3,v4, v7,v8 | v3,v4,v5,v6,v9 |
v5 | v5,v4, v1 | v5,v2 | v5,v4, v3 | v5,v4 | v5 | v5,v6 | v5,v4, v7 | v5,v6, v9,v8 | v5,v6,v9 |
As can be seen from tables 1 and 2, at this time, the shortest path to each intersection in the road network has been searched for at each source intersection, and the efficiency is obviously improved after the calculation is finished.
Claims (1)
1. A method for obtaining multisource shortest paths of an urban road network based on common 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), V represents an intersection set, and V ═ V1,v2,v3,…,vi,…,vR},viDenotes the ith intersection, i is 1,2,3, …, R is the total number of intersections in the urban road network G, a denotes the set of links between intersections, and a is { (v)i,vj)|i,j=1,2,3,…,R},(vi,vj) Indicates the ith intersection viTo the jth intersection vjW represents a set of weights for links between intersections, W ═ ωi,j|i,j=1,2,3,…,R},ωi,jAs directed links (v)i,vj) If the ith intersection viTo the jth intersection vjThere is a directed road section (v) in betweeni,vj) Then the jth intersection vjIs the ith intersection viAdjacent intersection, i-th intersection viFor the jth intersection vjAt a front-drive intersection of, and ωi,jNot less than 0; if the ith intersection viTo the jth intersection vjThere is no directed link (v) betweeni,vj) Then let ω bei,jInfinity, +,; defining the current iteration times as t;
step 2: acquiring a source point intersection set:
k source point intersections are selected and a source point intersection set V ' ═ V ' is formed 'k1,2, …, K, where v'kRepresenting the kth source point intersection in the source point intersection set V ', and enabling the kth source point intersection V'kThe serial number in the intersection set V is skI.e. by Represents the s th in the intersection set VkAt each intersection, K is more than 1 and less than or equal to R;
and step 3: initializing the weights from the source point intersection to each intersection of the t iteration:
defining the kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kThe ith intersection V in the intersection set ViThe upper bound of the weight of the shortest path of (1) isAnd initializeIs + ∞;
defining the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViWeight of the shortest path of Pk(vi) And initializes Pk(vi) Is + ∞;
initializing t ═ 1;
initializing kth source point intersection v 'under the t iteration'kTo skIndividual intersectionThe upper bound of the weight of the shortest path of (1) isThe kth source point intersection V ' in the source point intersection set V ' at the t iteration 'kTo skIndividual intersectionHas the weight of the shortest path ofAnd will bekIndividual intersectionAdd to t-1 iterations before crossing v 'with the kth Source Point'kIntersection set for obtaining weight of shortest path for source pointAnd intersecting v 'with the k source point in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source point
Definition of Lk,iRepresenting the kth source point intersection V 'in the source point intersection set V'kThe ith intersection V in the intersection set ViAnd initializing intersection sets of shortest paths
And 4, step 4: intersecting v 'with k source point in t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointAll intersections in (1) perform forward search and update the weight of the shortest path:
step 4.1: initializing k to 1;
step 4.2: crossing v 'with the kth source point if t-1 iterations ahead'kIntersection set for obtaining weight of shortest path for source pointIn the intersection set VFor all the intersections in the source point intersection set V ', the kth source point intersection V ' is used 'kEnding the shortest path search of the source point, and turning to the step 6, otherwise, turning to the step 4.3;
step 4.3: initializing intersection v 'with k source point in t iteration'kIntersection set for obtaining weight of shortest path for source point
Recording the k source point intersection v 'in the t-1 iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is Mt-1(ii) a Taking out the m-th intersection and marking asOrder the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 4.3.1: initializing m to 1;
step 4.3.2: traverse the m-th intersectionAnd selecting all the adjacent intersections from the intersection set which does not belong toAnd join into an adjacency set
Step 4.3.2.1: fetching contiguous collectionsAt the q-th intersection in (1), recording the adjacency setMiddle q intersectionThe set of the front driving intersections isMake the adjacent setMiddle q intersectionThe serial number in the intersection set V is rqI.e. by
Step 4.3.2.2: initializing q to be 1;
step 4.3.2.3: traversing precursor intersection setIf all the intersections in (1) are set in the front-driving intersectionAll intersections in (1) belong to the intersection v 'of the kth source point under the first t-1 iterations'kIntersection set for obtaining weight of shortest path for source pointThen step 4.4 is carried out, otherwise step 4.5 is carried out;
step 4.4: acquiring v 'from k-th source point intersection'kObtaining a k source point intersection v 'from all the precursor intersections'kThe shortest path weight of the intersection which is the weight of the shortest path of the source point:
step 4.4.1: precursor-memory intersection setThe number of the intersections in the tree is B, and a precursor intersection set is taken outThe b-th intersection in (1)The serial number of the intersection in the intersection set V is nbI.e. by
Step 4.4.2: initializing b to be 1;
step 4.4.3: if it isThen will beIs assigned toAnd memory forerunner intersectionSequence number n of intersection set VbAssigning to the r-th in the intersection set VqIndividual intersectionNumber n of temporary predecessor intersectionb,min(ii) a Wherein the content of the first and second substances,represents the kth source point intersection v'kN-th in intersection set VbThe weight of the shortest path of each intersection,represents the n-th in the intersection set VbIndividual intersectionTo the r < th > rqIndividual intersectionThe weight of (a) is determined,represents the kth source point intersection v'kR-th in intersection set VqIndividual intersectionThe weight of the shortest path of (1);
step 4.4.4: b +1 is assigned to B, the step 4.4.3 is carried out until B is equal to B, and therefore the k source point intersection v 'is output'kR-th in intersection set VqIndividual intersectionWeight of shortest path ofAnd number nb,minAnd will r beqIndividual intersectionAdding the source point intersection V ' to the kth source point intersection V ' in the source point intersection set V 'kN-th in intersection set Vb,minIndividual intersectionIntersection set of shortest paths ofThereby obtaining the kth source point intersection V 'in the source point intersection set V'kR-th in intersection set VqIndividual intersectionIntersection set of shortest paths ofNamely, it isWill r toqIndividual intersectionTo k source point intersection v'kSet of weights to get the shortest path for a source pointAnd intersecting v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointNamely, it is Turning to step 4.6;
step 4.6: if Q is not equal to Q, assigning Q +1 to Q, and turning to step 4.3.2.3, otherwise, assigning M +1 to M, and judging that M is larger than Mt -1If yes, executing step 4.7; otherwise, turning to the step 4.3.2;
step 4.7: selecting an intersection with the minimum upper bound of the weight of the shortest path from the intersection set V under the t iterationAnd isDoes not belong to the intersection v 'with the k source point under the previous t iterations'kIntersection set for obtaining weight of shortest path for source pointNamely, it isIf it is notThen the kth source point is intersected by v'kThe ith in the intersection set VminIndividual intersectionUpper bound of weight of shortest path ofAssigning to k source point intersection v'kThe ith in the intersection set VminIndividual intersectionWeight of shortest path ofAnd will be the ithminIndividual intersectionAdding the source point intersection V ' to the kth source point intersection V ' in the source point intersection set V 'kThe first in the intersection set VIndividual intersectionShortest path intersection setThereby obtaining the kth source point intersection V 'in the source point intersection set V'kThe ith in the intersection set VminIndividual intersectionShortest path intersection setNamely, it isAnd will be the ithminIndividual intersectionJoin to a collectionIntersection set
And 5: backtracking kth source point intersection v 'under the tth iteration'kSet of intersectionsShortest path at intersection (iii):
step 5.1: recording the intersection v 'with the k source point in the t iteration'kIntersection set for obtaining weight of shortest path for source pointThe number of intersections in (1) is MtAnd taking out the m-th intersection asAnd the m-th intersectionThe serial number in the intersection set V isNamely, it is
Step 5.2: initializing m to 1;
step 5.3: recording k source point intersection v'kThe first in the intersection set VIndividual intersectionSet of shortest path points ofThe number of each intermediate crossing is EmAnd the serial number of the epsilon middle crossing in the crossing set V is recorded as rhoε;
Step 5.3.1: initializing epsilon to be 1;
step 5.3.2: if it is notThen assume thatSimultaneously, the source point intersection V ' at the k ' th source point intersection in the source point intersection set V 'k′I.e. byThen take the shortest path point setMiddle epsilon intersectionTo Em+2 crossingsAll intersections are used as k 'source point intersections v'k′The first in the intersection set VIndividual intersectionShortest path intersection setAnd will beIs assigned toIf k' > k, thenIndividual intersectionAdd to t-1 previous iterations to intersect v ' at the k ' th source point 'k′Set of weights to get shortest path for source pointAnd the kth ' source point intersection v ' in the t-1 iterations 'k′Intersection set for obtaining weight of shortest path for sourceOtherwise, it will beIndividual intersectionAdd to k ' th Source Point intersection v ' of the previous t iterations 'k′Set of weights to get shortest path for source pointAnd intersecting v ' with the k ' source point in the t iteration 'k′Intersection set for obtaining weight of shortest path for source point
Step 5.3.3: judging E ═ EmIf yes, turning to step 5.4, otherwise, assigning epsilon +1 to epsilon, and turning to step 5.3.2;
step 5.4: judging M as MtIf yes, turning to step 6, otherwise, assigning m +1 to m, and turning to step 5.3;
step 6: judging whether K is true or not, if so, turning to a step 7, otherwise, assigning K +1 to K, and turning to a step 4.2;
and 7: and if the shortest path search with all the source point intersections as source points in the source point intersection set V 'under the previous t iterations is finished, indicating that the shortest path from each source point intersection in the source point intersection set V' to any one intersection in the intersection set V is obtained, otherwise, assigning t +1 to t, and turning to the step 4.
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 true CN114001747A (en) | 2022-02-01 |
CN114001747B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115394109A (en) * | 2022-08-30 | 2022-11-25 | 合肥工业大学 | K-pair single-source single-sink shortest-path searching method based on common 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 |
---|
徐建闽;王钰;林培群;: "大数据环境下的动态最短路径算法", 华南理工大学学报(自然科学版), no. 10 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115394109A (en) * | 2022-08-30 | 2022-11-25 | 合肥工业大学 | K-pair single-source single-sink shortest-path searching method based on common calculation and application |
CN115394109B (en) * | 2022-08-30 | 2023-05-02 | 合肥工业大学 | K-pair single-source single-sink shortest searching method based on shared calculation and application |
Also Published As
Publication number | Publication date |
---|---|
CN114001747B (en) | 2023-06-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108256553B (en) | Construction method and device for double-layer path of vehicle-mounted unmanned aerial vehicle | |
CN104462190B (en) | A kind of online position predicting method excavated based on magnanimity space tracking | |
CN100578152C (en) | Heuristic path culculating method for treating large scale floating vehicle data | |
Liang et al. | Applying genetic algorithm and ant colony optimization algorithm into marine investigation path planning model | |
CN112784968A (en) | Hybrid pipeline parallel method for accelerating distributed deep neural network training | |
CN113781817B (en) | Urban road network multisource shortest path obtaining method based on shared computation | |
CN103400372B (en) | A kind of three-dimensional topology information extracting method described based on Reeb figure | |
CN101788999A (en) | Binary chop tracking method of shortest paths in network map | |
CN102175256A (en) | Path planning determining method based on cladogram topological road network construction | |
CN108225333A (en) | A kind of optimal path generation method for flight course planning | |
CN107169557A (en) | A kind of method being improved to cuckoo optimized algorithm | |
CN113359849B (en) | Multi-unmanned aerial vehicle collaborative rapid search method for moving target | |
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 | |
CN114001747A (en) | Urban road network multisource shortest path obtaining method based on common calculation and dijkstra algorithm | |
CN109657794A (en) | A kind of distributed deep neural network performance modelling method of queue based on instruction | |
CN106530779A (en) | Path planning method and system based on urban traffic control signal lights | |
CN114969234A (en) | Vector characterization method for full-quantity city road network | |
CN112229409B (en) | Unmanned aerial vehicle collaborative flight path planning method based on Bayes and evolutionary algorithm | |
CN111623790B (en) | Rapid path planning method for dynamic urban traffic network | |
CN110245271B (en) | Large-scale associated data partitioning method and system based on attribute graph | |
CN113903173A (en) | Vehicle track feature extraction method based on directed graph structure and LSTM | |
CN105162648B (en) | Corporations' detection method based on backbone network extension | |
CN115547087B (en) | Urban road network shortest path acquisition method based on two-stage method and direction induction and application |
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 |