CN103365983B - Obtain level partition method and the system of the most farthest single neighbours on road network - Google Patents
Obtain level partition method and the system of the most farthest single neighbours on road network Download PDFInfo
- Publication number
- CN103365983B CN103365983B CN201310279130.9A CN201310279130A CN103365983B CN 103365983 B CN103365983 B CN 103365983B CN 201310279130 A CN201310279130 A CN 201310279130A CN 103365983 B CN103365983 B CN 103365983B
- Authority
- CN
- China
- Prior art keywords
- partition
- road network
- node
- sub
- nodes
- 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.)
- Expired - Fee Related
Links
- 238000005192 partition Methods 0.000 title claims abstract description 384
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000004364 calculation method Methods 0.000 claims description 32
- 238000000638 solvent extraction Methods 0.000 claims description 23
- 238000005516 engineering process Methods 0.000 claims description 12
- 230000007717 exclusion Effects 0.000 claims description 6
- 238000013316 zoning Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000002474 experimental method Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000007689 inspection Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 238000013138 pruning Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Navigation (AREA)
Abstract
本发明提供了一种获取路网上单反向最远邻居的层次分区树方法及系统,包括:将层次分区树的所有分区压入一遍历队列,从所述遍历队列依次弹出每个分区或子分区SGi,判断每个子分区SGi,是否使得若是,则SGi中的结点将该子分区从队列中排除,若否,将该未排除的子分区的子分区SGi或无子分区的子分区自身压入所述遍历队列,从所述遍历队列依次弹出每个子分区的子分区SGi,并重复上述判断,直至从所述遍历队列里只剩下无子分区的分区或子分区,并检查每一个未排除的分区中的节点d∈P的最远邻居是不是q,如果是,则确定d为p,p∈MRFN(q,P)。本发明能够在路网上快速搜索到查询点的单反向邻居。
The present invention provides a hierarchical partition tree method and system for acquiring single reverse farthest neighbors on the road network, comprising: pushing all partitions of the hierarchical partition tree into a traversal queue, and popping up each partition or sub-partition in turn from the traversal queue SG i , judge whether each sub-partition SG i makes If so, then the nodes in SG i Exclude this sub-section from the queue, if not, push the sub-section SG i of the unexcluded sub-section or the sub-section without sub-section itself into the traversal queue, and pop up the traversal queue of each sub-section in turn from the traversal queue sub-partition SG i , and repeat the above judgment until only sub-partitions or sub-partitions without sub-partitions are left in the traversal queue, and check whether the farthest neighbor of node d∈P in each non-excluded partition is q , if yes, determine d to be p, p∈MRFN(q,P). The invention can quickly search for the single-reverse neighbors of the query point on the road network.
Description
技术领域technical field
本发明涉及一种获取路网上单反向最远邻居的层次分区方法及系统。The invention relates to a hierarchical partitioning method and system for obtaining single-reverse farthest neighbors on a road network.
背景技术Background technique
空间数据库(spaitial database)是指提供了空间数据类型(spatial databasetype,SDT)和相应实现支持的数据库(参见文献1:Güting R H.An introduction tospatial database systems[J].The VLDB Journal,1994,3(4):357-399)。随着移动计算与云计算的日益发展,空间相关算法的应用日益增多。距离查询(proximity query)包括最近邻居(Nearest Neighbor)查询、反向最近邻居(Reverse Nearest Neighbor)查询、反向最远邻居查询(Reverse Furthest Neighbor)等,是空间数据库查询中最常见的类型之一。本发明关注在路网(road network)数据库上的反向最远邻居(reverse furthestneighbor,RFN)查询,即给定一组路网上的数据集P与查询集Q,我们希望求取P中所有与Q相比距离q更远的点。该问题根据P与Q是否相同可划分为单反向最远邻与复反向最远邻问题。该问题在实践中拥有重大意义,例如在开设新的商店时,我们希望得知受某一竞争对手影响最小的点。如果我们将不同地点之间的影响程度以带权的边表示,这一问题就相当于在路网上求取以现有商户地点为查询点的单反向最远邻居问题。进一步说,寻找一个受现有的所有竞争对手相对影响最小的点,可以转化为目标点在这一路网上求以竞争对手地点为查询集Q的复反向最远邻居数量的最大化问题。A spatial database (spatial database) refers to a database that provides spatial data types (spatial databasetype, SDT) and corresponding implementation support (see literature 1: Güting R H. An introduction to spatial database systems [J]. The VLDB Journal, 1994, 3 (4):357-399). With the increasing development of mobile computing and cloud computing, the application of spatial correlation algorithms is increasing. Proximity query includes Nearest Neighbor query, Reverse Nearest Neighbor query, Reverse Furthest Neighbor query, etc. It is one of the most common types of spatial database queries . The present invention focuses on the reverse furthest neighbor (RFN) query on the road network database, that is, given a set of data sets P and query sets Q on the road network, we hope to obtain all the Q is farther away than q. According to whether P and Q are the same, the problem can be divided into single reverse farthest neighbor problem and multiple reverse farthest neighbor problem. This problem has great practical significance, for example, when opening a new store, we want to know the point that is least affected by a certain competitor. If we represent the degree of influence between different locations as weighted edges, this problem is equivalent to the single-reverse farthest neighbor problem on the road network with the existing merchant location as the query point. Furthermore, finding a point that is relatively least affected by all existing competitors can be transformed into a problem of maximizing the number of complex reverse farthest neighbors of the target point on this road network with the competitor's location as the query set Q.
据我们所知,目前对于路网上单反向最远邻问题所提出的唯一解决方案是Tran等人对于路网上反向最远邻的研究,他们以路网中的每一个兴趣点为生成点预处理建立Voronoi分区,然后使用分区的邻接性质对分区进行遍历,以枚举查询点可能的反向最远邻居(reverse furthest neighbor)。但这一方法在路网中兴趣点数量大时,将与暴力算法没有本质区别。而对于复反向最远邻问题目前尚无有关解决方案。As far as we know, the only solution to the single reverse furthest neighbor problem on the road network is Tran et al.’s research on the reverse furthest neighbor on the road network. The process establishes a Voronoi partition, and then traverses the partition using the adjacency property of the partition to enumerate the possible reverse furthest neighbors of the query point. However, when the number of interest points in the road network is large, this method will not be substantially different from the brute force algorithm. However, there is no solution to the complex inverse furthest neighbor problem.
在其他相关研究方面,最引人注意的是最近邻居(nearest neighbor)问题(参见文献2,文献3:Hjaltason G R,Samet H.Distance browsing in spatial databases[J].ACM Transactions on Database Systems(TODS),1999,24(2):265-318,文献4:Berchtold S,C,Keim D A,etc.A cost model for nearest neighbor search inhigh-dimensional data space[A].In Proceedings of the sixteenth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems[C],1997:78-86,文献5,文献6:Jagadish H,Ooi B C,Tan K-L,etc.iDistance:An adaptive B+-tree basedindexing method for nearest neighbor search[J].ACM Transactions on DatabaseSystems(TODS),2005,30(2):364-397,文献7 :Tao Y,Papadias D,Shen Q.Continuousnearest neighbor search[A].In Proceedings of the 28th internationalconference on Very Large Data Bases[C],2002:287-29)与反向最近邻居(参见文献8:Korn F,Muthukrishnan S.Influence sets based on reverse nearest neighborqueries[J].ACM SIGMOD Record,2000,29(2):201-212,文献9:Singh A,FerhatosmanogluH,Tosun AHigh dimensional reverse nearest neighbor queries[A].InProceedings of the twelfth international conference on Information andknowledge management[C],2003:91-98,文献10:Tao Y,Papadias D,Lian X.Reverse kNNsearch in arbitrary dimensionality[A].In Proceedings of the Thirtiethinternational conference on Very large data bases-Volume 30[C],2004:744-755,文献11:Achtert E,C,P,etc.Efficient reverse k-nearest neighborsearch in arbitrary metric spaces[A].In Proceedings of the 2006ACM SIGMODinternational conference on Management of data[C],2006:515-526,文献12:Sankaranarayanan J,Samet H.Distance oracles for spatial networks[A].In DataEngineering,2009.ICDE'09.IEEE 25th International Conference on[C],2009:652-663)问题。以R-Tree(参见文献13:Guttman A.R-trees:a dynamic index structure forspatial searching[M].ACM,1984)为基础的深度(参见文献2:Roussopoulos N,Kelley S,Vincent F.Nearest neighbor queries[A].In 1995:71-79)与广度(参见文献5:Cui B,Ooi B C,Su J,etc.Contorting high dimensional data for efficient main memoryKNN processing[A].In Proceedings of the 2003ACM SIGMOD internationalconference on Management of data[C],2003:479-490)优先搜索、增量欧氏限制(Incremental Euclidean Restriction)、增量网络扩展(Invremental NetworkExpansion,参见文献14:Papadias D,Zhang J,Mamoulis N,etc.Query processing inspatial network databases[A].In 2003:802-813)与Voronoi图相关的技术(参见文献8~12)被广泛用于解决欧氏空间(Euclidean space)与路网上的相应问题,但由于反向最远邻居问题不具有最近邻居问题所具有的本地性特点,这些解决方案难以应用在本发明所解决的问题上。In terms of other related research, the most notable one is the nearest neighbor problem (see Document 2, Document 3: Hjaltason GR, Samet H. Distance browsing in spatial databases [J]. ACM Transactions on Database Systems (TODS) ,1999,24(2):265-318, Literature 4: Berchtold S, C, Keim DA, etc. A cost model for nearest neighbor search inhigh-dimensional data space [A]. In Proceedings of the sixteenth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems [C], 1997:78-86, Document 5, Document 6: Jagadish H, Ooi BC, Tan KL, etc. iDistance: An adaptive B+-tree based indexing method for nearest neighbor search [J]. ACM Transactions on DatabaseSystems (TODS), 2005,30(2):364 -397, Literature 7: Tao Y, Papadias D, Shen Q.Continuous nearest neighbor search[A].In Proceedings of the 28th international conference on Very Large Data Bases[C],2002:287-29) and reverse nearest neighbor (see Literature 8: Korn F, Muthukrishnan S. Influence sets based on reverse nearest neighbors[J]. ACM SIGMOD Record, 2000, 29(2): 201-212, Literature 9: Singh A, FerhatosmanogluH, Tosun A High dimensional reverse nearest neighbor queries[A].InProceedings of the twelfth international conference on Information and knowledge management[C],2003:91-98, Literature 10:Tao Y,Papadias D,Lian X.Reverse kNNsearch in arbitrary dimensionality[A] .In Proceedings of the Thirtiethinternational conference on Very large data bases-Volume 30[C],2004:744-755, Literature 11: Achtert E, C, P,etc.Efficient reverse k-nearest neighborsearch in arbitrary metric spaces[A].In Proceedings of the 2006ACM SIGMOD international conference on Management of data[C],2006:515-526, Literature 12: Sankaranarayanan J, Samet H.Distance oracles for spatial networks[A].In DataEngineering,2009.ICDE'09.IEEE 25th International Conference on[C],2009:652-663) problem. Depth based on R-Tree (see literature 13: Guttman AR-trees: a dynamic index structure for spatial searching [M]. ACM, 1984) (see literature 2: Roussopoulos N, Kelley S, Vincent F.Nearest neighbor queries[ A].In 1995:71-79) and breadth (see literature 5: Cui B,Ooi BC,Su J,etc.Contorting high dimensional data for efficient main memoryKNN processing[A].In Proceedings of the 2003ACM SIGMOD international conference on Management of data[C],2003:479-490) priority search, incremental Euclidean Restriction (Incremental Euclidean Restriction), incremental network expansion (Invremental Network Expansion, see literature 14: Papadias D, Zhang J, Mamoulis N, etc.Query processing inspatial network databases[A].In 2003:802-813) technology related to Voronoi diagram (refer to literature 8~12) is widely used to solve the corresponding problems of Euclidean space (Euclidean space) and road network, but due to the reverse The farthest neighbor problem does not have the local characteristics of the nearest neighbor problem, and these solutions are difficult to apply to the problem solved by the present invention.
欧氏空间上的最远邻居问题由Yao等人加以描述(参见文献15:Yao B,Li F,KumarP.Reverse furthest neighbors in spatial databases[A].In 2009:664-675)。他们提出了递进最远区(progressive furthest cell,PFC)算法与凸包最远区(convex hullfurthest cell)算法以处理该问题。上述算法均基于最远Voronoi去的概念来确定某一点是否是查询点q的反向最远邻居。给定某一查询点q,它关于某个数据集Q的最远voronoi区fvc(q,Q)是一个多边形区域,该区域内的所有点都是q的反向最远邻居。PFC算法使用R-Tree索引,不断取数据点构建垂直平分线讲解空间分割并取较远的一侧来求取这一区域。而CHFC算法则利用凸包的性质对这一算法进行剪枝:如果q在查询集Q的凸包内,则问题一定无解,否则亦可以将搜索范围限制在Q与查询点q的凸包之内。Liu等人使用枢轴点和索引对这一算法进行了改进(参见文献16:Liu J,Chen H,Furuse K,etc.An efficientalgorithm for reverse furthest neighbors query with metric index[A].InDatabase and Expert Systems Applications[C],2010:437-451,文献17:JianquanL.Efficient query processing for distance-based similarity search[J].2012)。但由于路网上的点与R-Tree索引无直接关系,也没有严格定义的凸包,这些方法均无法直接应用于本发明所解决的问题。The furthest neighbor problem in Euclidean space is described by Yao et al. (see literature 15: Yao B, Li F, Kumar P. Reverse furthest neighbors in spatial databases [A]. In 2009: 664-675). They proposed a progressive furthest cell (PFC) algorithm and a convex hull furthest cell algorithm to deal with this problem. The above algorithms are all based on the concept of the farthest Voronoi go to determine whether a point is the reverse farthest neighbor of the query point q. Given a certain query point q, its farthest Voronoi region fvc(q,Q) with respect to a certain data set Q is a polygonal region, and all points in this region are the reverse farthest neighbors of q. The PFC algorithm uses the R-Tree index to continuously take data points to build a vertical bisector to explain space segmentation and take the far side to find this area. The CHFC algorithm uses the nature of the convex hull to prune this algorithm: if q is in the convex hull of the query set Q, the problem must be unsolvable, otherwise the search range can be limited to the convex hull of Q and the query point q within. Liu et al. improved this algorithm using pivot points and indexes (see literature 16: Liu J, Chen H, Furuse K, etc. An efficient algorithm for reverse furthest neighbors query with metric index[A].InDatabase and Expert Systems Applications[C], 2010:437-451, Literature 17: JianquanL. Efficient query processing for distance-based similarity search[J].2012). However, since the points on the road network have no direct relationship with the R-Tree index, and there is no strictly defined convex hull, these methods cannot be directly applied to the problems solved by the present invention.
相关的其它参考文献还包括:Other relevant references include:
文献18:Goldberg A V,Harrelson C.Computing the shortest path:A searchmeets graph theory[A].In Proceedings of the sixteenth annual ACM-SIAMsymposium on Discrete algorithms[C],2005:156-165;Literature 18: Goldberg A V, Harrelson C. Computing the shortest path: A searchmeets graph theory [A]. In Proceedings of the sixteenth annual ACM-SIAMsymposium on Discrete algorithms [C], 2005:156-165;
文献19:Jing N,Huang Y-W,Rundensteiner E A.Hierarchical encoded pathviews for path query processing:An optimal model and its performanceevaluation[J].Knowledge and Data Engineering,IEEE Transactions on,1998,10(3):409-432;Literature 19: Jing N, Huang Y-W, Rundensteiner E A. Hierarchical encoded pathviews for path query processing: An optimal model and its performance evaluation [J]. Knowledge and Data Engineering, IEEE Transactions on, 1998, 10(3): 409-432 ;
文献20:Erwig M,Hagen F.The graph Voronoi diagram with applications[J].Networks,2000,36(3):156-163;Literature 20: Erwig M, Hagen F. The graph Voronoi diagram with applications [J]. Networks, 2000, 36(3): 156-163;
文献21:Jung S,Pramanik S.An efficient path computation model forhierarchically structured topographical road maps[J].Knowledge and DataEngineering,IEEE Transactions on,2002,14(5):1029-1046;Document 21: Jung S, Pramanik S. An efficient path computation model for hierarchically structured topographical road maps [J]. Knowledge and Data Engineering, IEEE Transactions on, 2002, 14(5): 1029-1046;
文献22:Aurenhammer F.Voronoi diagrams—a survey of a fundamentalgeometric data structure[J].ACM Computing Surveys(CSUR),1991,23(3):345-405。Document 22: Aurenhammer F.Voronoi diagrams—a survey of a fundamentalgeometric data structure[J].ACM Computing Surveys(CSUR),1991,23(3):345-405.
发明内容Contents of the invention
本发明的目的在于提供一种获取路网上单反向最远邻居的层次分区方法及系统,能够在路网上快速搜索到查询点的单反向邻居。The purpose of the present invention is to provide a hierarchical partitioning method and system for obtaining single-reverse farthest neighbors on the road network, which can quickly search for the single-reverse neighbors of the query point on the road network.
为解决上述问题,本发明提供一种获取路网上单反向最远邻居的层次分区方法,包括:In order to solve the above-mentioned problems, the present invention provides a hierarchical partitioning method for obtaining the single reverse farthest neighbor on the road network, including:
步骤一:对于给定路网G上的某一结点p和路网G上的所有结点VG,如果路网G上存在结点q,q与p的路网距离||q-p||不小于p到VG当中任何点p’的距离||p′-p||,则定义q为p相对于VG的最远邻居,记为fn(p,VG);Step 1: For a given node p on the road network G and all nodes V G on the road network G, if there is a node q on the road network G, the road network distance between q and p ||qp|| is not less than the distance ||p′-p|| from p to any point p’ in V G , then define q as the furthest neighbor of p relative to V G , denoted as fn(p, V G );
步骤二:对于给定路网G上的所有结点VG,定义q的单反向最远邻居是VG中以q作为最远邻居点的集合即MRFN(q,VG)={p|p∈VG,fn(p,VG∪{q})=q};Step 2: For all nodes V G on a given road network G, define the single-reverse farthest neighbor of q to be the set of q as the farthest neighbor point in V G , that is, MRFN(q, V G )={p| p∈V G , fn(p,V G ∪{q})=q};
步骤三:使用自顶向下的方法构造路网G的层次分区树,路网G中的结点划分为m个分区SGi,并且将每个分区递归的划分为若干个子分区SGi,直至达到所需的分区数量与层数;Step 3: Use the top-down method to construct the hierarchical partition tree of the road network G. The nodes in the road network G are divided into m partitions SG i , and each partition is recursively divided into several sub-partitions SG i until Reach the required number of partitions and layers;
步骤四:定义路网G上每一个分区或子分区SGi的边界结点为其中edge(d,d′)表示d与d′之间的边,表示分区SGi的所有结点;Step 4: Define the boundary nodes of each subdivision or subdivision SG i on the road network G as Where edge(d,d') represents the edge between d and d', Represents all nodes of the partition SG i ;
步骤五:将某结点q到某分区或子分区SGi的上界和下界分别定义为q到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点q到结点d的上界和下界分别为和 Step 5: Define the upper and lower bounds from a node q to a partition or sub-partition SG i as q to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node q to node d are defined as and
步骤六:将某分区或子分区SGi的最远上界和最远下界分别定义为任意到它在路网G上最远邻居的距离最大值和最小值,记为和类似的定义一个结点u到它路网G上最远邻居的距离为fubu和flbu;Step 6: Define the farthest upper bound and farthest lower bound of a partition or sub-partition SG i as arbitrary The maximum and minimum distances to its furthest neighbors on the road network G are denoted as and Similarly define the distance from a node u to its furthest neighbor on the road network G as fub u and flb u ;
步骤七:预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;Step 7: Pre-calculate the distance between the border nodes of the sub-partition SG i in a certain partition SG i , and pre-calculate the respective farthest neighbors f of all border nodes on the road network G and the respective partitions and sub-partitions of all border nodes the furthest neighbor within SG i ;
步骤八:选择所述路网的多个结点L作为地标,使用Dijkstra算法预计算每个结点L到剩下无子分区的分区或子分区上所有结点的距离;Step 8: select a plurality of nodes L of the road network as landmarks, and use the Dijkstra algorithm to pre-calculate the distance from each node L to the remaining sub-divisions or all nodes on the sub-divisions;
步骤九:估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于
步骤十:将层次分区树的所有分区压入一遍历队列,从所述遍历队列依次弹出每个分区或子分区SGi,判断每个子分区SGi,是否使得若是,则SGi中的结点将该子分区从路网G上排除,若否,将该未排除的子分区的子分区SGi或无子分区的子分区自身压入所述遍历队列,从所述遍历队列依次弹出每个子分区的子分区SGi,并重复上述判断,直至从所述遍历队列里只剩下无子分区的分区或子分区,其中,计算的步骤如下,当且时,则当时,由于任何从q通往SGi的路径必须经过SGi的边界结点使用q到的上界来估计则其中,的使用三角不等式估计,的定义同 是从所述预计算的所有边界结点的距离和各自在所在分区和子分区SGi内的最远邻居中获取;Step 10: Push all the partitions of the hierarchical partition tree into a traversal queue, pop up each partition or sub-partition SG i from the traversal queue in turn, and judge whether each sub-partition SG i makes If so, then the nodes in SG i Exclude this subdivision from the road network G, if not, push the subdivision SG i of the unexcluded subdivision or the subdivision without subdivision itself into the traversal queue, pop each subdivision sequentially from the traversal queue Sub-partition SG i of the partition, and repeat the above judgment until there are only partitions or sub-partitions without sub-partitions left in the traversal queue, wherein, the calculation The steps are as follows, when and when when , since any path from q to SG i must pass through the border nodes of SG i Use q to to estimate the upper bound of but in, is estimated using the triangle inequality, The definition is the same as is obtained from the distances of all the boundary nodes in the pre-calculation and the farthest neighbors in the respective partitions and sub-partitions SG i ;
步骤十一:对于每一个所述剩下无子分区的分区或子分区上的结点d,使用三角不等式检查距离||d-q||是否一定小于d到距离d最远地标的距离||d-f||,若结点L中存在地标u和f,使得||d-u||+||u-q||<||d-f||,则q一定不是d的最远邻居,从而d一定不是q的反向最远邻居,将该结点d从所述剩下无子分区的分区或子分区上排除;Step 11: For each sub-partition or node d on the sub-partition, use the triangle inequality to check whether the distance ||d-q|| must be less than the distance from d to the farthest landmark from d ||d-f ||, if there are landmarks u and f in the node L, so that ||d-u||+||u-q||<||d-f||, then q must not be the farthest neighbor of d, so d must not be the opposite of q To the farthest neighbor, exclude the node d from the remaining partitions or subpartitions without subpartitions;
步骤十二:检查每一个未排除的d∈VG的最远邻居是不是q,如果是,则确定d为p,p∈MRFN(q,VG),如果不是,则将该d排除。Step 12: Check whether the furthest neighbor of each unexcluded d∈V G is q, if yes, determine d to be p, p∈MRFN(q, V G ), if not, exclude d.
进一步的,在上述方法中,步骤八中,所述选择的地标在路网G上均匀分布。Further, in the above method, in step eight, the selected landmarks are evenly distributed on the road network G.
进一步的,在上述方法中,步骤三中将每个分区递归的划分为若干个子分区SGi的步骤中,使用Erwig and Hagen算法将每个分区递归的划分为若干个子分区SGi。Further, in the above method, in the step of recursively dividing each partition into several sub-partitions SG i in step 3, each partition is recursively divided into several sub-partitions SG i using the Erwig and Hagen algorithm.
进一步的,在上述方法中,所述步骤十二包括:Further, in the above method, said step 12 includes:
步骤十二一:将某结点d到某分区或子分区SGi的上界和下界分别定义为d到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点d到结点d′的上界和下界分别为和 Step twelve one: define the upper bound and the lower bound of a certain node d to a certain partition or sub-partition SG i as d to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node d to node d′ are defined as and
步骤十二二:当且时,则当时,由于任何从d通往SGi的路径必须经过SGi的边界结点使用d到的上界来估计则其中,可以使用三角不等式估计,而是从所述预计算的所有边界结点各自在所在分区和子分区SGi内的最远邻居中获取,的定义同 Step twelve two: when and when when , since any path from d to SG i must pass through the border nodes of SG i use d to to estimate the upper bound of but in, can be estimated using the triangle inequality, while is obtained from the farthest neighbors of all the pre-calculated boundary nodes in their respective partitions and sub-partitions SG i , The definition is the same as
步骤十二三:建立一个将分区SGi和结点d′的和以降序存储的优先队列,并将所有分区的压入队列中;Step 123: Establish a partition SG i and node d' and A priority queue stored in descending order, and all partitioned push into the queue;
步骤十二四:每次从所述优先队列里弹出第一个或如果弹出的是则转到步骤直十二六,如果弹出的是如果则d的最远邻居不可能是在SGi中,将该分区SGi从路网G上排除,否则,则判断该分区SGi是否有子分区,若有,则将该分区SGi的子分区的以降序压回所述优先队列,若无,则调用步骤十二五;Step 124: each time the first one is popped up from the priority queue or If the popup is Then go to step 126, if the pop-up is if Then the farthest neighbor of d cannot be in SG i , and exclude this partition SG i from the road network G ; Partitioned Push back the priority queue in descending order, if none, then call step 12;
步骤十二五:计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离并将所有以降序压回所述优先队列,并调用步骤十二六;Step twelve five: calculate each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i and put all Push back the priority queue in descending order, and call step 126;
步骤十二六:从所述优先队列从弹出前几个将该前几个对应的d′确定为q,q∈fn(p,VG)。Step twelve six: Pop the first few from the priority queue put the first few The corresponding d' is determined as q, q∈fn(p, V G ).
进一步的,在上述方法中,步骤十二五中计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离的步骤包括:Further, in the above method, each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i The steps include:
若以d为源点进行一次Dijkstra算法以获得d到该分区或子分区SGi中的所有结点d′的距离 like Perform a Dijkstra algorithm with d as the source point to obtain the distance from d to all nodes d' in the partition or subpartition SG i
若由于任何从d到的路径都必然经过该分区或子分区SGi的边界节点构造一个保留d和间距离的捷径子图G′,并在所述捷径子图G′上进行距离计算得到d到该分区或子分区SGi中的所有结点d′的距离 like due to anything from d to All paths must pass through the boundary nodes of the partition or subpartition SG i Construct a retaining d and The shortcut subgraph G' of the distance between them, and the distance calculation is performed on the shortcut subgraph G' to obtain the distance from d to all nodes d' in the partition or subpartition SG i
进一步的,在上述方法中,构造一个保留d和间距离的捷径子图G′的步骤中,使用HEPV和HiTi技术。Further, in the above method, construct a reserved d and In the step of the short-cut subgraph G′ of the distance between two steps, HEPV and HiTi technologies are used.
进一步的,在上述方法中,构造一个保留d和边界节点间距离的捷径子图G′的步骤中,预先保存所有边界节点之间的距离,使用d所在的分区SGi和预先保存的两个分区边界节点之间的距离构造捷径子图G′。Further, in the above method, construct a reserved d and boundary nodes In the step of the short-cut subgraph G′ of the inter-distance, all boundary nodes are pre-saved Use the partition SG i where d is located and the pre-saved distance between the two partition boundary nodes to construct a shortcut subgraph G′.
根据本发明的另一面,提供一种获取路网上单反向最远邻居的层次分区系统,包括:According to another aspect of the present invention, there is provided a hierarchical partitioning system for acquiring single reverse farthest neighbors on a road network, including:
第一定义模块,用于对于给定路网G上的某一结点p和路网G上的所有结点VG,如果路网G上存在结点q,q与p的路网距离||q-p||不小于p到VG当中任何点p’的距离||p′-p||,则定义q为p相对于VG的最远邻居,记为fn(p,VG);The first definition module is used for a given node p on the road network G and all nodes V G on the road network G, if there is a node q on the road network G, the road network distance between q and p| |qp||is not less than the distance from p to any point p' in V G ||p′-p||, then define q as the furthest neighbor of p relative to V G , and denote it as fn(p, V G );
第二定义模块,对于给定路网G上的所有结点VG,定义q的单反向最远邻居是VG中以q作为最远邻居点的集合即MRFN(q,VG)={p|p∈VG,fn(p,VG∪{q})=q};The second definition module, for all nodes V G on the given road network G, the single-reverse farthest neighbor of q is defined as the set of q as the farthest neighbor point in V G , that is, MRFN(q, V G )={ p|p∈V G , fn(p,V G ∪{q})=q};
层次分区模块,用于使用自顶向下的方法构造路网G的层次分区树,路网G中的结点划分为m个分区SGi,并且将每个分区递归的划分为若干个子分区SGi,直至达到所需的分区数量与层数;The hierarchical partition module is used to construct a hierarchical partition tree of the road network G using a top-down method. The nodes in the road network G are divided into m partitions SG i , and each partition is recursively divided into several sub-partitions SG i , until the required number of partitions and layers is reached;
边界结点模块,用于定义路网G上每一个分区或子分区SGi的边界结点为其中edge(d,d′)表示d与d′之间的边,表示分区SGi的所有结点;The boundary node module is used to define the boundary node of each subdivision or subdivision SGi on the road network G as Where edge(d,d') represents the edge between d and d', Represents all nodes of the partition SG i ;
第一上下界模块,用于将某结点q到某分区或子分区SGi的上界和下界分别定义为q到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点q到结点d的上界和下界分别为和 The first upper and lower bound module is used to define the upper bound and lower bound from a certain node q to a certain partition or sub-partition SG i as q to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node q to node d are defined as and
第二上下界模块,用于将某分区或子分区SGi的最远上界和最远下界分别定义为任意到它在路网G上最远邻居的距离最大值和最小值,记为和类似的定义一个结点u到它路网G上最远邻居的距离为fubu和flbu;The second upper and lower bound module is used to define the farthest upper bound and the farthest lower bound of a partition or sub-partition SG i as arbitrary The maximum and minimum distances to its furthest neighbors on the road network G are denoted as and Similarly define the distance from a node u to its furthest neighbor on the road network G as fub u and flb u ;
预计算模块,用于预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;The pre-calculation module is used to pre-calculate the distance between the boundary nodes of the sub-division SG i in a certain sub-division SG i , and pre-calculate the respective farthest neighbors f of all boundary nodes on the road network G and the respective locations of all boundary nodes the furthest neighbors within the partition and subpartition SG i ;
距离模块,用于选择所述路网上的多个结点L作为地标,使用Dijkstra算法预计算每个结点L到剩下无子分区的分区或子分区上所有结点的距离;The distance module is used to select a plurality of nodes L on the road network as landmarks, and uses the Dijkstra algorithm to pre-calculate the distance from each node L to the remaining partitions without sub-regions or all nodes on the sub-regions;
估计模块,用于估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于
队列模块,将层次分区树的所有分区压入一遍历队列,从所述遍历队列依次弹出每个分区或子分区SGi,判断每个子分区SGi,是否使得若是,则SGi中的结点将该子分区从路网G上排除,若否,将该未排除的子分区的子分区SGi或无子分区的子分区自身压入所述遍历队列,从所述遍历队列依次弹出每个子分区的子分区SGi,并重复上述判断,直至从所述遍历队列里只剩下无子分区的分区或子分区,其中,计算的步骤如下,当且时,则当时,由于任何从q通往SGi的路径必须经过SGi的边界结点使用q到的上界来估计则其中,的使用三角不等式估计,的定义同 是从所述预计算的所有边界结点的距离和各自在所在分区和子分区SGi内的最远邻居中获取;The queue module pushes all partitions of the hierarchical partition tree into a traversal queue, pops up each partition or sub-partition SG i from the traversal queue in turn, and judges whether each sub-partition SG i makes If so, then the nodes in SG i Exclude this subdivision from the road network G, if not, push the subdivision SG i of the unexcluded subdivision or the subdivision without subdivision itself into the traversal queue, pop each subdivision sequentially from the traversal queue Sub-partition SG i of the partition, and repeat the above judgment until there are only partitions or sub-partitions without sub-partitions left in the traversal queue, wherein, the calculation The steps are as follows, when and when when , since any path from q to SG i must pass through the border nodes of SG i Use q to to estimate the upper bound of but in, is estimated using the triangle inequality, The definition is the same as is obtained from the distances of all the boundary nodes in the pre-calculation and the farthest neighbors in the respective partitions and sub-partitions SG i ;
结点排除模块,用于对于每一个所述剩下无子分区的分区或子分区上的结点d,使用三角不等式检查距离||d-q||是否一定小于d到距离d最远地标的距离||d-f||,若结点L中存在地标u和f,使得||d-u||+||u-q||<||d-f||,则q一定不是d的最远邻居,从而d一定不是q的反向最远邻居,将该结点d从所述剩下无子分区的分区或子分区上排除;The node exclusion module is used to check whether the distance ||d-q|| must be less than the distance from d to the farthest landmark from d for each of the remaining partitions without sub-partitions or node d on the sub-partition. ||d-f||, if there are landmarks u and f in the node L, so that ||d-u||+||u-q||<||d-f||, then q must not be the farthest neighbor of d, so d must not The reverse farthest neighbor of q excludes the node d from the remaining partition or subpartition without subpartitions;
检查模块,用于检查每一个未排除的d∈VG的最远邻居是不是q,如果是,则确定d为p,p∈MRFN(q,VG),如果不是,则将该d排除。The checking module is used to check whether the furthest neighbor of each unexcluded d ∈ V G is q, if yes, then determine d to be p, p ∈ MRFN(q, V G ), if not, then d is excluded .
进一步的,在上述系统中,所述距离模块选择的地标在路网G上均匀分布。Further, in the above system, the landmarks selected by the distance module are evenly distributed on the road network G.
进一步的,在上述系统中,所述层次分区模块使用Erwig and Hagen算法将每个分区递归的划分为若干个子分区SGi。Further, in the above system, the hierarchical partitioning module uses the Erwig and Hagen algorithm to recursively divide each partition into several sub-partitions SG i .
进一步的,在上述系统中,所述检查模块包括:Further, in the above system, the inspection module includes:
第一上下界单元,用于将某结点d到某分区或子分区SGi的上界和下界分别定义为d到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点d到结点d′的上界和下界分别为和 The first upper and lower bound unit is used to define the upper bound and lower bound from a certain node d to a certain partition or sub-partition SG i as d to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node d to node d′ are defined as and
估计单元,用于当且时,则当时,由于任何从d通往SGi的路径必须经过SGi的边界结点使用d到的上界来估计则其中,可以使用三角不等式估计,而是从所述预计算的所有边界结点各自在所在分区和子分区SGi内的最远邻居中获取,的定义同 Estimation unit, used when and when when , since any path from d to SG i must pass through the border nodes of SG i use d to to estimate the upper bound of but in, can be estimated using the triangle inequality, while is obtained from the farthest neighbors of all the pre-calculated boundary nodes in their respective partitions and sub-partitions SG i , The definition is the same as
队列单元,用于建立一个将分区SGi和结点d′的和以降序存储的优先队列,并将所有分区的压入队列中;Queue unit, used to establish a partition SG i and node d' and A priority queue stored in descending order, and all partitioned push into the queue;
分区排除单元,用于每次从所述优先队列里弹出第一个或如果弹出的是则调用最远邻居单元,如果弹出的是如果则d的最远邻居不可能是在SGi中,将该分区SGi从路网G上排除,否则,则判断该分区SGi是否有子分区,若有,则将该分区SGi的子分区的以降序压回所述优先队列,若无,则调用计算单元;The partition exclusion unit is used to pop the first one from the priority queue each time or If the popup is Then call the farthest neighbor unit, if the pop-up is if Then the farthest neighbor of d cannot be in SG i , and exclude this partition SG i from the road network G ; Partitioned Push back the priority queue in descending order, if none, call the computing unit;
计算单元,用于计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离并将所有以降序压回所述优先队列,并调用最远邻居单元;Computing unit for computing each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i and put all Depress the priority queue in descending order and call the furthest neighbor unit;
最远邻居单元,用于从所述优先队列从弹出前几个将该前几个对应的d′确定为q,q∈fn(p,VG)。furthest neighbor unit for popping the first few from the priority queue from put the first few The corresponding d' is determined as q, q∈fn(p, V G ).
进一步的,在上述系统中,所述计算单元,用于:Further, in the above system, the computing unit is used for:
若以d为源点进行一次Dijkstra算法以获得d到该分区或子分区SGi中的所有结点d′的距离 like Perform a Dijkstra algorithm with d as the source point to obtain the distance from d to all nodes d' in the partition or subpartition SG i
若由于任何从d到的路径都必然经过该分区或子分区SGi的边界节点构造一个保留d和间距离的捷径子图G′,并在所述捷径子图G′上进行距离计算得到d到该分区或子分区SGi中的所有结点d′的距离 like due to anything from d to All paths must pass through the boundary nodes of the partition or subpartition SG i Construct a retaining d and The shortcut subgraph G' of the distance between them, and the distance calculation is performed on the shortcut subgraph G' to obtain the distance from d to all nodes d' in the partition or subpartition SG i
进一步的,在上述系统中,所述计算单元使用HEPV和HiTi技术构造一个保留d和间距离的捷径子图G′。Further, in the above system, the calculation unit uses HEPV and HiTi technology to construct a reserved d and The short-cut subgraph G′ of the distance between
进一步的,在上述系统中,所述计算单元预先保存所有边界节点之间的距离,使用d所在的分区SGi和预先保存的两个分区边界节点之间的距离构造捷径子图G′。Further, in the above system, the calculation unit pre-saves all boundary nodes Use the partition SG i where d is located and the pre-saved distance between the two partition boundary nodes to construct a shortcut subgraph G′.
与现有技术相比,本发明通过预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于有
附图说明Description of drawings
图1是本发明一实施例的单反向最远邻居问题MRFN示例图;Fig. 1 is a single reverse farthest neighbor problem MRFN example diagram of an embodiment of the present invention;
图2是本发明一实施例的HP树的划分实例;Fig. 2 is the division example of the HP tree of an embodiment of the present invention;
图3是本发明一实施例的与图3对应的HP树结构;Fig. 3 is the HP tree structure corresponding to Fig. 3 of an embodiment of the present invention;
图4是本发明一实施例的CA数据库上HP算法的性能;Fig. 4 is the performance of the HP algorithm on the CA database of an embodiment of the present invention;
图5是本发明一实施例的SF数据库上HP算法的性能。Fig. 5 is the performance of the HP algorithm on the SF database according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
实施例一Embodiment one
本发明提供一种获取路网上单反向最远邻居的层次分区(HierarchicalPartition,HP)方法,包括步骤一至步骤十二。The present invention provides a hierarchical partition (Hierarchical Partition, HP) method for acquiring single reverse farthest neighbors on a road network, including step 1 to step 12.
步骤一:对于给定路网G上的某一结点p和路网G上的所有结点VG,如果路网G上存在结点q,q与p的路网距离||q-p||不小于p到VG当中任何点p’的距离||p′-p||,则定义q为p相对于VG的最远邻居,记为fn(p,VG);Step 1: For a given node p on the road network G and all nodes VG on the road network G, if there is a node q on the road network G, the road network distance between q and p ||qp|| is less than the distance ||p′-p|| from p to any point p’ in V G , then define q as the furthest neighbor of p relative to V G , denoted as fn(p, V G );
步骤二:对于给定路网G上的所有结点VG,定义q的单反向最远邻居是VG中以q作为最远邻居点的集合即MRFN(q,VG)={p|p∈VG,fn(p,VG∪{q})=q};具体的,如图1所示,p1是p7的最远邻居,所以p7是p1的反向最远邻居之一。该问题在实践中拥有重大意义,例如在开设新的商店时,我们希望得知受某一竞争对手影响最小的点。如果我们将不同地点之间的影响程度以带权的边表示,这一问题就相当于在路网上求取以现有商户地点为查询点的但反向最远邻居问题。进一步说,寻找一个受现有的所有竞争对手相对影响最小的点,可以转化为目标点在这一路网上求以竞争对手地点为兴趣集Q的复反向最远邻居数量的最大化问题。本发明旨在使用相关技术有效的计算路网上的反向最远邻居(Reverse FurthestNeighbor)问题。Step 2: For all nodes VG on the given road network G, define the single-reverse farthest neighbor of q as the set of q as the farthest neighbor point in VG, that is, MRFN(q, V G )={p|p∈ V G ,fn(p,V G ∪{q})=q}; Specifically, as shown in Figure 1, p 1 is the farthest neighbor of p 7 , so p 7 is one of the reverse farthest neighbors of p 1 one. This problem has great practical significance, for example, when opening a new store, we want to know the point that is least affected by a certain competitor. If we represent the degree of influence between different locations as weighted edges, this problem is equivalent to finding the reverse farthest neighbor problem on the road network with the existing merchant location as the query point. Furthermore, finding a point that is relatively least affected by all existing competitors can be transformed into a problem of maximizing the number of complex reverse farthest neighbors of the target point on this road network with the competitor's location as the interest set Q. The present invention aims to effectively calculate the reverse furthest neighbor (Reverse Farthest Neighbor) problem on the road network by using the relevant technology.
步骤三:使用自顶向下的方法构造路网G的层次分区树即HP树,路网G中的结点划分为m个分区SGi,并且将每个分区递归的划分为若干个子分区SGi,直至达到所需的分区数量与层数;Step 3: Use the top-down method to construct the hierarchical partition tree of the road network G, that is, the HP tree. The nodes in the road network G are divided into m partitions SG i , and each partition is recursively divided into several sub-partitions SG i , until the required number of partitions and layers is reached;
优选的,步骤三中将每个分区递归的划分为若干个子分区SGi的步骤中,使用Erwig and Hagen算法将每个分区递归的划分为若干个子分区SGi。Preferably, in the step of recursively dividing each partition into several sub-partitions SG i in step 3, each partition is recursively divided into several sub-partitions SG i using the Erwig and Hagen algorithm.
步骤四:定义路网G上每一个分区或子分区SGi的边界结点为其中edge(d,d′)表示d与d′之间的边,表示分区SGi的所有结点;Step 4: Define the boundary nodes of each subdivision or subdivision SG i on the road network G as Where edge(d,d') represents the edge between d and d', Represents all nodes of the partition SG i ;
步骤五:将某结点q到某分区或子分区SGi的上界和下界分别定义为q到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点q到结点d的上界和下界分别为和 Step 5: Define the upper and lower bounds from a node q to a partition or sub-partition SG i as q to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node q to node d are defined as and
步骤六:将某分区或子分区SGi的最远上界和最远下界分别定义为任意到它在路网G上最远邻居的距离最大值和最小值,记为和类似的定义一个结点u到它路网G上最远邻居的距离为fubu和flbu;Step 6: Define the farthest upper bound and farthest lower bound of a partition or sub-partition SG i as arbitrary The maximum and minimum distances to its furthest neighbors on the road network G are denoted as and Similarly define the distance from a node u to its furthest neighbor on the road network G as fub u and flb u ;
步骤七:预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;Step 7: Pre-calculate the distance between the border nodes of the sub-partition SG i in a certain partition SG i , and pre-calculate the respective farthest neighbors f of all border nodes on the road network G and the respective partitions and sub-partitions of all border nodes the furthest neighbor within SG i ;
步骤八:选择所述路网上的多个结点L作为地标,使用Dijkstra算法预计算每个结点L到所述剩下无子分区的分区或子分区上所有结点的距离;Step 8: select a plurality of nodes L on the road network as landmarks, and use the Dijkstra algorithm to pre-calculate the distances from each node L to the remaining sub-divisions or sub-divisions;
优选的,步骤八中,所述选择的地标在路网G上均匀分布。Preferably, in step eight, the selected landmarks are evenly distributed on the road network G.
步骤九:估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于
步骤十:将层次分区树的所有分区压入一遍历队列,从所述遍历队列依次弹出每个分区或子分区SGi,判断每个子分区SGi,是否使得若是,则SGi中的结点将该子分区从路网G上排除,若否,将该未排除的子分区的子分区SGi或无子分区的子分区自身压入所述遍历队列,从所述遍历队列依次弹出每个子分区的子分区SGi,并重复上述判断,直至从所述遍历队列里只剩下无子分区的分区或子分区,其中,计算的步骤如下,当且时,则当时,由于任何从q通往SGi的路径必须经过SGi的边界结点使用q到的上界来估计则其中,的使用三角不等式估计,的定义同 是从所述预计算的所有边界结点的距离和各自在所在分区和子分区SGi内的最远邻居中获取;Step 10: Push all the partitions of the hierarchical partition tree into a traversal queue, pop up each partition or sub-partition SG i from the traversal queue in turn, and judge whether each sub-partition SG i makes If so, then the nodes in SG i Exclude this subdivision from the road network G, if not, push the subdivision SG i of the unexcluded subdivision or the subdivision without subdivision itself into the traversal queue, pop each subdivision sequentially from the traversal queue Sub-partition SG i of the partition, and repeat the above judgment until there are only partitions or sub-partitions without sub-partitions left in the traversal queue, wherein, the calculation The steps are as follows, when and when when , since any path from q to SG i must pass through the border nodes of SG i Use q to to estimate the upper bound of but in, is estimated using the triangle inequality, The definition is the same as is obtained from the distances of all the boundary nodes in the pre-calculation and the farthest neighbors in the respective partitions and sub-partitions SG i ;
步骤十一:对于每一个所述剩下无子分区的分区或子分区上的结点d,使用三角不等式检查距离||d-q||是否一定小于d到距离d最远地标的距离||d-f||,若结点L中存在地标u和f,使得||d-u||+||u-q||<||d-f||,则q一定不是d的最远邻居,从而d一定不是q的反向最远邻居,将该结点d从所述剩下无子分区的分区或子分区上排除;Step 11: For each sub-partition or node d on the sub-partition, use the triangle inequality to check whether the distance ||d-q|| must be less than the distance from d to the farthest landmark from d ||d-f ||, if there are landmarks u and f in the node L, so that ||d-u||+||u-q||<||d-f||, then q must not be the farthest neighbor of d, so d must not be the opposite of q To the farthest neighbor, exclude the node d from the remaining partitions or subpartitions without subpartitions;
步骤十二:检查每一个未排除的d∈VG的最远邻居是不是q,如果是,则确定d为p,p∈MRFN(q,VG),如果不是,则将该d排除。Step 12: Check whether the furthest neighbor of each unexcluded d∈V G is q, if yes, determine d to be p, p∈MRFN(q, V G ), if not, exclude d.
优选的,所述步骤十二包括:Preferably, said step 12 includes:
步骤十二一:将某结点d到某分区或子分区SGi的上界和下界分别定义为d到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点d到结点d′的上界和下界分别为和 Step twelve one: define the upper bound and the lower bound of a certain node d to a certain partition or sub-partition SG i as d to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node d to node d′ are defined as and
步骤十二二:当且时,则当时,由于任何从d通往SGi的路径必须经过SGi的边界结点使用d到的上界来估计则其中,可以使用三角不等式估计,而是从所述预计算的所有边界结点各自在所在分区和子分区SGi内的最远邻居中获取,的定义同 Step twelve two: when and when when , since any path from d to SG i must pass through the border nodes of SG i use d to to estimate the upper bound of but in, can be estimated using the triangle inequality, while is obtained from the farthest neighbors of all the pre-calculated boundary nodes in their respective partitions and sub-partitions SG i , The definition is the same as
步骤十二三:建立一个将分区SGi和结点d′的和以降序存储的优先队列,并将所有分区的压入队列中;Step 123: Establish a partition SG i and node d' and A priority queue stored in descending order, and all partitioned push into the queue;
步骤十二四:每次从所述优先队列里弹出第一个或如果弹出的是则转到步骤直十二六,如果弹出的是如果则d的最远邻居不可能是在SGi中,将该分区SGi从路网G上排除,否则,则判断该分区SGi是否有子分区,若有,则将该分区SGi的子分区的以降序压回所述优先队列,若无,则调用步骤十二五;Step 124: each time the first one is popped up from the priority queue or If the popup is Then go to step 126, if the pop-up is if Then the farthest neighbor of d cannot be in SG i , and exclude this partition SG i from the road network G ; Partitioned Push back the priority queue in descending order, if none, then call step 12;
步骤十二五:计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离并将所有以降序压回所述优先队列,并调用步骤十二六;Step twelve five: calculate each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i and put all Push back the priority queue in descending order, and call step 126;
步骤十二六:从所述优先队列从弹出前几个将该前几个对应的d′确定为q,q∈fn(p,VG)。Step twelve six: Pop the first few from the priority queue put the first few The corresponding d' is determined as q, q∈fn(p, V G ).
优选的,步骤十二五中计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离的步骤包括:Preferably, in step twelve five, calculate each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i The steps include:
若以d为源点进行一次Dijkstra算法以获得d到该分区或子分区SGi中的所有结点d′的距离具体的,作为代表性的最短路径算法,Dijkstra算法由E.W.Dijkstra在1959年提出,算法使用标记方法从源点开始,每次扩展距离已标记集合最近的点,从而求得到已知点的最短路径(可参见文献1);like Perform a Dijkstra algorithm with d as the source point to obtain the distance from d to all nodes d' in the partition or subpartition SG i Specifically, as a representative shortest path algorithm, the Dijkstra algorithm was proposed by EW Dijkstra in 1959. The algorithm uses the marking method to start from the source point, and each time expands the point closest to the marked set, so as to obtain the shortest path of the known point ( See document 1);
若由于任何从d到的路径都必然经过该分区或子分区SGi的边界节点构造一个保留d和间距离的捷径子图G′,并在所述捷径子图G′上进行距离计算得到d到该分区或子分区SGi中的所有结点d′的距离 like due to anything from d to All paths must pass through the boundary nodes of the partition or subpartition SG i Construct a retaining d and The shortcut subgraph G' of the distance between them, and the distance calculation is performed on the shortcut subgraph G' to obtain the distance from d to all nodes d' in the partition or subpartition SG i
优选的,构造一个保留d和间距离的捷径子图G′的步骤中,使用HEPV和HiTi技术。Preferably, construct a reserved d and In the step of the short-cut subgraph G′ of the distance between two steps, HEPV and HiTi technologies are used.
优选的,构造一个保留d和边界节点间距离的捷径子图G′的步骤中,预先保存所有边界节点之间的距离,使用d所在的分区SGi和预先保存的两个分区边界节点之间的距离构造捷径子图G′。Preferably, construct a retaining d and boundary nodes In the step of the short-cut subgraph G′ of the inter-distance, all boundary nodes are pre-saved Use the partition SG i where d is located and the pre-saved distance between the two partition boundary nodes to construct a shortcut subgraph G′.
详细的,MRFN查询的访问模式具有较强的局部性,所以可以通过分区方法来有效的处理MRFN查询。图分区技术自1970年代以来在不同的领域被广泛研究。绝大多数分区技术均可被用于处理MRFN查询。In detail, the access pattern of the MRFN query has strong locality, so the MRFN query can be efficiently processed through the partition method. Graph partitioning techniques have been widely studied in different fields since the 1970s. Most partitioning techniques can be used to process MRFN queries.
为了讨论的方便,引入以下定义:For the convenience of discussion, the following definitions are introduced:
定义4 我们定义一个分区SGi的边界结点为Definition 4 We define the boundary nodes of a partition SG i as
其中edge(p,p’)表示p与p’之间的边,R表示路网,表示分区SGi的结点集。Where edge(p,p') represents the edge between p and p', R represents the road network, Represents the node set of partition SG i .
定义5 某结点p到某分区SGi的上界(下界)定义为p到内的任何结点的最大(最小)距离。记为某分区SGi的半径定义为我们类似的定义点p到点q的上界(下界)为 Definition 5 The upper bound (lower bound) from a node p to a partition SG i is defined as p to The maximum (minimum) distance of any node within . recorded as The radius of a certain partition SG i is defined as We similarly define the upper bound (lower bound) from point p to point q as
定义6 某分区SGi的最远上界(最远下界)定义为任意到它在路网上最远邻居的距离最大(最小)值,记为类似的,我们定义一个结点到它路网上最远邻居的距离为fubp(flbp)。Definition 6 The farthest upper bound (farthest lower bound) of a partition SG i is defined as any The maximum (minimum) value of the distance to its furthest neighbor on the road network, denoted as Similarly, we define the distance from a node to its furthest neighbor on the road network as fub p (flb p ).
根据以上的定义,引入如下引理:According to the above definition, the following lemma is introduced:
引理1 如果存在结点q分区SGi结点使得则p不可能是q的MRFN。Lemma 1 If there is node q partition SG i node make Then p cannot be the MRFN of q.
证明 如果p是q的反向最远邻居,由于有这与条件相悖。Prove that if p is the reverse farthest neighbor of q, since Have This is against the conditions.
接下来,我们讨论如何有效构造HP树。我们的构造方法基于HEPV技术[19]与网络Voronoi图(graph voronoi diagram,参见文献20)。Next, we discuss how to efficiently construct HP trees. Our construction method is based on HEPV technology [19] and network Voronoi diagram (graph voronoi diagram, see literature 20).
HP树可以使用自顶向下(top-down)的方法构造。我们将路网中的结点划分为m个分区,并且将每个分区递归的划分为m个子分区,直至我们达到所需的分区数量与层数。我们使用Erwig and Hagen算法将某个分区SGi划分为m个子分区(参见文献20)。一个HP树的例子参见图2与图3。HP trees can be constructed using a top-down approach. We divide the nodes in the road network into m partitions, and recursively divide each partition into m sub-partitions until we reach the required number of partitions and layers. We use the Erwig and Hagen algorithm to divide a certain partition SG i into m subpartitions (see reference 20). An example of an HP tree is shown in Figure 2 and Figure 3.
为了进行查询我们还需要一些辅助信息。我们预计算某一分区SGi内子分区的边界结点间的距离,这些边界结点与他们之间的捷径形成了一个子图,称为分区SGi的超图,同时计算所有边界结点的最远邻居和他们所在分区内的最远邻居。In order to perform the query we also need some auxiliary information. We pre-calculate the distance between the boundary nodes of the sub-partitions in a certain partition SG i . These boundary nodes and the shortcuts between them form a subgraph, which is called the hypergraph of the partition SG i . At the same time, we calculate the distances of all the boundary nodes The furthest neighbors and the furthest neighbors within the partition they are in.
下面我们介绍如何计算引理1中提及的相关上下界。Below we describe how to compute the relevant upper and lower bounds mentioned in Lemma 1.
由定义5我们了解到,是一个结点到某一个分区SGi的距离上界。为了计算我们首先寻找SGi内p的最远邻居。当且时,我们有而当时,由于任何从p通往SGi的路径必须经过SGi的边界结点,我们可以使用p到的上界来估计 From Definition 5, we know that is the upper bound of the distance from a node to a partition SG i . to calculate We first look for the furthest neighbors of p within SG i . when and when we have And when When , since any path from p to SG i must pass through the border nodes of SG i , we can use p to to estimate the upper bound of
其中可以使用三角不等式估计,而是建立HP树时预计算的信息。in can be estimated using the triangle inequality, while It is the precomputed information when building the HP tree.
为了计算我们需要估计SGi中结点到它们的最远邻居距离的下界,我们介绍下面的引理:to calculate We need to estimate a lower bound on the distances of nodes in SG i to their furthest neighbors, and we introduce the following lemma:
引理2 对于
证明:由三角不等式,我们有||b-f||-||p-b||≤||p-f||.同时,由定义5,如果
为了求得一个较大的我们选择一组SGi的边界结点与任何G中的结点,并计算g(b,f)的最大值。由于与查询q无关,我们可以在建树的时候预计算所有分区的 In order to obtain a larger We select a set of border nodes of SG i and any node in G, and compute the maximum value of g(b,f). because Regardless of the query q, we can pre-compute all partitions when building the tree
表1Table 1
如表1所示,本实施例使用广度优先顺序遍历HP树,对于每个访问到的分区SGi,算法试图使用引理1进行剪枝。如果SGi不能被剪枝,我们将所有的子分区压入遍历的队列对于叶子分区,我们使用LM(地标)算法进行处理。As shown in Table 1, this embodiment traverses the HP tree in breadth-first order, and for each visited partition SG i , the algorithm tries to use Lemma 1 to perform pruning. If SG i cannot be pruned, we push all subpartitions into the traversal queue For leaf partitions, we use the LM (Landmark) algorithm for processing.
引理3 对于如果 有Lemma 3 for if Have
p不可能是u的最远邻居 p cannot be the furthest neighbor of u
证明:由的定义容易得证。Proof: by The definition of is easy to prove.
表2Table 2
如表2所示,我们计算f(q,G)并检查p是否在fn(q,G)中。整体来说,我们以的降序来遍历HP树中的分区并使用前述性质进行剪枝。如果我们到达了HP树的叶子分区,我们使用下文中描述的方法计算q到该分区所有结点的距离,一旦计算出某个结点到q的精确距离超过了剩余的所有我们就可以将该结点标记为fn(q,G)。As shown in Table 2, we compute f(q, G) and check whether p is in fn(q, G). Overall, we take descending order to traverse the partitions in the HP tree and use the aforementioned properties for pruning. If we reach the leaf partition of the HP tree, we calculate the distance from q to all nodes in the partition using the method described below, once the exact distance from a node to q is calculated beyond all remaining We can label this node as fn(q,G).
我们使用一个同时保存结点与分区的优先队列来实现以上算法。队列中的元素e以的降序进行存储。在每一步我们弹出中的第一个元素。如果它是一个有子分区的部分,我们利用引理3进行剪枝并将未剪枝的分区压回当中弹出的元素是HP树的叶子分区SGi时,我们使用以下方法计算分区内所有结点到查询q的距离:We use a priority queue that holds both nodes and partitions to implement the above algorithm. The element e in the queue starts with are stored in descending order. At each step we pop The first element in . If it is a part with subpartitions, we use Lemma 3 to prune and push back unpruned partitions when When the pop-up element is the leaf partition SG i of the HP tree, we use the following method to calculate the distance from all nodes in the partition to the query q:
对于我们只需要以q为源点进行一次Dijkstra算法就可以获得q到所有点的距离。而对于的情况,由于任何从q到的路径都必然经过SGi的分区我们可以构造一个保留q和间距离的”捷径子图”G’,并在这张较小的图上进行距离计算。for We only need to perform Dijkstra's algorithm once with q as the source point to obtain the distance from q to all points. and for In the case of , due to any change from q to All paths must go through the partition of SG i We can construct a preserving q and The "shortcut subgraph"G' of the distance between the two, and the distance calculation is performed on this smaller graph.
构造G’的方法根据我们建立HP树的策略有所不同。在我们上面描述的HP树中,使用HEPV技术(参见文献19)和HiTi(文献21)技术都可以完成这一任务。为了进一步加速,我们可以在建树时预先保存所有边界点之间的距离,这样我们只需在q所在的分区、两个分区边界点之间的捷径边和SGi所构成的子图上,以q为源点进行一次Dijkstra运算就可以得到所需的结果。The method of constructing G' varies according to our strategy for building the HP tree. In the HP tree we described above, this task can be accomplished using both HEPV technology (see Ref. 19) and HiTi (Ref. 21) technology. In order to further speed up, we can pre-save the distance between all boundary points when building a tree, so that we only need to use The desired result can be obtained by performing a Dijkstra operation on q as the source point.
在获得了q到的精确距离后,我们将所有结点的设置为刚刚得到的计算结果并重新压入中。当一个结点被从中弹出,我们知道这个结点到q的距离大于等于其他所有结点,我们只需把所有具有相同距离的结点加入fn(q,G),并终止算法。检查p是否在求得的fn(q,G)中,我们就可以返回isFN(p,q)的结果。After getting q to After the exact distance of , we combine all nodes' Set to the calculated result just obtained and re-press middle. When a node is accessed from We know that the distance from this node to q is greater than or equal to all other nodes, we only need to add all nodes with the same distance to fn(q, G), and terminate the algorithm. Checking whether p is in the obtained fn(q,G), we can return the result of isFN(p,q).
可使用C++语言基于在一个广泛应用的、基于磁盘的空间索引库(参见:www.research.att.com/~marioh/spatialindex/index.html)实现了本实施例的全部步骤,并使用拥有Intel Xeon 2GHz处理器以及4GB内存的Linux环境下运行实验。默认情况下,对每个实验可运行1000次计算并报告平均值。在实验数据方面,本实施例可使用Digital Chart of the World Server所提供的加州(California,CA)与圣弗朗西斯科(San Francisco,SF)真实路网进行实验。这些数据可以在网上(参见http://www.cs.utah.edu/~lifeifei/SpatialDataset.htm)获得。CA数据库含有21047个结点,21692条边;SF数据库含有174955个结点,223000条边。所述的CA与SF数据库被用于测试路网上MRFN算法的性能,查询点随机从路网上选取,可在地图上均匀地选取64个地标。一实施例中,可默认报告HP树在2层,每个分区20个子分区(共441子分区)配置下的性能表现。Can use C++ language based on a widely used, disk-based spatial index library (see: www.research.att.com/~marioh/spatialindex/index.html) to achieve all the steps of this embodiment, and use Intel Experiments were run in a Linux environment with a Xeon 2GHz processor and 4GB of memory. By default, 1000 calculations are run for each experiment and the average is reported. In terms of experimental data, this embodiment can use the real road network of California (California, CA) and San Francisco (San Francisco, SF) provided by Digital Chart of the World Server to conduct experiments. These data are available online (see http://www.cs.utah.edu/~lifeifei/SpatialDataset.htm). The CA database contains 21047 nodes and 21692 edges; the SF database contains 174955 nodes and 223000 edges. The CA and SF databases are used to test the performance of the MRFN algorithm on the road network. The query points are randomly selected from the road network, and 64 landmarks can be evenly selected on the map. In one embodiment, the performance performance of the HP tree under the configuration of 2 layers and 20 sub-partitions in each partition (441 sub-partitions in total) may be reported by default.
两个参数可能会影响到HP算法的性能:总分区的个数(记为|HP|)与HP树的深度。我们在图4和5中展现了这些参数分别在两个不同路网上即CA与SF数据库的性能影响。Two parameters may affect the performance of the HP algorithm: the number of total partitions (denoted as |HP|) and the depth of the HP tree. We show in Figures 4 and 5 the performance impact of these parameters on two different road networks, the CA and SF databases, respectively.
从理论上来说,更多的分区将提供更好的性能。这一趋势可以在图4和5中被观察到:当|HP|=420时,算法的执行时间仅为|HP|=40的十分之一。但是当|HP|较大时,由于新增的分区很难进一步剪枝,所以进一步增大|HP|效果不好。In theory, more partitions will provide better performance. This trend can be observed in Figures 4 and 5: when |HP|=420, the execution time of the algorithm is only one-tenth of |HP|=40. But when |HP| is large, it is difficult to further prune the newly added partitions, so further increasing |HP| is not effective.
在图4和5中,我们还可以比较不同层数的HP树的表现,从实验数据中可以看到,在|HP|较小时,层数少的HP树表现更好。然而层数较高的树随着|HP|的增长有更好的伸缩性能。这主要是由于层数少时,叶子级别的分区更小,能在|HP|较小时提供较好的性能。而层数多时,有更多的可能一次剪去较多的分区,在|HP|较大的时候提供了更好的表现:在|HP|小时,一层的参数表现更好。而|HP|较大时,多层的树有较好的表现。In Figures 4 and 5, we can also compare the performance of HP trees with different layers. From the experimental data, we can see that when |HP| is small, HP trees with fewer layers perform better. However, trees with higher levels scale better as |HP| grows. This is mainly because when the number of layers is small, the leaf-level partitions are smaller, which can provide better performance when |HP| is small. When the number of layers is large, it is more likely to cut more partitions at one time, and it provides better performance when |HP| is larger: when |HP| is small, the parameters of one layer perform better. When |HP| is large, multi-layered trees perform better.
实施例二Embodiment two
本发明还提供另一种获取路网上单反向最远邻居的层次分区系统,包括:The present invention also provides another hierarchical partitioning system for obtaining the single reverse farthest neighbor on the road network, including:
第一定义模块,用于对于给定路网G上的某一结点p和路网G上的所有结点VG,如果路网G上存在结点q,q与p的路网距离||q-p||不小于p到VG当中任何点p’的距离||p′-p||,则定义q为p相对于VG的最远邻居,记为fn(p,VG);The first definition module is used for a given node p on the road network G and all nodes V G on the road network G, if there is a node q on the road network G, the road network distance between q and p| |qp||is not less than the distance from p to any point p' in V G ||p′-p||, then define q as the furthest neighbor of p relative to V G , and denote it as fn(p, V G );
第二定义模块,对于给定路网G上的所有结点VG,定义q的单反向最远邻居是VG中以q作为最远邻居点的集合即MRFN(q,VG)={p|p∈VG,fn(p,VG∪{q})=q};The second definition module, for all nodes V G on the given road network G, the single-reverse farthest neighbor of q is defined as the set of q as the farthest neighbor point in V G , that is, MRFN(q, V G )={ p|p∈V G , fn(p,V G ∪{q})=q};
层次分区模块,用于使用自顶向下的方法构造路网G的层次分区树,路网G中的结点划分为m个分区SGi,并且将每个分区递归的划分为若干个子分区SGi,直至达到所需的分区数量与层数;The hierarchical partition module is used to construct a hierarchical partition tree of the road network G using a top-down method. The nodes in the road network G are divided into m partitions SG i , and each partition is recursively divided into several sub-partitions SG i , until the required number of partitions and layers is reached;
边界结点模块,用于定义路网G上每一个分区或子分区SGi的边界结点为其中edge(d,d′)表示d与d′之间的边,表示分区SGi的所有结点;The boundary node module is used to define the boundary node of each subdivision or subdivision SG i on the road network G as Where edge(d,d') represents the edge between d and d', Represents all nodes of the partition SG i ;
第一上下界模块,用于将某结点q到某分区或子分区SGi的上界和下界分别定义为q到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点q到结点d的上界和下界分别为和 The first upper and lower bound module is used to define the upper bound and lower bound from a certain node q to a certain partition or sub-partition SG i as q to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node q to node d are defined as and
第二上下界模块,用于将某分区或子分区SGi的最远上界和最远下界分别定义为任意到它在路网G上最远邻居的距离最大值和最小值,记为和类似的定义一个结点u到它路网G上最远邻居的距离为fubu和flbu;The second upper and lower bound module is used to define the farthest upper bound and the farthest lower bound of a partition or sub-partition SG i as arbitrary The maximum and minimum distances to its furthest neighbors on the road network G are denoted as and Similarly define the distance from a node u to its furthest neighbor on the road network G as fub u and flb u ;
预计算模块,用于预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;The pre-calculation module is used to pre-calculate the distance between the boundary nodes of the sub-division SG i in a certain sub-division SG i , and pre-calculate the respective farthest neighbors f of all boundary nodes on the road network G and the respective locations of all boundary nodes the furthest neighbors within the partition and subpartition SG i ;
距离模块,用于选择所述路网上的多个结点L作为地标,使用Dijkstra算法预计算每个结点L到所述剩下无子分区的分区或子分区上所有结点的距离;The distance module is used to select a plurality of nodes L on the road network as landmarks, and use the Dijkstra algorithm to pre-calculate the distance from each node L to the remaining partitions without sub-regions or all nodes on the sub-regions;
估计模块,用于估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于
队列模块,用于将层次分区树的所有分区压入一遍历队列,从所述遍历队列依次弹出每个分区或子分区SGi,判断每个子分区SGi,是否使得若是,则SGi中的结点将该子分区从路网G上排除,若否,将该未排除的子分区的子分区SGi或无子分区的子分区自身压入所述遍历队列,从所述遍历队列依次弹出每个子分区的子分区SGi,并重复上述判断,直至从所述遍历队列里只剩下无子分区的分区或子分区,其中,计算的步骤如下,当且时,则当时,由于任何从q通往SGi的路径必须经过SGi的边界结点使用q到的上界来估计则其中,的使用三角不等式估计,的定义同 是从所述预计算的所有边界结点的距离和各自在所在分区和子分区SGi内的最远邻居中获取;The queue module is used to push all the partitions of the hierarchical partition tree into a traversal queue, pop up each partition or sub-partition SG i in turn from the traversal queue, and judge whether each sub-partition SG i makes If so, then the nodes in SG i Exclude this subdivision from the road network G, if not, push the subdivision SG i of the unexcluded subdivision or the subdivision without subdivision itself into the traversal queue, pop each subdivision sequentially from the traversal queue Sub-partition SG i of the partition, and repeat the above judgment until there are only partitions or sub-partitions without sub-partitions left in the traversal queue, wherein, the calculation The steps are as follows, when and when when , since any path from q to SG i must pass through the border nodes of SG i Use q to to estimate the upper bound of but in, is estimated using the triangle inequality, The definition is the same as is obtained from the distances of all the boundary nodes in the pre-calculation and the farthest neighbors in the respective partitions and sub-partitions SG i ;
结点排除模块,用于对于每一个所述剩下无子分区的分区或子分区上的结点d,使用三角不等式检查距离||d-q||是否一定小于d到距离d最远地标的距离||d-f||,若结点L中存在地标u和f,使得||d-u||+||u-q||<||d-f||,则q一定不是d的最远邻居,从而d一定不是q的反向最远邻居,将该结点d从所述剩下无子分区的分区或子分区上排除;The node exclusion module is used to check whether the distance ||d-q|| must be less than the distance from d to the farthest landmark from d for each of the remaining partitions without sub-partitions or node d on the sub-partition. ||d-f||, if there are landmarks u and f in the node L, so that ||d-u||+||u-q||<||d-f||, then q must not be the farthest neighbor of d, so d must not The reverse farthest neighbor of q excludes the node d from the remaining partition or subpartition without subpartitions;
检查模块,用于检查每一个未排除的d∈VG的最远邻居是不是q,如果是,则确定d为p,p∈MRFN(q,VG),如果不是,则将该d排除。The checking module is used to check whether the furthest neighbor of each unexcluded d ∈ V G is q, if yes, then determine d to be p, p ∈ MRFN(q, V G ), if not, then d is excluded .
优选的,所述距离模块选择的地标在路网G上均匀分布。Preferably, the landmarks selected by the distance module are evenly distributed on the road network G.
优选的,所述层次分区模块使用Erwig and Hagen算法将每个分区递归的划分为若干个子分区SGi。Preferably, the hierarchical partitioning module uses Erwig and Hagen algorithm to recursively divide each partition into several sub-partitions SG i .
优选的,所述检查模块包括:Preferably, the inspection module includes:
第一上下界单元,用于将某结点d到某分区或子分区SGi的上界和下界分别定义为d到内的任何结点的最大和最小距离,记为和分区或子分区SGi的直径定义为类似的定义结点d到结点d′的上界和下界分别为和 The first upper and lower bound unit is used to define the upper bound and lower bound from a certain node d to a certain partition or sub-partition SG i as d to The maximum and minimum distances of any node in , denoted as and The diameter of a partition or subpartition SG i is defined as Similarly, the upper and lower bounds from node d to node d′ are defined as and
估计单元,用于当且时,则当时,由于任何从d通往SGi的路径必须经过SGi的边界结点使用d到的上界来估计则其中,可以使用三角不等式估计,而是从所述预计算的所有边界结点各自在所在分区和子分区SGi内的最远邻居中获取,的定义同 Estimation unit, used when and when when , since any path from d to SG i must pass through the border nodes of SG i use d to to estimate the upper bound of but in, can be estimated using the triangle inequality, while is obtained from the farthest neighbors of all the pre-calculated boundary nodes in their respective partitions and sub-partitions SG i , The definition is the same as
队列单元,用于建立一个将分区SGi和结点d′的和以降序存储的优先队列,并将所有分区的压入队列中;Queue unit, used to establish a partition SG i and node d' and A priority queue stored in descending order, and all partitioned push into the queue;
分区排除单元,用于每次从所述优先队列里弹出第一个或如果弹出的是则调用最远邻居单元,如果弹出的是如果则d的最远邻居不可能是在SGi中,将该分区SGi从路网G上排除,否则,则判断该分区SGi是否有子分区,若有,则将该分区SGi的子分区的以降序压回所述优先队列,若无,则调用计算单元;The partition exclusion unit is used to pop the first one from the priority queue each time or If the popup is Then call the farthest neighbor unit, if the pop-up is if Then the farthest neighbor of d cannot be in SG i , and exclude this partition SG i from the road network G ; Partitioned Push back the priority queue in descending order, if none, call the computing unit;
计算单元,用于计算每一个对应的分区或子分区SGi中的所有结点d′至d的距离并将所有以降序压回所述优先队列,并调用最远邻居单元;Computing unit for computing each The distance from all nodes d′ to d in the corresponding partition or subpartition SG i and put all Depress the priority queue in descending order and call the furthest neighbor unit;
最远邻居单元,用于从所述优先队列从弹出前几个将该前几个对应的d′确定为q,q∈fn(p,VG)。furthest neighbor unit for popping the first few from the priority queue from put the first few The corresponding d' is determined as q, q∈fn(p, V G ).
优选的,所述计算单元,用于:Preferably, the computing unit is used for:
若以d为源点进行一次Dijkstra算法以获得d到该分区或子分区SGi中的所有结点d′的距离 like Perform a Dijkstra algorithm with d as the source point to obtain the distance from d to all nodes d' in the partition or subpartition SG i
若由于任何从d到的路径都必然经过该分区或子分区SGi的边界节点构造一个保留d和间距离的捷径子图G′,并在所述捷径子图G′上进行距离计算得到d到该分区或子分区SGi中的所有结点d′的距离 like due to anything from d to All paths must pass through the boundary nodes of the partition or subpartition SG i Construct a retaining d and The shortcut subgraph G' of the distance between them, and the distance calculation is performed on the shortcut subgraph G' to obtain the distance from d to all nodes d' in the partition or subpartition SG i
优选的,所述计算单元使用HEPV和HiTi技术构造一个保留d和间距离的捷径子图G′。Preferably, the calculation unit uses HEPV and HiTi technology to construct a reserved d and The short-cut subgraph G′ of the distance between
优选的,所述计算单元预先保存所有边界节点之间的距离,使用d所在的分区SGi和预先保存的两个分区边界节点之间的距离构造捷径子图G′。Preferably, the calculation unit pre-saves all boundary nodes Use the partition SG i where d is located and the pre-saved distance between the two partition boundary nodes to construct a shortcut subgraph G′.
本实施例二的其它详细内容具体可参见实施例一,在此不再赘述。For other details of the second embodiment, reference may be made to the first embodiment, which will not be repeated here.
本发明通过预计算某分区SGi内子分区SGi的边界结点间的距离,同时预计算所有边界结点在路网G上各自的最远邻居f和所有边界结点各自在所在分区和子分区SGi内的最远邻居;估计每个分区或子分区SGi内的结点d到其路网G上的最远邻居距离的下界,对于有
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant information, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
显然,本领域的技术人员可以对发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包括这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies thereof, the present invention also intends to include these modifications and variations.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310279130.9A CN103365983B (en) | 2013-07-04 | 2013-07-04 | Obtain level partition method and the system of the most farthest single neighbours on road network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310279130.9A CN103365983B (en) | 2013-07-04 | 2013-07-04 | Obtain level partition method and the system of the most farthest single neighbours on road network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103365983A CN103365983A (en) | 2013-10-23 |
CN103365983B true CN103365983B (en) | 2016-09-07 |
Family
ID=49367324
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310279130.9A Expired - Fee Related CN103365983B (en) | 2013-07-04 | 2013-07-04 | Obtain level partition method and the system of the most farthest single neighbours on road network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103365983B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108595255B (en) * | 2018-04-13 | 2022-01-21 | 武汉理工大学 | Workflow task scheduling method based on shortest path algorithm in geographically distributed cloud |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002257578A (en) * | 2001-02-28 | 2002-09-11 | Toshiba Corp | Road guide method and device |
CN101369982A (en) * | 2008-10-13 | 2009-02-18 | 北京邮电大学 | Method for greedy forwarding of data packets in vehicular Ad hoc network |
CN102238687A (en) * | 2011-08-05 | 2011-11-09 | 电子科技大学 | Pseudo-three-dimensional wireless sensor network routing method based on geographical position |
-
2013
- 2013-07-04 CN CN201310279130.9A patent/CN103365983B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002257578A (en) * | 2001-02-28 | 2002-09-11 | Toshiba Corp | Road guide method and device |
CN101369982A (en) * | 2008-10-13 | 2009-02-18 | 北京邮电大学 | Method for greedy forwarding of data packets in vehicular Ad hoc network |
CN102238687A (en) * | 2011-08-05 | 2011-11-09 | 电子科技大学 | Pseudo-three-dimensional wireless sensor network routing method based on geographical position |
Non-Patent Citations (3)
Title |
---|
Adaptive Travel Time Path Selection in Hierarchical Index Road Network;Adisak Sukul 等;《2006 IEEE International Conference on Systems, Man and Cybernetics》;20061011;1682-1687 * |
Continuous Reverse Nearest Neighbor Queries on Moving Objects in Road Network;SUN Huan-liang 等;《The Ninth International Conference on Web-Age Information Management》;20080722;238-245 * |
Moving Continuous K Nearest Neighbor Queries in Spatial Network Databases;Xiaolan Yin 等;《2009 World Congress on Computer Science and Information Engineering》;20090402;535-541 * |
Also Published As
Publication number | Publication date |
---|---|
CN103365983A (en) | 2013-10-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Rocha-Junior et al. | Top-k spatial keyword queries on road networks | |
Kim et al. | DBCURE-MR: An efficient density-based clustering algorithm for large data using MapReduce | |
Zhong et al. | G-tree: An efficient and scalable index for spatial search on road networks | |
Yiu et al. | Reverse nearest neighbors in large graphs | |
CN108932347B (en) | Spatial keyword query method based on social perception in distributed environment | |
Xuan et al. | Voronoi-based multi-level range search in mobile navigation | |
Luo et al. | Distributed Spatial Keyword Querying on Road Networks. | |
Astefanoaei et al. | Multi-resolution sketches and locality sensitive hashing for fast trajectory processing | |
Tiakas et al. | Skyline queries: An introduction | |
Jin et al. | Querying web-scale information networks through bounding matching scores | |
Nutanong et al. | Memory-efficient algorithms for spatial network queries | |
CN103345509B (en) | Obtain the level partition tree method and system of the most farthest multiple neighbours on road network | |
US7512282B2 (en) | Methods and apparatus for incremental approximate nearest neighbor searching | |
Sun et al. | On efficient aggregate nearest neighbor query processing in road networks | |
Xuan et al. | Network Voronoi diagram based range search | |
Raghuvira et al. | An efficient density based improved k-medoids clustering algorithm | |
CN103365983B (en) | Obtain level partition method and the system of the most farthest single neighbours on road network | |
CN103365984B (en) | Obtain the terrestrial reference method and system of the most farthest single neighbours on road network | |
Wang et al. | Cost-efficient spatial network partitioning for distance-based query processing | |
Wang et al. | Processing multiple-user location-based keyword queries | |
Li et al. | Efficient processing of probabilistic group nearest neighbor query on uncertain data | |
Shaw et al. | Efficient approximation of spatial network queries using the m-tree with road network embedding | |
Ihm et al. | Grid‐PPPS: A Skyline Method for Efficiently Handling Top‐k Queries in Internet of Things | |
CN103324746B (en) | Obtain go forward one by one farthest partition method and the system of the most farthest multiple neighbours on road network | |
CN103336827B (en) | Obtain the force search method and system of the most farthest multiple neighbours on road network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160907 Termination date: 20190704 |