CN109840620A - The querying method of k nearest neighbors pair in more attribute timing transportation networks - Google Patents
The querying method of k nearest neighbors pair in more attribute timing transportation networks Download PDFInfo
- Publication number
- CN109840620A CN109840620A CN201811636467.XA CN201811636467A CN109840620A CN 109840620 A CN109840620 A CN 109840620A CN 201811636467 A CN201811636467 A CN 201811636467A CN 109840620 A CN109840620 A CN 109840620A
- Authority
- CN
- China
- Prior art keywords
- path
- node
- timing
- attribute
- constraint
- 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
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000010586 diagram Methods 0.000 claims abstract description 15
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000006116 polymerization reaction Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 abstract description 9
- HUTDUHSNJYTCAR-UHFFFAOYSA-N ancymidol Chemical compound C1=CC(OC)=CC=C1C(O)(C=1C=NC=NC=1)C1CC1 HUTDUHSNJYTCAR-UHFFFAOYSA-N 0.000 description 6
- 238000013461 design Methods 0.000 description 4
- 238000013138 pruning Methods 0.000 description 4
- 238000011160 research Methods 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 238000010276 construction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000002123 temporal effect Effects 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000379 polymerizing effect Effects 0.000 description 1
- 238000002560 therapeutic procedure Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Abstract
The invention discloses the querying methods of k in a kind of more attribute timing transportation networks nearest neighbors pair, including more attribute timing diagrams of transportation network are mapped in two-dimensional coordinate system;In two-dimensional coordinate system, the straight line L for being parallel to y-axis with one is divided into two all nodes in the transportation network figure, calculates separately k nearest neighbors pair at left and right sides of straight line L, then selects whole k neighbors pair recently;Any one grid c on the left of straight line L is found on the right side of straight line L1R neighbour's grid c2, calculate lattice c1In node vsTo c2In node vdMultiple constraint timing path;And calculate c2In node vdTo c1In node vsMultiple constraint timing path;From node vsTo node vdMultiple constraint timing path and node vdTo node vsMultiple constraint timing path in select and meet the k of multiple constraint neighbors pair recently.The present invention can find out point-to-point transmission in traffic network and meet path constraint and with the shortest distance, meet trip requirements.
Description
Technical field
The present invention relates to transportation network field, in particular to k nearest neighbors in a kind of more attribute timing transportation networks
Pair querying method.
Background technique
With the rapid development of social economy, traffic also becomes more complicated while increasingly flourishing, and in one day
With the variation of timing information, whether point-to-point transmission is connected to, and the crowded state of point-to-point transmission road, oil consumption of automobile etc. can all occur
Therefore how variation effectively and rationally carries out urban planning and trip arranges one of the problem of having become puzzlement people.This
The it is proposed of method is exactly in order to solve this problem.For example, user needs to design a tourism planning on the 2nd, is carrying out hotel
It subscribes, tourism route can consider some factors when planning [3], these factors include the Earliest Start Time from hotel, arrive sight spot
Arrival time the latest, the transport cost budget from hotel to sight spot, runing time and the distance of point-to-point transmission etc..Therefore,
K nearest neighbors in transportation network have attracted people's to inquiry (k-Closest-Pairs-Query, k-CPQ)
Attention.For in traditional sense, give road network on two kinds of interest point sets P and Q, then k-CPQ can return from
The k interest node pair of P*Q, and these nodes to the distance between be that preceding k is small.For this scene of tourism planning, P is just
It is hotel's set, Q is exactly sight spot set.In addition, transportation network has timing information, the departure time of vehicle is according to
Table arranges at the time of having, then people just need to consider timing information when carrying out tourism route planning.
In public traffic network, each vehicle other than with timing information, from origin to destination between have
Range ability, the attributes such as operating cost.Usual people also can propose some corresponding constraints to these attributes when considering path
To show their requirements to path.For example user wants several sight spots that this city of Shanghai was gone sight-seeing with three day time, Ta Menxi
Two sight spots can be gone sight-seeing by hoping between daily 8:30 to 10:30 in the morning, and it is desirable that between the two sight spots gone sight-seeing daily
Distance recently, and is no more than 45 minutes from the time that a sight spot is got a lift to another sight spot, and expense of getting a lift is no more than 70 yuan,
Should so how travel party arrange daily tour? this problem can be abstracted as how to solve more attribute timing
Meet k nearest neighbors of multiple constraints in transportation network to inquiry problem, this there are real-life various applications
Important meaning.
The solution of existing k-CPQ is broadly divided into two classes, and one kind is that k-CPQ is solved in Euclidean space, separately
One kind is to solve k-CPQ on other metric spaces.The certain methods in Euclidean space, Corral et al. are introduced first
[1] assume in R*Interest point set P and Q are established respectively in tree and indexed, R is then utilized*The hierarchical attribute of tree is repaired to improve
Cut ability.In order to quickly seek node to the distance between, two-way extended method is used in [2] [3], in addition two-dimensional scanning technique
Beta pruning is carried out to some remote nodes, in addition, further improving by one good scan axis of selection and scanning direction
The efficiency of scanning.Yang and Lin [4] proposes a kind of new index structure bRdnn-tree, exists for tracking each node in P
Nearest neighbors in Q.Secondly the certain methods in other metric spaces are introduced, Gao et al. [5] proposes excellent based on depth
First, three kinds of most preferably preferential and combinations thereof methods, use M tree [6] to handle k-CPQ.Kurasawa et al. [7], which is proposed, to be based on dividing
The adaptive multi partition method of therapy solves the problems, such as k-CPQ, and the basic thought of this method is to reduce kth by continuous iteration
The upper bound of the distance of big arest neighbors pair.
In addition, k-CPQ problem is often associated with similarity join inquiry, the target of similarity join algorithm be find away from
From the node pair for being no more than ε.Jacox et al. [8] proposes the basic thought based on the method behind arranged fastly, it will recursively be counted
According to being divided into smaller subregion.Fredriksson et al. [9] improves the method in [8].Sarma et al. [10] and
Wang et al. [11] is based on Map-Reduce technique study similarity join problem, and this method is distributed to draw based on bottom data
Divided data space.As noted previously, as being difficult to select ε value appropriate, lesser value may cause incomplete as a result, and larger
Value may generate excessive expense, therefore the method for solving the problems, such as similarity join can not effectively handle k-CPQ.
In addition, existing analysis method there is a problem in that:
(1) analysis method is based on static map, does not consider timing information.It is real-life for static map
Traffic network tends to timing diagram, such as the degree of crowding of different time sections traffic route is different, when so as to cause operation
Between it is different, the price of different time sections flight is different etc., and traditional method is situation about considering on static map,
Therefore the case where real world cannot being fitted well.
(2) the only simple constraint considered on path.From the point of view of current research, most of nodal distance
Research is all the target only considered under a target or single constraint, such as classical dijkstra's algorithm, it only considered
This target of path length, many methods only considered the shortest path under the constraint of given operating cost.However, real
In life, people often consider Multiple factors in the activity such as trip, for example point out from A and can consider total row when being dealt into B point
It sails the time, total automobile fuel consumption budget etc., is selecting the paths for being best suitable for condition after comprehensively considering Multiple factors, therefore,
Only consider also solve the practical problem in life if a constraint.
(3) accuracy rate is not high, long operational time.For now, there are no particular studies to handle on timing diagram
The nearest neighbors of multiple constraint k needs if conventional method is applied to this respect to any in figure inquiry problem
Two nodes calculate the aggregate-value of each attribute on path and the path between them, then select k and meet constraint
Node with shortest path to gathering as a result.And when calculating the path between each node pair, for each
Attribute, which needs to calculate, meets the shortest path of the attribute constraint, if there is W attribute, then needs W shortest path of calculating, then from this
Intersection is filtered out in W path set, it can be seen that, it is not very high in terms of this method either efficiency or accuracy rate.
[1]A.Corral,Y.Manolopoulos,Y.Theodoridis,and
M.Vassilakopoulos.Algorithms for processing k-closest-pair queries in spatial
databases.DKE,49(1):67–104,2004[2].
[2]H.Shin,B.Moon,and S.Lee.Adaptive multi-stage distance join
processing.ACM SIGMOD Record,29(2):343–354,2000.
[3]H.Shin,B.Moon,and S.Lee.Adaptive and incremental processing for
distance join queries.IEEE TKDE,15(6):1561–1578,2003.
[4]C.Yang and K.-I.Lin.An index structure for improving closest pairs
and related join queries in spatial databases.In IEEE IDEAS,pages 140–149,
2002.
[5]Y.Gao,L.Chen,X.Li,B.Yao,and G.Chen.Efficient k-closest pair
queries in general metric spaces.VLDBJ,pages 1–25,2015.
[6]M.Patella,P.Ciaccia,and P.Zezula.M-tree:An efficient access method
for similarity search in metric spaces.In VLDB,pages 1241–1253,1997.
[7]H.Kurasawa,A.Takasu,and J.Adachi.Finding the k-closest pairs in
metric spaces.In Proc.of the 1st Workshop on New Trends in Similarity Search,
pages 8–13,2011.
[8]E.H.Jacox and H.Samet.Metric space similarity joins.ACM TODS,33
(2):7,2008.
[9]K.Fredriksson and B.Braithwaite.Quicker similarity joins in metric
spaces.In Similarity Search and Applications,pages 127–140.2013.
[10]A.Das Sarma,Y.He,and S.Chaudhuri.Clusterjoin:a similarity joins
framework using map-reduce.PVLDB,7(12):1059–1070,2014.
[11]Y.Wang,A.Metwally,and S.Parthasarathy.Scalable all-pairs
similarity search in metric spaces.In ACM KDD,pages 829–837.ACM,2013.。
Summary of the invention
It is an object of the invention to overcome the deficiencies in the prior art, propose in a kind of more attribute timing transportation networks k most
The querying method of neighboring node pair can quickly be found in user given under the constraint of multiple attributes on transportation network figure
To the k nearest neighbors for meeting constraint, that is, find out point-to-point transmission in traffic network meet it is constraint and with the shortest distance
Path meets trip requirements.
The present invention adopts the following technical scheme:
The querying method of k neighbors pair recently in a kind of more attribute timing transportation networks, comprising:
More attribute timing diagrams of transportation network are mapped in two-dimensional coordinate system;
In the two-dimensional coordinate system, the straight line L of y-axis is parallel to all nodes in the transportation network figure with one
It is divided into two, calculates separately k nearest neighbors pair at left and right sides of straight line L, then select whole k nearest neighbors
It is right;The finger that is divided into two is identical with the node number of the division at left and right sides of straight line L or node number difference is 1;
Square net is constructed by diagonal line of the big distance r of kth, and straight line L is on grid lines;
Any one grid c on the left of straight line L is found on the right side of straight line L1R neighbour's grid c2, calculate grid c1In section
Point vsTo grid c2In node vdMultiple constraint timing path;And calculate grid c2In node vdTo c1In node vsIt is more
Constrain timing path;From node vsTo node vdMultiple constraint timing path and node vdTo node vsMultiple constraint timing path
In select and meet the k of multiple constraint neighbors pair recently.
Preferably, node vsTo node vdMultiple constraint timing path calculation method, comprising:
Reverse search step: from terminal vdTo starting point vsReverse search is carried out, reverse search path is calculatedMesh
Equation value is marked, then judges whether reverse search path meets corresponding W constraint, path by the value of target equationTarget equation value be stored in node viIn;
Positive spread step: in conjunction with the information stored in reverse search step, from starting point vsTo terminal vdIt scans for, looks for
To starting point vsV to terminaldBetween meet the most short timing path of constraint.
Preferably, the reverse search step includes:
Step 301, to each side e=(vi,vi+1,ti,fW(e)) it is successively checked, if when setting out of this edge
Between and arrival time in given time interval [tα,tβ] in, then follow the steps 302;If the departure time is in time interval [tα,
tβ] in, arrival time not in the section, then handles lower a line;Otherwise, stopping is handled;Wherein, tiIndicate this when setting out
Between;
Step 302, from vdStart, for side e=(vi,vi+1,ti,fW(e)), enabling corresponding runing time is ri;If
vi+1It is terminal, then updatingIt utilizesIn informationUpdate obtainsIn an informationSpeciallyAlso,Its
In,Indicate reversed timing pathFrom vi+1The departure time of point;It indicatesIn when
Preceding the smallest target function value;The aggregate-value of j-th of attribute is indicated, wherein 1≤j≤W;
It is rightAfter update, deleteIn to subject element;
Step 303, ifSeparatelyIfSeparately Wherein,Indicate setting out the latest the moment for reverse path;
Step 304: for each node, returning to the minimum target functional value of reverse pathObtain mesh
It sets out the moment in the path of offer of tender numerical valueWith setting out the latest the moment for reverse path
Preferably, before the step 301 further include:
Timing sides all in more attribute timing diagrams are sorted from large to small according to the departure time.
Preferably, the positive spread step includes:
Step 501, determine the side e=(v that Current Scan arrivesi,vi+1,ti,fW(e)) whether moment of setting out is given in user
Time interval in, if not, stopping handle;If the departure time is in time interval [tα,tβ] in, arrival time is not at this
Section then handles lower a line;If setting out moment and arrival time all within given time, 502 are thened follow the steps;
Step 502, the attribute value in the latter half path first half path currently sought and reverse procedure sought
Ask polymerization, comprising:
Step 5021, judge from vi+1To vdTiming path minimum target functional valueWhether 1 is greater than,
IfShow from vi+1To vdBetween meet constraint there is no one path;
Step 5022, ifJudge from vsBy e to vi+1PathArrival time
Whether v is less thani+1To vdSet out the latest the momentIfExplanationWith all from vi+1To vdRoad
Diameter can not be connected in time, from vsV cannot be reached by ed;
Step 5023, if?With the minimum in the latter half path sought in reverse procedure
Target equation valueIt is polymerize, obtains polymerization routeAndWherein 1≤j≤W;IfShow from vsIt is arrived by e
vdThe path of constraint is not met;IfThen utilizeIn information go to updateIt deletesIn
Subject element;Wherein,In the form of each element beaviIndicate positive timing pathTo viPoint arrives
Up to the time;Indicate target function value;Indicate the aggregate-value of j-th of attribute;Indicate from
Path length of the starting point to v;
Step 503:In find from vsTo vdMeet the shortest path of constraint, and from selecting k node pair.
Preferably, before the step 501 further include:
Sequence is arrived on timing sides all in more attribute timing diagrams according to the departure time from small to large.
Compared with prior art, beneficial effects of the present invention are as follows:
(1) in a kind of more attribute timing transportation networks of the present invention k neighbors pair recently querying method, it is contemplated that traffic
The feature of the timing diagram of network, different from traditional static map;
(2) in a kind of more attribute timing transportation networks of the present invention k neighbors pair recently querying method, propose one
The target equation being made of multiple attribute values and corresponding binding occurrence in path, the target equation are used to judge every on path
Whether a attribute meets the constraint that user gives, to judge whether this paths is feasible;
(3) in a kind of more attribute timing transportation networks of the present invention k neighbors pair recently querying method, propose to traffic
Road network (more attribute timing diagrams) carries out the algorithm of bidirectional research (forward and reverse combination) to comprehensively consider binding occurrence and shortest path
This target value, so as to find out the multiple constraint shortest path between two nodes;
(4) in a kind of more attribute timing transportation networks of the present invention k neighbors pair recently querying method, propose the side of dividing and ruling
Method come the calculating for the node pair for accelerating k arest neighbors satisfaction to constrain, and is carried out in calculating process using grid dividing method
Beta pruning.
The above description is only an overview of the technical scheme of the present invention, in order to more clearly understand technology hand of the invention
Section, so as to be implemented in accordance with the contents of the specification, and in order to allow above and other objects, features and advantages of the invention
It can be more clearly understood, be exemplified below a specific embodiment of the invention.
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter
Above-mentioned and other purposes of the invention, advantages and features.
Detailed description of the invention
Fig. 1 is the more attribute timing road network figures of the embodiment of the present invention being mapped in two-dimensional coordinate system;
Fig. 2 is the more attribute timing road networks for constructing grid of the embodiment of the present invention;
Fig. 3 is r neighbour's grid schematic diagram of the embodiment of the present invention;
Fig. 4 is the more attribute timing road networks and corresponding public bus network figure of the embodiment of the present invention;Wherein Fig. 4 (a) is more attributes
Timing road network figure, Fig. 4 (b) are corresponding public bus network figure.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
The querying method of k nearest neighbors pair in a kind of more attribute timing transportation networks of the present invention, for inquiring timing
K nearest neighbors on figure under multiple constraint solve the problems, such as this using divide and conquer on the whole to problem.Firstly, in coordinate system
In, the straight line L for being parallel to y-axis with one is divided into two all nodes, calculates separately k nearest neighbors at left and right sides of L
It is right, whole k neighbors pair recently are then selected, it is (i.e. square to construct square net using the big distance r of kth as diagonal line
Side length is), and straight line L is on grid lines.To any one grid c on the left of L1, c is found on the right side of L1R neighbour's net
Lattice c2, calculate c1In node vsTo c2In node vdMultiple constraint timing path.Similarly, c is calculated2In node vdTo c1In
Node vsMultiple constraint timing path.Node vsTo node vdThe calculation of timing path include: first from vdTo vsInto
Row reverse search, calculates vsTo vdPath and intermediate node to vdPath minimum target equation value and set out the latest
Moment, then from vsStarting positive extensions path, the information for combining reverse procedure to retain in expansion process carries out beta pruning, thus
Accelerate inquiry velocity, finally obtains from vsTo vdBetween meet constraint most short timing path.Finally the k for meeting multiple constraint
Nearest neighbors to exporting as a result.
Specifically, including following three aspect:
One, whether multiple attribute values that proposition passes through in transportation network information decision paths meet the constraint that user gives
Target equation, it is specific as follows.
In daily trip, user often proposes the attributes such as stroke the time it takes, oil consumption according to the hobby of oneself
Whether corresponding constraint, meet constraint therefore, it is necessary to design a target equation come the attribute polymerizing value judged on path.Its
It is secondary, since transportation network is many times real-time change, the information of every road under different time sections must be obtained first.Mesh
Before, with the fast development of global positioning system, wireless communication and development of Mobile Internet technology, road network information can be increasingly easy
Acquisition, for example the information such as path length and the running time of point-to-point transmission can be easily obtained by Baidu map.According to this
A little Given informations, it can be determined that go out the constraint whether path meets user.
The target equation is made of multiple attribute values and corresponding binding occurrence in path, which is used to
Judge whether each attribute on path meets corresponding constraint.Given W constraint, λ1,λ2,…λW, in t moment from starting point vsIt arrives
Terminal vtPathTarget equation be defined as:
Wherein,Wherein 1≤w
≤ W, f1(e(vi,vi+1,ti,fW(e))) ..., fW(e(vi,vk)) it is side e (vi,vi+1,ti,fW(e)) W attribute value on, such as
FruitShow pathMeet W constraint, is a feasible path, otherwise, the path is infeasible.
Using above-mentioned δ function, the target equation of any two node in transportation network can be indicated.
In transportation network, this W attribute may include runing time of the vehicle between two bus stops, two stops
The number of transfer etc. of admission fee and user between standing from origin-to-destination.If user want to be left to grow strong and insubordinate bar from Suzhou to
Yangzhou, it is desirable to which runing time no more than 3 hour on the way, admission fee are no more than 80 yuan, and number of transfer is no more than 1 time.According to
From the point of view of communications and transportation route, there are such two schemes: (1) directly from Suzhou to Yangzhou, 78 yuan of admission fee, number of transfer 0;(2)
Zhenjiang is gone to by bus from Suzhou, 50 yuan of admission fee, then Yangzhou is gone to by bus from Zhenjiang, 30 yuan of admission fee, number of transfer is 1 time.Of the invention
Target is exactly to utilize this method, judges whether the attribute value in the path in some period meets by real-time road network information
User's constraint.
Two, the path with the shortest distance of constraint is met by transportation network information searching point-to-point transmission, it is specific as follows.
Since final goal is to find k arest neighbors point of interest for meeting user's constraint in traffic network, and pass through upper
State target equation, have been able to judge a paths whether meet user to multiple constraints therefore need further exist in traffic
Point-to-point transmission is found out in road network meets path constraint and with the shortest distance.
Based on target set forth above, the invention proposes a Double Step algorithms, and the algorithm is to traffic network (when more attributes
Sequence figure) bidirectional research is carried out, it is searched for for the first time from terminal vdTo starting point vs, searched for for the second time from starting point vsTo terminal vd.In the calculation
In method, the reverse procedure of the first step calculates reverse search path (Backward Temporal Path) firstMesh
Equation value is marked, then judges whether BTP (Backward Temporal Path) meets corresponding W by the value of target equation
A constraint, in this process, pathTarget equation value be stored in node viIn, it can be used to accelerate second
The search of positive process.IfShow from starting point vsTo terminal vdThere are a feasible paths.Then, it connects
The forward lookup process got off can be from starting point vsTo terminal vdIt scans for, to find the shortest path for meeting constraint.
(a) reverse search process
This process is from terminal vdTo starting point vsIt scans for, it is main to calculate two values: (1) intermediate node viTo vdInstitute
There is the minimum δ value of timing path, uses δminIt indicates, the departure time in corresponding path is expressed asAnd intermediate node viIt arrives
vdAll timing paths set out the latest the moment, useIt indicates.Therefore, in each node viOn, store δmin、With
These information stored on node can during forward lookup aid forecasting path feasibility.In addition, reversely searching
During rope, if node viTo node vdThere are two paths p1And p2If p1Departure time ratio p2Departure time it is early, and
And δ (p1) value ratio δ (p2) greatly, then just saying p2Dominate p1, then can be path p1It removes, because the path departure time gets over
Early, previous path is more difficult to connect with the path, and current δ value is bigger, and final δ value is more possible to be unsatisfactory for constraining.
The main process of reverse search is as follows: first all timing sides in timing diagram according to the departure time from big to small
Sequence.A L is created on each node vvTo store from node v to terminal vdAll paths relevant information, LvIn it is every
The form of a element isWherein dv、WithRespectively
Indicate reversed timing pathFrom the departure time of v point, the aggregate-value of target function value and j-th of attribute, wherein 1≤j≤
W.In order to facilitate the elaboration of algorithm, side e=(v is enabledi,vi+1,ti,fW(e)) (ti here refers to setting out the moment for this edge)
Runing time riTo indicate.
The reverse search process specifically comprises the following steps:
Step 301: to each side e=(vi,vi+1,ti,fW(e)) it is successively checked, if when setting out of this edge
Between and arrival time in given time interval [tα,tβ] in, then jump to step 302;If the departure time is in time interval [tα,
tβ] in, arrival time not in the section, then handle lower a line (before search, by all sides according to the departure time from
It arrives small sequence greatly to be sorted, therefore lower a line is exactly the lower a line sorted from large to small according to the departure time);It is no
Then, algorithm terminates;
Step 302: from vdStart, for side e=(vi,vi+1,ti,fW(e)), corresponding runing time is ri.If vi+1
It is by chance terminal, then updating(i.e. by (ti+ri, 0,0 ... .0) and it is added toIn, hereBe exactly value from terminal to
The relevant information of terminal, including t at the time of from terminali+ri, the target function value 0 and this attribute of terminal to terminal
Accumulated value 0 because being from terminal to terminal, actually there is no running, so association attributes are all 0, this is one in fact
Kind special circumstances);Then, it is based onIt updatesSelectionIn elementWhereinAndIt isIn
Current the smallest target function value.It updates to obtain using the elementIn an information,WhereinFurther,
It is rightAfter update, deleted using above-mentioned beta pruningIn to subject element;
Step 303: ifIt updatesIfMore new node vi's
δmimAnd the value corresponding path is set out the moment
Step 304: for each node, returning to δmin,WithThat is the minimum target functional value of reverse path, and
Obtain setting out the latest the moment for set out moment and the reverse path in the path of the functional value.
(b) positive expansion process
All timing sides in figure are arrived sequence according to the departure time first by the process from small to large, then to these sides into
Row traversal is to seek the shortest path for meeting constraint, in the process, goes out in conjunction with the minimum target equation value reversely acquired and the latest
The hair moment predicts the feasibility in path.When initialization, a F is created on each node vvTo store starting point vsIt arrives
The relevant information in all paths of node v, FvIn the form of each element beWherein av,
Respectively indicate positive timing pathTo the arrival time of v point, target function value, j-th of attribute aggregate-value (1≤j≤
W), the path length from starting point to v.It is illustrated in order to facilitate calculating, e=(vi,vi+1,ti,fw(e)) runing time riCarry out table
Show.Specifically comprise the following steps:
Step 501: determining the side e=(v that Current Scan arrivesi,vi+1,ti,fw(e)) whether moment of setting out is given in user
Time interval in, if it was not then algorithm terminates;If the departure time is in time interval [tα,tβ] in, arrival time does not exist
The section then handles lower a line;If setting out moment and arrival time all within given time, step is jumped to
502;
Step 502: to the attribute value in the latter half path that the first half path currently sought and reverse procedure are sought
Polymerization is asked, main process is as follows: (1) first determined whether from vi+1To vdTiming path minimum target functional value
Whether 1 is greater than, ifIllustrate from vi+1To vdBetween meet constraint there is no one path;(2) such as
FruitJudge from vsBy e to vi+1PathArrival time whether be less than vi+1To vdMost
Evening sets out the momentIfShowWith all from vi+1To vdPath can not be connected in time,
Illustrate from vsV cannot be reached by ed;(3) ifNext handleAfter being sought in reverse procedure
The minimum target equation value of half portion sub-pathIt is polymerize, obtains polymerization routeAnd Wherein 1≤j≤W.IfShow from vsBy e to vdDo not meet
The path of constraint;IfThen it can useIn information go to updateSpecially 1≤j≤W, also,WhereinTable
Show positive timing pathReach vi+1Time;It indicatesIn current the smallest target function value;The aggregate-value of j-th of attribute is indicated, wherein 1≤j≤W;After having updated, deleteIn subject member
Element;
Step 503:In find from vsTo vdMeet the shortest path of constraint, and returns.
Eventually by above-mentioned master slave servo control, so that it may obtain meeting user's constraint in transportation network between any two points
That path (if present) with the shortest distance.
Three, the preceding k arest neighbors point of interest pair for meeting multiple constraint is hunted out in entire transportation network.
By above-mentioned one and two, have been able to obtain point-to-point transmission in transportation network meet user constraint have the shortest distance
Path, but entire transportation network is very huge, it is desirable to enumerate all points to be it is unpractical, therefore, how
Effectively and efficiently solve the problems, such as that transportation network is one and is worth thinking deeply and has the problem of realistic meaning.For this purpose, this
Invention proposes the k nearest neighbor point calculation method based on divide and conquer, as follows.
Referring to shown in Fig. 1 to Fig. 3, since entire transportation network can be abstracted as attribute timing diagram more than one, each node
All there is location information, each edge has attribute information more, therefore, entire transportation network timing diagram can be mapped to two-dimentional seat
In mark system, in the two-dimensional coordinate system, the straight line L that is parallel to y-axis with one is being divided into two all nodes, and described one point
Refer to that identical with the node number of the division at left and right sides of straight line L or node number difference is 1 for two.Enable P1And P2Respectively indicate the left side L
The node of side and right side finds out the nodes pair with shortest path that k meets constraint in L left and right side respectively, then
The result that two sides obtain merges, that is, the small a node pair of k before taking so far only accounts for unilateral situation, does not consider that two sides intersect
The case where the case where (node on the left of L, a node is on the right side of L), so next being calculated by means of construction grid
The case where two sides intersect, to obtain the whole k nodes pair with shortest path for meeting constraint.It is specific as follows: with current
The big distance r of kth is diagonal line, and (i.e. square side length is construction square net), guarantee L in grid lines when constructing grid
Upper (dotted line as shown in Figure 2 is the grid of construction, and L facilitates calculating on grid lines), then for distance L each of on the left of L
Grid cell c less than r1, (c is required here1To L the shortest distance be less than r be because, if c1The shortest distance to L is greater than
R, then for any node on the right side of L, c1In node to it distance will necessarily be greater than r, also just it is undesirable, also
Do not continue the necessity calculated, therefore, because the presence of grid and r does not need to traverse in the case where calculating two sides intersection
All grids, it is only necessary to traverse those apart from satisfactory), by finding c on right side1R neighbour's grid c2(such as
Fruit c1To c2The shortest distance be no more than r, then c2It is exactly c1R neighbour's grid, c2 may more than one, as shown in figure 3, c1It arrives
c2The shortest distance be MinDist, if MinDist≤r, c2It is exactly c1R neighbour's grid, similarly, c1It is also c2R it is close
Adjacent grid), c is calculated using the forward and reverse searching algorithm introduced in above-mentioned two1In any node vsTo c2In any node
vdMultiple constraint timing path.Similarly, c is calculated2In any node vdTo c1In any node vsMultiple constraint timing path.
K meet the node pair with shortest path of constraint before finally selecting.View of the above, it will be seen that often calculating one
The catercorner length of the small node pair of new kth, grid will reduce therewith, and the node that can be filtered out will be more, in this way
Efficiency of algorithm will be faster.
Correspondingly, referring to FIG. 1 to FIG. 4, in traffic network, set P={ a, c, d, k } is enabled to indicate hotel's set,
Set Q={ h, i, j } indicates that sight spot set, the weight on side indicate the length in the section, show each road in Fig. 4 table
Bus information in section, the information such as moment of setting out, runing time and the expense of starting point, terminal, public transport comprising the section.It is given
Time interval [8:30AM, 10:30AM], the runing time on section are no more than 45 minutes, and total budget is no more than $ 10, needs
Liang Ge arest neighbors hotel-sight spot pair is found, with the present invention it can be concluded that two meet time interval and multiple attribute constraints
Arest neighbors hotel-sight spot pair, one of hotel-sight spot is to for (c, j), and distance is 5km, and user is in 9:00AM in c point
Nearby get a lift b2, then corresponding runing time is 24mins, expense is $ 5, and reaches f point in 9:24AM, is existed in 9:45AM
F point is got a lift b2J point is gone to, corresponding runing time is 18mins, and expense is $ 4, then the user can reach j in 10:03AM
Point, in whole process, it is 42mins that the sum of some time is spent on section, and expense is $ 9.Another hotel-sight spot to for
(d, i), distance are 9km, and user can take vehicle b near d point in 9:00AM2, then e point can be reached in 9:20AM,
Then b is changed in e point in 9:30AM3I is gone to, then user can reach i, the whole runing time on section in 9:55AM
For 45mins, expense is $ 9.
The above is only a specific embodiment of the present invention, but the design concept of the present invention is not limited to this, all to utilize this
Design makes a non-material change to the present invention, and should all belong to behavior that violates the scope of protection of the present invention.
Claims (6)
1. the querying method of k nearest neighbors pair in a kind of more attribute timing transportation networks characterized by comprising
More attribute timing diagrams of transportation network are mapped in two-dimensional coordinate system;
In the two-dimensional coordinate system, the straight line L for being parallel to y-axis with one divides all nodes one in the transportation network figure
It is two, calculates separately k nearest neighbors pair at left and right sides of straight line L, then select whole k neighbors pair recently;Institute
It states to be divided into two and refers to that identical with the node number of the division at left and right sides of straight line L or node number difference is 1;
Square net is constructed by diagonal line of the big distance r of kth, and straight line L is on grid lines;
Any one grid c on the left of straight line L is found on the right side of straight line L1R neighbour's grid c2, calculate grid c1In node vs
To grid c2In node vdMultiple constraint timing path;And calculate grid c2In node vdTo c1In node vsMultiple constraint
Timing path;From node vsTo node vdMultiple constraint timing path and node vdTo node vsMultiple constraint timing path in select
Meet k nearest neighbors pair of multiple constraint out.
2. the querying method of k nearest neighbors pair, feature in more attribute timing transportation networks according to claim 1
It is, node vsTo node vdMultiple constraint timing path calculation method, comprising:
Reverse search step: from terminal vdTo starting point vsReverse search is carried out, reverse search path is calculatedTarget side
Journey value, then judges whether reverse search path meets corresponding W constraint, path by the value of target equation
Target equation value be stored in node viIn;
Positive spread step: in conjunction with the information stored in reverse search step, from starting point vsTo terminal vdIt scans for, has found
Point vsV to terminaldBetween meet the most short timing path of constraint.
3. the querying method of k nearest neighbors pair, feature in more attribute timing transportation networks according to claim 2
It is, the reverse search step includes:
Step 301, to each side e=(vi, vi+1, ti, fW(e)) successively checked, if the departure time of this edge and
Arrival time is in given time interval [tα, tβ] in, then follow the steps 302;If the departure time is in time interval [tα, tβ]
Interior, arrival time not in the section, then handles lower a line;Otherwise, stopping is handled;Wherein, ti indicates this departure time;
Step 302, from vdStart, for side e=(vi, vi+1, ti, fW(e)), enabling corresponding runing time is ri;If vi+1It is
Terminal, then updatingIt utilizesIn informationIt updates
It obtainsIn an informationSpeciallyAlso,Its
In,Indicate reversed timing pathFrom the departure time of vi+1 point;It indicatesIn
Current the smallest target function value;The aggregate-value of j-th of attribute is indicated, wherein 1≤j≤W;
It is rightAfter update, deleteIn to subject element;
Step 303, ifSeparatelyIfSeparately Wherein,Indicate setting out the latest the moment for reverse path;
Step 304: for each node, returning to the minimum target functional value of reverse pathObtain target letter
It sets out the moment in the path of numerical valueWith setting out the latest the moment for reverse path
4. the querying method of k nearest neighbors pair, feature in more attribute timing transportation networks according to claim 3
It is, before the step 301 further include:
Timing sides all in more attribute timing diagrams are sorted from large to small according to the departure time.
5. the querying method of k nearest neighbors pair, feature in more attribute timing transportation networks according to claim 3
It is, the forward direction spread step includes:
Step 501, determine the side e=(v that Current Scan arrivesi, vi+1, ti, fW(e)) set out the moment whether when user gives
Between in section, if not, stopping is handled;If the departure time is in time interval [tα, tβ] in, arrival time not in the section,
Then handle lower a line;If setting out moment and arrival time all within given time, 502 are thened follow the steps;
Step 502, the attribute value in the latter half path sought to the first half path currently sought and reverse procedure asks poly-
It closes, comprising:
Step 5021, judge from vi+1To vdTiming path minimum target functional valueWhether 1 is greater than, ifShow from vi+1To vdBetween meet constraint there is no one path;
Step 5022, ifJudge from vsBy e to vi+1PathArrival time whether
Less than vi+1To vdSet out the latest the momentIfExplanationWith all from vi+1To vdPath exist
It can not be connected on time, from vsV cannot be reached by ed;
Step 5023, if?With the minimum target in the latter half path sought in reverse procedure
Equation valueIt is polymerize, obtains polymerization routeAndWherein 1≤j≤W;IfShow from vsIt is arrived by e
vdThe path of constraint is not met;IfThen utilizeIn information go to updateIt deletesIn
Subject element;Wherein,In the form of each element beaviIndicate positive timing pathTo viPoint arrives
Up to the time;Indicate target function value;Indicate the aggregate-value of j-th of attribute;Indicate from
Path length of the starting point to v;
Step 503:In find from vsTo vdMeet the shortest path of constraint, and from selecting k node pair.
6. the querying method of k nearest neighbors pair, feature in more attribute timing transportation networks according to claim 5
It is, before the step 501 further include:
Sequence is arrived on timing sides all in more attribute timing diagrams according to the departure time from small to large.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811636467.XA CN109840620B (en) | 2018-12-29 | 2018-12-29 | Query method for k nearest neighbor node pairs in multi-attribute time sequence traffic network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811636467.XA CN109840620B (en) | 2018-12-29 | 2018-12-29 | Query method for k nearest neighbor node pairs in multi-attribute time sequence traffic network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109840620A true CN109840620A (en) | 2019-06-04 |
CN109840620B CN109840620B (en) | 2024-03-08 |
Family
ID=66883471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811636467.XA Active CN109840620B (en) | 2018-12-29 | 2018-12-29 | Query method for k nearest neighbor node pairs in multi-attribute time sequence traffic network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109840620B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114692352A (en) * | 2022-04-06 | 2022-07-01 | 中南大学 | Intelligent layout method for highway network in mountain railway construction |
CN117236247A (en) * | 2023-11-16 | 2023-12-15 | 零壹半导体技术(常州)有限公司 | Signal shielding wire generation method for chip test |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20040042216A (en) * | 2002-11-13 | 2004-05-20 | 에스케이 주식회사 | System for route searching of car and method thereof |
CN101819717A (en) * | 2010-03-05 | 2010-09-01 | 吉林大学 | Road network performance judgment method based on traffic state space-time model |
CN102506849A (en) * | 2011-09-28 | 2012-06-20 | 浙江大学 | Method for optimizing shortest path with restraint |
US20120283948A1 (en) * | 2011-05-03 | 2012-11-08 | University Of Southern California | Hierarchical and Exact Fastest Path Computation in Time-dependent Spatial Networks |
CN102880642A (en) * | 2012-08-20 | 2013-01-16 | 浙江工业大学 | Bus transfer method based on weighted directed network model |
CN104317886A (en) * | 2014-10-23 | 2015-01-28 | 西北工业大学 | Method for retrieving and selecting neighbor conditional data points in grid node interpolation under fault constraint |
CN109086302A (en) * | 2018-06-21 | 2018-12-25 | 苏州大学 | Multiple-constrained paths querying method under timing diagram based on Skyline |
-
2018
- 2018-12-29 CN CN201811636467.XA patent/CN109840620B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20040042216A (en) * | 2002-11-13 | 2004-05-20 | 에스케이 주식회사 | System for route searching of car and method thereof |
CN101819717A (en) * | 2010-03-05 | 2010-09-01 | 吉林大学 | Road network performance judgment method based on traffic state space-time model |
US20120283948A1 (en) * | 2011-05-03 | 2012-11-08 | University Of Southern California | Hierarchical and Exact Fastest Path Computation in Time-dependent Spatial Networks |
CN102506849A (en) * | 2011-09-28 | 2012-06-20 | 浙江大学 | Method for optimizing shortest path with restraint |
CN102880642A (en) * | 2012-08-20 | 2013-01-16 | 浙江工业大学 | Bus transfer method based on weighted directed network model |
CN104317886A (en) * | 2014-10-23 | 2015-01-28 | 西北工业大学 | Method for retrieving and selecting neighbor conditional data points in grid node interpolation under fault constraint |
CN109086302A (en) * | 2018-06-21 | 2018-12-25 | 苏州大学 | Multiple-constrained paths querying method under timing diagram based on Skyline |
Non-Patent Citations (5)
Title |
---|
ALBERTO VISERAS: "An asynchronous distributed constraint optimization approach to multi-robot path planning with complex constraints", ACM * |
刘凯洋;范新灿;: "Bi-BFS:一种新颖的基于时序图的可达性算法", 现代计算机(专业版), no. 08 * |
刘真;吴向阳;郑秋华;: "动态网络可视化与可视分析综述", 计算机辅助设计与图形学学报, no. 05 * |
杨雅君: "动态图数据上查询与挖掘算法的研究综述", 智能计算机与应用, no. 4 * |
杨雅君: "动态图数据上查询与挖掘算法的研究综述", 计算机软件及计算机应用, no. 4 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114692352A (en) * | 2022-04-06 | 2022-07-01 | 中南大学 | Intelligent layout method for highway network in mountain railway construction |
CN117236247A (en) * | 2023-11-16 | 2023-12-15 | 零壹半导体技术(常州)有限公司 | Signal shielding wire generation method for chip test |
CN117236247B (en) * | 2023-11-16 | 2024-01-23 | 零壹半导体技术(常州)有限公司 | Signal shielding wire generation method for chip test |
Also Published As
Publication number | Publication date |
---|---|
CN109840620B (en) | 2024-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105938572B (en) | A kind of more automatic guided vehicle paths planning methods of the pre- anti-interference of logistics storage system | |
CN100523735C (en) | Fast map matching method based on small lattice road network organization and structure | |
CN105551244B (en) | A kind of dynamic path planning method | |
CN104346444B (en) | A kind of the best site selection method based on the anti-spatial key inquiry of road network | |
CN110345960B (en) | Route planning intelligent optimization method for avoiding traffic obstacles | |
CN109508809A (en) | Crew management method and device | |
CN103323018A (en) | Time-interval-based feature identification and fast search method for hotspot path | |
CN109544998A (en) | A kind of flight time slot distribution Multipurpose Optimal Method based on Estimation of Distribution Algorithm | |
CN102737114B (en) | MapReduce-based big picture distance connection query method | |
Anwar et al. | Capturing the spatiotemporal evolution in road traffic networks | |
CN102880641B (en) | Parametric bus transfer method in consideration of short-distance walking station pair | |
CN108564163A (en) | A kind of improvement ant group algorithm solving multiple target multiple traveling salesmen problem | |
CN106845703B (en) | Urban road network time-varying K shortest path searching method considering steering delay | |
CN107766406A (en) | A kind of track similarity join querying method searched for using time priority | |
CN109840620A (en) | The querying method of k nearest neighbors pair in more attribute timing transportation networks | |
CN108733803A (en) | A kind of Multi-User Dimension keyword query method under road network | |
CN105740964A (en) | Urban road network data organization and shortest path rapid calculation method | |
CN106447097A (en) | Method for inquiring limited longest frequent path | |
CN111337047B (en) | Unstructured road macroscopic path planning method based on multi-task point constraint | |
CN109211242A (en) | A kind of three-dimensional space multi-goal path planing method merging RRT and ant group algorithm | |
CN103500165B (en) | A kind of combination cluster and the high-dimensional vector quantity search method of double key value | |
CN113808424B (en) | Method for acquiring K shortest paths of urban road network based on bidirectional Dijkstra | |
CN109540165B (en) | Heuristic search expressway network constraint routing algorithm | |
CN110095134A (en) | It is a kind of using the preference of user as the method and system of the path planning of core and navigation | |
CN109447312A (en) | Route planning method, device, electronic equipment and readable storage medium storing program for executing |
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 |