A method for mining clustering patterns of network-constrained geographic flows based on hierarchical clustering
By constructing network distance matrix and stream similarity clustering, the problem of low efficiency and accuracy of geographic flow aggregation pattern recognition in the existing technology is solved, and more efficient and accurate mining of network-constrained geographic flow aggregation pattern is achieved.
Patent Information
- Application Number
- CN202310489025.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-05-04
AI Technical Summary
When identifying network-constrained geographic flow agglomeration modes, the recognition efficiency and accuracy are low, and the parameter settings are complex, resulting in poor recognition of irregular-shaped flow clusters.
Using a hierarchical clustering method, by constructing a network distance matrix, measuring the network distance of the geographic flow, clustering according to the flow similarity, setting a cluster similarity threshold to determine whether the geographic flow belongs to the same stream cluster, and generating geographic flow clustering results.
It improves the recognition efficiency and accuracy of geographic flow agglomeration mode, solves the problem of cumbersome parameter selection in the existing methods, and can more accurately identify the geographic flow agglomeration mode under network constraints.
Smart Images

Figure CN116484240B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering. Background Art
[0002] Geographic flows are the movement of geographical objects between different spatial locations. They typically encompass the transfer of people, materials, information, capital, and energy, reflecting the connections between locations in geographic space. Geographic flows exhibit typical spatiotemporal characteristics and dynamic changes, providing a window into the formation and evolution of geographic space. Studying geographic flows is of great significance to fields such as transportation planning and resource scheduling. The existence of various flows reshapes the landscape of geographic space. Therefore, research should be conducted from the perspective of flow pattern mining. Exploring the patterns of geographic flows can provide new insights into the detection of geographic patterns and the analysis of their mechanisms.
[0003] Most geographic flows studied occur in cyberspace, such as human commuting and freight transportation. Geographic objects move along networks (e.g., pipelines, roads, and other network structures) and form geographic flows subject to network constraints. Network constraints are a crucial characteristic of real-life geographic flows. Measuring distance is necessary when studying flow data. However, previous studies have often used Euclidean distance to measure geographic flow relationships. This can lead to incorrect identification of flow patterns when studying network-constrained geographic flows such as taxis, bicycles, and pedestrians. Therefore, when studying geographic flows for pattern mining, introducing road network constraints to measure distance is of great significance. This can more scientifically and rationally reveal geographic phenomena in real-world road network scenarios.
[0004] Geographic flow pattern recognition refers to the identification and extraction of flow clustering patterns. By performing high-level summarization of massive data, interactions within geographic space are mined. Geographic flow clustering patterns are defined as those where both the starting and ending points of geographic flows are clustered. Related research primarily focuses on classic flow-based clustering frameworks. For example, hierarchical clustering methods measure geographic flow similarity to determine whether flows can be clustered. These clusters are then aggregated through hierarchical judgment to ultimately form flow clusters. The degree of geographic flow similarity depends on the distance between the starting and ending points. However, such methods are not suitable for large datasets and yield suboptimal results for identifying irregularly shaped flow clusters. Density-based clustering methods also redefine concepts such as flow distance, density, core objects, and accessibility to further identify high-density flow subsets. However, density-based methods can take too long to run with large datasets, have complex parameter settings, and exhibit complex algorithms and low efficiency. Other researchers have used spatial scanning statistical methods, followed by dynamic optimization strategies, to cluster geographic flows. By defining adjacency relationships between flows and extending the ant colony algorithm, flow patterns can also be identified. However, clustering geographic flows using dynamic optimization methods also presents challenges such as high computational complexity and the need for numerous parameters. Furthermore, these methods often employ Euclidean distance as a metric, and using methods designed for planar flows to analyze network-constrained geographic flows can lead to incorrect interpretations of flow patterns.
[0005] It can be seen that there is an urgent need for a network-constrained geographic flow clustering pattern mining method based on hierarchical clustering with high recognition efficiency and accuracy. Summary of the Invention
[0006] In view of this, the embodiments of the present disclosure provide a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering, which at least partially solves the problems of poor recognition efficiency and accuracy in the prior art.
[0007] The present disclosure provides a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering, including:
[0008] Step 1: Match the starting and ending points of the geographic flow data with the road network data, then measure the network distance between the starting and ending points and the geographic flow, and construct a network distance matrix based on this;
[0009] Step 2: Calculate the similarity of each geographic flow under the network distance metric, cluster the geographic flows according to the flow similarity, compare the flow similarity with the set cluster similarity threshold to determine whether different geographic flows belong to the same flow cluster, and generate the geographic flow clustering results.
[0010] According to a specific implementation of the embodiment of the present disclosure, step 1 specifically includes:
[0011] Step 1.1: Build a geographic flow model and match the starting and ending points of the geographic flow data with the road network data based on the shortest distance between the point and the road segment. Obtain the road segment affiliation of each starting and ending point and the network distance between it and its adjacent nodes.
[0012] Step 1.2: Preprocess the road network data, break the intersections of the road sections to obtain nodes, and find the shortest network path distance between each node and other nodes until the distance between the node and other nodes is greater than the specified threshold. Traverse all nodes to obtain the road network node distance matrix.
[0013] Step 1.3: Calculate the distances between the starting points and the end points of different geographic flows by adding and taking the minimum sum. Calculate the geographic flow distances based on the network distance matrix. Obtain the network distance matrix between geographic flows by calculating the sum of the network distances between the starting points and the end points of the geographic flows.
[0014] According to a specific implementation of the embodiment of the present disclosure, the expression of the geographic flow model is:
[0015] f={O,D,d S (O),d E (O),d S (D),d E (D)}
[0016] Among them, point O and point D represent the starting and ending coordinates of the geographic flow respectively, S represents the starting endpoint of the section where the starting and ending points are located, E is the ending endpoint of the section where the starting and ending points are located, and d represents the distance between the two points.
[0017] According to a specific implementation of the embodiment of the present disclosure, the expression of the shortest network path distance is:
[0018] d(p i ,p j )=min(d net (p i ,p j ))
[0019] Among them, d net (p i ,p j ) represents the road segment node p i With p j The network distance between the two nodes, min() represents the minimum value of all network path distances between the two nodes.
[0020] According to a specific implementation of the embodiment of the present disclosure, the expression for calculating the distance between the starting points and the end points of different geographical flows is:
[0021] d(Om ,O n )=d(O m ,p i )+d(O n ,p j )+d(p i ,p j )
[0022] Among them, d(O m ,p i ), d(O n ,p j ) refers to the network distance between the flow origin and the nearest node, d(p i ,p j ) represents the shortest network path distance between two nodes.
[0023] According to a specific implementation of the embodiment of the present disclosure, step 2 specifically includes:
[0024] Step 2.1: Initialize the original flow cluster and treat each geographic flow as a unique initial flow cluster;
[0025] Step 2.2, traverse each flow, first calculate the network distance between flow i and other flows according to the network distance matrix, and then obtain the k flows closest to it;
[0026] Step 2.3, construct a network flow model under network constraints and define the similarity between each geographical flow based on the network distance metric;
[0027] Step 2.4, for each geographic flow f i , traverse its flow neighbors f in turn j , to determine the similarity of geographical flows;
[0028] In step 2.5, the corresponding flow clusters are merged according to the similarity between the geographical flows, all the geographical flows are traversed and the geographical flow clustering results are generated.
[0029] According to a specific implementation of the embodiment of the present disclosure, the calculation formula of the similarity is:
[0030]
[0031] in, Indicates the network distance between the starting points and the end points of two flows, α indicates the length adjustment threshold, len i 、len j Represents geographic flow f i 、f j The length of the two flows is obtained by Euclidean distance, and min() means taking the minimum value of the length of the two flows.
[0032] According to a specific implementation of the embodiment of the present disclosure, step 2.4 specifically includes:
[0033] Step 2.4.1, find the geographic flow f respectively i and f j Flow cluster C i and C j , and determine whether the two geographical flows belong to the same flow cluster;
[0034] Step 2.4.2: If the two geographies belong to different flow clusters, calculate the flow cluster C. i and C j similarity between
[0035] Step 2.4.3, if the flow cluster C i and C j Is the same flow cluster, then traverse to f i Repeat steps 2.4.1 and 2.4.2 for the next neighbor stream.
[0036] According to a specific implementation of the embodiment of the present disclosure, when the flow cluster contains more than one geographic flow, step 2.4.2 further includes:
[0037] Compute flow cluster C i The average coordinate of the starting point of all flows in O ave and the average coordinate of the end point D ave , and then traverse the starting position of all stream data in the entire data set and O ave The distance between them is obtained by looking up the distance from the average coordinate O ave The nearest point is taken as the starting point of the flow cluster center O cen Similarly, we get the center endpoint D of the flow cluster cen , thus we get the representative flow cluster C i Central flow f at the central position ci =(O cen ,D cen ), and similarly we get flow cluster C j The central flow f cj , and finally based on the central flow f ci With f cj The position and length information of f is calculated ci With f cj similarity.
[0038] The network-constrained geographic flow clustering pattern mining scheme based on hierarchical clustering in the embodiment of the present disclosure includes: step 1, matching the starting and ending points of geographic flow data with road network data, then measuring the network distance of the starting and ending points and the geographic flow, and constructing a network distance matrix based on this; step 2, calculating the similarity of each geographic flow under the network distance measurement, clustering the geographic flows according to flow similarity, comparing the flow similarity with the set clustering similarity threshold to determine whether different geographic flows belong to the same flow cluster, and generating geographic flow clustering results.
[0039] The beneficial effects of the embodiments of the present disclosure are as follows: (1) based on the fact that flows in real space are significantly dependent on road networks, and targeting the characteristics of geographic flow aggregation patterns under network constraints, a method for mining geographic flow aggregation patterns under network constraints is designed;
[0040] (2) The hierarchical clustering method is extended to perform cluster analysis on geographic flows, and a similarity measurement index of flows under network constraints is constructed to identify geographic flow clustering patterns more accurately and efficiently, solving the problem of cumbersome parameter selection in existing methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0042] Figure 1 A flowchart of a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering provided by an embodiment of the present disclosure;
[0043] Figure 2 A schematic diagram of a specific implementation process of a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering provided by an embodiment of the present disclosure;
[0044] Figure 3 A schematic diagram of the road network data overview provided by the embodiment of the present disclosure;
[0045] Figure 4 A schematic diagram of the geographical flow clustering results of a region provided by an embodiment of the present disclosure;
[0046] Figure 5 Flow pattern analysis result 1 of a partial area provided in an embodiment of the present disclosure;
[0047] Figure 6 This is the second flow pattern analysis result of a partial area provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0049] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0050] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0051] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0052] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples. However, one skilled in the art will appreciate that the aspects described can be practiced without these specific details.
[0053] By reviewing and summarizing existing research, we can find that the current research on geographical flow aggregation pattern detection methods still has the following limitations:
[0054] (1) Existing methods mainly identify flow patterns based on Euclidean distance, and using methods designed for planar flows to analyze network-constrained geographic flows may lead to incorrect interpretation of network-constrained geographic flow patterns;
[0055] (2) Existing methods for mining geographic flow clustering patterns have problems such as complex parameter selection process and low recognition rate for irregularly shaped clusters.
[0056] The embodiments of the present disclosure provide a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering. The method can be applied to geographic flow analysis processes in the fields of traffic planning, resource scheduling, etc.
[0057] See also Figure 1 , is a flow chart of a method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering provided by an embodiment of the present disclosure. Figure 1 and Figure 2 As shown, the method mainly includes the following steps:
[0058] Step 1: Match the starting and ending points of the geographic flow data with the road network data, then measure the network distance between the starting and ending points and the geographic flow, and construct a network distance matrix based on this;
[0059] Furthermore, the step 1 specifically includes:
[0060] Step 1.1: Build a geographic flow model and match the starting and ending points of the geographic flow data with the road network data based on the shortest distance between the point and the road segment. Obtain the road segment affiliation of each starting and ending point and the network distance between it and its adjacent nodes.
[0061] Step 1.2: Preprocess the road network data, break the intersections of the road sections to obtain nodes, and find the shortest network path distance between each node and other nodes until the distance between the node and other nodes is greater than the specified threshold. Traverse all nodes to obtain the road network node distance matrix.
[0062] Step 1.3: Calculate the distances between the starting points and the end points of different geographic flows by adding and taking the minimum sum. Calculate the geographic flow distances based on the network distance matrix. Obtain the network distance matrix between geographic flows by calculating the sum of the network distances between the starting points and the end points of the geographic flows.
[0063] Furthermore, the expression of the geographic flow model is
[0064] f={O,D,d S (O),d E (O),d S (D),d E (D)}
[0065] Among them, point O and point D represent the starting and ending coordinates of the geographic flow respectively, S represents the starting endpoint of the section where the starting and ending points are located, E is the ending endpoint of the section where the starting and ending points are located, and d represents the distance between the two points.
[0066] Furthermore, the expression of the shortest network path distance is:
[0067] d(p i ,p j )=min(d net (p i ,p j ))
[0068] Among them, d net (p i ,p j ) represents the road segment node p i With p j The network distance between the two nodes, min() represents the minimum value of all network path distances between the two nodes.
[0069] Furthermore, the expression for calculating the distance between the starting points and the end points of different geographical flows is:
[0070] d(O m ,O n )=d(O m ,p i )+d(O n ,p j )+d(p i ,p j )
[0071] Among them, d(O m ,p i ), d(O n ,p j ) refers to the network distance between the flow origin and the nearest node, d(p i ,p j ) represents the shortest network path distance between two nodes.
[0072] In specific implementation, a geographic flow is a directed line segment consisting of a starting point and an end point. The location data of the starting point O and the end point D can effectively express the information of the geographic flow. Step 1 builds a network flow model, matches the OD data with the road network data, and then measures the network distance between the OD points and the flow to construct a network distance matrix to implement network constraints. Specifically, it includes:
[0073] 1.1 Road network data matching
[0074] A geographic flow consists of its starting and ending points. A geographic flow model is constructed under network constraints. The model includes the locations of the flow's starting and ending points, as well as the distances between them and their nearest nodes. First, the starting and ending points of the geographic flow data are matched to the road network based on the shortest distance between the point and the road segment. The road segment affiliation of each starting and ending point is then determined. Furthermore, for the matched geographic flow data, the network distances between the flow's starting and ending points and their nearest nodes are calculated. The constructed geographic flow model is expressed as follows:
[0075] f={O,D,d S (O),d E (O),d S (D),d E (D)} (1)
[0076] Among them, point O and point D represent the starting and ending coordinates of the geographic flow respectively, S represents the starting endpoint of the section where the starting and ending points are located, E is the ending endpoint of the section where the starting and ending points are located, and d represents the distance between the two points.
[0077] 1.2 Road Network Node Distance Matrix
[0078] Preprocess the road network and break the intersections to obtain nodes. Based on the processed road network, find the shortest network path distance between each node and other nodes until the distance between the node and other nodes exceeds the specified threshold. The shortest network path distance is used as the distance between nodes, expressed as:
[0079] d(p i ,p j )=min(d net (p i ,p j )) (2)
[0080] where d net (p i ,p j ) represents the road segment node p i With p j The network distance between the two nodes, min() represents the minimum value of all network path distances between the two nodes.
[0081] 1.3 Calculating network distance
[0082] Then, the distances between the starting points and the end points of different geographical flows are calculated by adding and taking the minimum sum. For example, for the starting point O of flow m, m and the starting point O of stream n n The network distance between them is calculated as follows:
[0083] d(O m ,O n )=d(Om ,p i )+d(O n ,p j )+d(p i ,p j ) (3)
[0084] Where d(O m ,p i ), d(O n ,p j ) refers to the network distance between the flow origin and the nearest node, d(p i ,p j ) represents the shortest network path distance between two nodes. By calculating the network distances between the origin and destination points of a flow, a point network distance matrix can be constructed. Finally, flow distances are calculated based on the network distance matrix. The network distances between geographic flows are obtained by summing the network distances between the origin and destination points of the geographic flow.
[0085] Step 2: Calculate the similarity of each geographic flow under the network distance metric, cluster the geographic flows according to the flow similarity, compare the flow similarity with the set cluster similarity threshold to determine whether different geographic flows belong to the same flow cluster, and generate the geographic flow clustering results.
[0086] Based on the above embodiment, step 2 specifically includes:
[0087] Step 2.1: Initialize the original flow cluster and treat each geographic flow as a unique initial flow cluster;
[0088] Step 2.2, traverse each flow, first calculate the network distance between flow i and other flows according to the network distance matrix, and then obtain the k flows closest to it;
[0089] Step 2.3, construct a network flow model under network constraints and define the similarity between each geographical flow based on the network distance metric;
[0090] Step 2.4, for each geographic flow f i , traverse its flow neighbors f in turn j , to determine the similarity of geographical flows;
[0091] In step 2.5, the corresponding flow clusters are merged according to the similarity between the geographical flows, all the geographical flows are traversed and the geographical flow clustering results are generated.
[0092] Furthermore, the calculation formula of the similarity is:
[0093]
[0094] in, Indicates the network distance between the starting points and the end points of two flows, α indicates the length adjustment threshold, len i 、len j Represents geographic flow f i 、f j The length of the two flows is obtained by Euclidean distance, and min() means taking the minimum value of the length of the two flows.
[0095] Furthermore, the step 2.4 specifically includes:
[0096] Step 2.4.1, find the geographic flow f respectively i and f j Flow cluster C i and C j , and determine whether the two geographical flows belong to the same flow cluster;
[0097] Step 2.4.2: If the two geographies belong to different flow clusters, calculate the flow cluster C. i and C j similarity between
[0098] Step 2.4.3, if the flow cluster C i and C j Is the same flow cluster, then traverse to f i Repeat steps 2.4.1 and 2.4.2 for the next neighbor stream.
[0099] Furthermore, when the flow cluster contains more than one geographic flow, step 2.4.2 further includes:
[0100] Compute flow cluster C i The average coordinate of the starting point of all flows in O ave and the average coordinate of the end point D ave , and then traverse the starting position of all stream data in the entire data set and O ave The distance between them is obtained by looking up the distance from the average coordinate O ave The nearest point is taken as the starting point of the flow cluster center O cen Similarly, we get the center endpoint D of the flow cluster cen , thus we get the representative flow cluster C i Central flow f at the central position ci =(O cen ,D cen ), and similarly we get flow cluster C j The central flow f cj , and finally based on the central flow f ci With f cj The position and length information of f is calculated ci With f cj similarity.
[0101] In specific implementation, the present invention proposes an extended hierarchical clustering method under network constraints, defines and distinguishes the similarity of geographical flows under network distance measurement, clusters geographical flows according to flow similarity, and compares the flow similarity value with the set clustering similarity threshold to determine whether the flows belong to the same flow cluster.
[0102] 2.1 Initialize the original stream cluster
[0103] Each geographic flow is considered as a unique initial flow cluster. Each flow is traversed in sequence, and the geographic flow is assigned a corresponding flow cluster number in sequence. The result is the original flow cluster to which the flow belongs.
[0104] 2.2 Finding Stream Neighbors
[0105] Search for flow neighbors for all geographic flows, setting parameters to search k neighbors. Traverse each flow, first calculate the network distance between flow i and other flows based on the network distance matrix, and then use this to obtain the k closest flows.
[0106] 2.3 Flow Similarity Calculation
[0107] Geographical flow similarity means proximity in geographic space. The greater the flow similarity, the closer the distance between their geographical locations. Correspondingly, the greater the spatial difference of the flow, the less spatial similarity the two flows have and the farther apart they are in space. The similarity between flows depends on the length, angle, and location of the starting and ending points of the flows. When the distance between the starting points, the distance between the ending points, and the length of the flows are determined, the directional angle between the geographical flows will be restricted. And at the same directional angle, the longer the flow length, the larger the distance threshold between the starting and ending points of the flows. Therefore, when defining the similarity of flows, the distance between the starting and ending points and the flow length factors should be considered. A planar flow model is established under the Euclidean distance metric. In Euclidean space, two flows f i 、f j The spatial difference between the two is calculated as:
[0108]
[0109] Where α and β represent the threshold adjustment coefficients; It represents the distance between the starting points and the end points of two flows, which is obtained by Euclidean distance; Represents the flow f i 、f j The length of is obtained by Euclidean distance.
[0110] Based on the plane flow model and the flow similarity definition theory, this paper proposes to construct a network flow model under network constraints and define flow similarity based on network distance measurement. Flow similarity is measured by the network distance and flow length between the starting and ending points of two flows, which is called spatial difference. The greater the spatial difference, the smaller the flow similarity.i 、f j The spatial difference between the two is calculated as:
[0111]
[0112] in Indicates the network distance between the starting points and the end points of two flows; α indicates the length adjustment threshold; len i 、len j Represents the flow f i 、f j The length of the two flows is obtained by Euclidean distance; min() means taking the minimum value of the length of the two flows.
[0113] 2.4 Determining the Similarity of Flows
[0114] The similarity between two flows is represented by spatial dissimilarity, reflecting the geographic distance between them. Smaller spatial dissimilarity indicates greater flow similarity and spatial proximity, while smaller spatial dissimilarity indicates greater spatial distance. This paper proposes a method for setting a spatial dissimilarity threshold based on flow similarity, sequentially determining whether two flows are similar, and thus clustering flows.
[0115] For each flow f i , traverse its flow neighbors f in turn j . First find f i and f j Flow cluster C i and C j , and then determine whether the flow clusters they belong to are the same flow cluster. If C i and C j are different clusters, calculate C i and C j The spatial difference between ij If the spatial difference is less than 1, the two flows are similar; if the spatial difference is greater than 1, the flows are dissimilar.
[0116] For a flow cluster containing more than one flow, the spatial difference of the flow cluster is used to determine the similarity of the flow cluster. First, calculate the flow cluster C i The average coordinate of the starting point of all flows in O ave and the average coordinate of the end point D ave Then traverse the starting position of all stream data in the entire data set and O ave The distance between them is obtained by looking up the distance from the average coordinate O ave The nearest point is taken as the starting point of the flow cluster center O cen Similarly, we get the center endpoint D of the flow cluster cen . Get the representative flow cluster C i Central flow f at the central position ci =(O cen,D cen ), and similarly we get flow cluster C j The central flow f cj , and finally based on the central flow f ci With f cj The position and length information of f is calculated ci With f cj The similarity between the flow clusters is obtained by comparing it with the threshold 1.
[0117] 2.5 Stream Cluster Merging
[0118] Based on the similarity determined in the previous step, two similar flow clusters are merged. i and f j Flow cluster C i and C j The spatial difference between them is less than 1, then cluster C j Members join cluster C i , then delete cluster C j The tag is merged.
[0119] 2.6 Level Traversal
[0120] Previous step flow f i and f j Merge to form a new flow cluster C i Afterwards, based on f j Repeat the previous steps:
[0121] ①Traverse and calculate all other flows and f j The flow network distance between them is obtained by looking up f j The k nearest neighbors of
[0122] ② Traverse f in sequence j All neighbor flows of f j Whether the flow cluster to which its neighbor flows belong is the same;
[0123] ③ If the two flows belong to different flow clusters, calculate the spatial difference between the flow clusters and determine the similarity;
[0124] ④ If the spatial difference between flow clusters is less than 1, the flow clusters are similar, the flow clusters are merged, and a new round of hierarchical traversal is performed based on the newly added neighboring flows; if the spatial difference is greater than 1, the flow clusters are not similar, and the f is continued to be judged. j The next neighbor flow is continued until the traversal is completed.
[0125] The network-constrained geographic flow agglomeration pattern mining method based on hierarchical clustering provided in this embodiment is designed to mine geographic flow agglomeration patterns under network constraints based on the fact that flows in real space have a significant dependence on road networks and the characteristics of geographic flow agglomeration patterns under network constraints. The hierarchical clustering method is extended to perform cluster analysis on geographic flows, and a similarity measurement index of flows under network constraints is constructed to more accurately and efficiently identify geographic flow agglomeration patterns, thereby solving the problem of cumbersome parameter selection in existing methods.
[0126] The present invention will be further described below through an embodiment, using a city's road network data and taxi trajectory data to illustrate the specific implementation of the present invention:
[0127] 1) In the embodiment, Beijing is selected as the research area, and the data used are road network data and taxi trajectory data. The road network data is shp type data, and the taxi trajectory data is txt data. The distribution of road network data and geographic flow data is as follows: Figure 3 As shown, the black areas in (a) represent the study areas A and B, and the lines in (b) and (c) represent the geographical flows.
[0128] 2) Road network data matching. First, pre-process the Beijing road network data, break the road sections according to the intersections, and obtain the nodes of the road sections. Then calculate the network distance between node i and all other nodes until the distance between the node and other nodes is greater than the specified threshold (the maximum threshold of the path distance to be calculated is set to 5000 in this example). Here, when there are multiple values for the network distance from a node to other nodes, the shortest distance is used as the distance to be calculated. Then traverse the next node and calculate its network distance with all nodes until the threshold is reached. After all nodes are traversed, the road network node distance matrix can be obtained.
[0129] At the same time, the shortest distance between the starting and ending points of the geographic flow data and the surrounding road network is calculated. The starting and ending points are matched with the road segments according to the shortest distance between the point and the road segment. Then the network distance between each starting point or end point and the node of the road segment where it is located is calculated. The distance between the starting point O and the starting endpoint S of the road segment where it is located is expressed as d S (O), the distance between it and the end point E of the road segment is d E (O), and the distance between the end point D and the starting point S of the section is d S (D), the distance from the end point E of the road segment is d E (D).
[0130] 3) Construct a network distance matrix. Based on the distances between network nodes and the distances between the starting and ending points to the road segment nodes obtained in the previous step of road network matching, the network distances between the starting and starting points and the end points of two different geographical flows are obtained by summing and taking the minimum value. For example, for the starting point O of flow m,m and the starting point O of stream n n The network distance between them is calculated as follows:
[0131] d(O m ,O n )=d(O m ,p i )+d(O m ,p j )+d(p i ,p j ) (3)
[0132] where p i and p j The starting point of the geographical flow is O m and O n The node of the road section, d(O m ,p i ), d(O n ,p j ) refers to the network distance between the flow starting point and the adjacent road segment nodes, d(p i ,p j ) represents the shortest network path distance between two road segment nodes.
[0133] By calculating the network distance between the starting and ending points of a geographic flow, a point network distance matrix can be constructed. Finally, the distance between geographic flows is calculated based on the point network distance matrix. The specific method is to calculate the sum of the network distances between the starting points and the ending points of the geographic flow to obtain the network distance between geographic flows. The formula is as follows:
[0134] d(f m ,f n )=d(O m ,O n )+d(D m ,D n )
[0135] Among them, d(f m ,f n ) represents the geographic flow f m and f n The network distance between m ,O n ) and d(D m ,D n ) represent the distance between the starting points O and the distance between the end points D of the two geographical flows respectively.
[0136] 4) Traverse the flow data. First, initialize the geographic flow data into an original flow cluster. Read each geographic flow in sequence, sort them in the order they were read, and label them with a flow cluster ID, so that each geographic flow serves as a unique initial flow cluster. Then, based on the network distances between geographic flows calculated in the previous step, find the flow neighbors of all geographic flows. Set the number of flow neighbors to be found to k, traverse each flow, calculate the network distance between it and all other flows, and sort them from closest to farthest distance to find the k closest flow neighbors to each flow.
[0137] 5) Calculate geographic flow similarity. Geographic flow similarity means proximity in geographic space. The greater the flow similarity, the closer the distance between their geographical locations. Correspondingly, the greater the spatial difference in the flow, the less spatial similarity the two flows have and the farther apart they are in space. The similarity between geographic flows depends on the length, angle, and location of the starting and ending points of the flow. When the distance between the starting points, the distance between the ending points, and the length of the flow are determined, the directional angle between the geographic flows is restricted. And at the same directional angle, the longer the flow length, the larger the distance threshold between the starting and ending points of the flow. Therefore, when defining the similarity of flows, the distance between the starting and ending points and the flow length factors should be considered.
[0138] Based on the plane flow model and the flow similarity definition theory, this paper constructs a network flow model under network constraints and defines flow similarity based on the network distance metric. Flow similarity is measured by the network distance and flow length between the starting and ending points of two flows, which is called spatial difference. The greater the spatial difference, the smaller the flow similarity. i 、f j The spatial difference between the two is calculated as:
[0139]
[0140] in Indicates the network distance between the starting points and the end points of two flows; α indicates the length adjustment threshold; len i 、len j Represents the flow f i 、f j The length of the two flows is obtained by Euclidean distance; min() means taking the minimum value of the length of the two flows.
[0141] 6) Determine geographic flow similarity. Geographic flow similarity is represented by spatial differences, reflecting the distance between two flows in geographic space. The smaller the spatial difference, the greater the geographic flow similarity, the closer they are in space, and vice versa. Therefore, to determine geographic flow similarity, we must first calculate its spatial difference. For each flow f i , based on the k flow neighbors obtained in the previous step, traverse its flow neighbors f in turn j, to judge the similarity of geographical flows. The specific steps are: ① Find the geographical flows f i 、f j Flow cluster C i and C j , and determine whether the two geographic flows belong to the same flow cluster; ② If the two geographic flows belong to different flow clusters, use formula (4) to calculate the flow cluster C i and C j The spatial difference of the flow clusters between them is used to judge the similarity; ③ If the flow cluster C i and C j Is the same flow cluster, then traverse to f j Repeat steps ① and ② for the next neighbor flow.
[0142] Specifically, in step ②, when calculating the spatial difference between two flow clusters, if the flow cluster contains only one geographical flow, the starting point coordinates, end point coordinates and length of the geographical flow are directly used to calculate the spatial difference; if the flow cluster contains more than one geographical flow, the flow cluster C needs to be calculated first. i The average coordinate of the starting point of all flows in O ave and the average coordinate of the end point D ave The starting position of all stream data in the entire data set is O ave The distance between them is obtained by looking up the distance from the average coordinate O ave The nearest point is taken as the starting point of the flow cluster center O cen Similarly, we get the center endpoint D of the flow cluster cen . Get the representative flow cluster C i Central flow f at the central position ci =(O cen ,D cen ), and similarly we get flow cluster C j The central flow f cj , and finally based on the central flow f ci With f cj The position and length information of f is calculated ci With f cj Similarity, used to represent the flow cluster C i and C j similarity.
[0143] 7) Clustering to obtain flow clusters. Based on the spatial difference of the flow clusters obtained in the previous step, if the calculated spatial difference is greater than 1, the two geographical flows are not similar, and the next neighbor flow is traversed to repeat steps (5) and (6); if the spatial difference of the flow clusters is less than 1, the geographical flows are similar, and the flow clusters can be merged. The specific operation is: merge the neighbor flow f j The members of the flow cluster to which it belongs are added to f i The flow cluster to which it belongs updates the flow cluster label and deletes the label of the neighboring flow cluster.
[0144] 8) Hierarchical traversal. Based on the previous step, the geographical flow f i With f j Merge to form a new flow cluster C i After that, the merged neighbor flow f j Repeat steps (4), (5), and (6) for the new basis, specifically including:
[0145] ① Traverse and calculate the flow network distance between all other flows and fj, and find the k nearest neighbors of fj;
[0146] ② Traverse f in sequence j All neighbor flows of f j Whether the flow cluster to which its neighbor flows belong is the same;
[0147] ③ If the two flows belong to different flow clusters, calculate the spatial difference between the flow clusters and determine the similarity;
[0148] ④ If the spatial difference between flow clusters is less than 1, the flow clusters are similar, the flow clusters are merged, and a new round of hierarchical traversal is performed based on the newly added neighboring flows; if the spatial difference is greater than 1, the flow clusters are not similar, and the f is continued to be judged. j The next neighbor flow is continued until the traversal is completed.
[0149] After all geographic flows are traversed, clustering is completed and a highly summarized clustering result of geographic flow data is obtained. Clustering analysis of geographic flows can extract the characteristic information hidden in the data set. The clustering results are as follows: Figure 4 As shown in Figure 2, (a) and (b) represent the geographic flow clustering results for different regions. The lines in the figure represent geographic flow data, and flows of different colors belong to different flow clusters.
[0150] 9) Comparative analysis of geographical environment. Comparing the geographical flow patterns obtained by cluster analysis with the actual geographical environment, we can explore the areas where the origin and destination of flow clusters are concentrated in the actual environment and explore the strong interactions between different areas within the city. This can be used to analyze and understand human travel patterns and the driving factors behind the patterns. The comparative analysis results are as follows: Figure 5 and Figure 6 shown.
[0151] The units involved in the embodiments described in this disclosure may be implemented by software or hardware.
[0152] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof.
[0153] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A method for mining network-constrained geographic flow clustering patterns based on hierarchical clustering, characterized by: include: Step 1: Match the starting and ending points of the geographic flow data with the road network data, then measure the network distance between the starting and ending points and the geographic flow, and construct a network distance matrix based on this; The step 1 specifically includes: Step 1.1: Construct a geographic flow model and match the starting and ending points of the geographic flow data with the road network data based on the shortest distance between the point and the road segment, and obtain the road segment belonging to each starting and ending point and the network distance between it and its nearby nodes. The expression of the geographic flow model is: f={O,D,d S (O),d E (O),d S (D),d E (D)} Wherein, point O and point D represent the coordinates of the starting and ending points of the geographic flow respectively, S represents the starting endpoint of the segment where the starting and ending points are located, E represents the ending endpoint of the segment where the starting and ending points are located, and d represents the distance between the two points; Step 1.2: Preprocess the road network data, break the intersections of the road sections to obtain nodes, and find the shortest network path distance between each node and other nodes until the distance between the node and other nodes is greater than the specified threshold. Traverse all nodes to obtain the road network node distance matrix. Step 1.3: Calculate the distances between the starting points and the ending points of different geographic flows by adding and taking the minimum sum. Calculate the geographic flow distances based on the network distance matrix. Obtain the network distance matrix between geographic flows by calculating the sum of the network distances between the starting points and the ending points of the geographic flows. Step 2: Calculate the similarity of each geographic flow under the network distance metric, cluster the geographic flows according to the flow similarity, compare the flow similarity with the set cluster similarity threshold to determine whether different geographic flows belong to the same flow cluster, and generate the geographic flow clustering results; The step 2 specifically includes: Step 2.1: Initialize the original flow cluster and treat each geographic flow as a unique initial flow cluster; Step 2.2, traverse each flow, first calculate the network distance between flow i and other flows according to the network distance matrix, and then obtain the k flows closest to it; Step 2.3, construct a network flow model under network constraints and define the similarity between each geographical flow based on the network distance metric; Step 2.4: For each geographic flow fi, traverse its flow neighbors fj in turn to determine the geographic flow similarity; In step 2.5, the corresponding flow clusters are merged according to the similarity between the geographical flows, all the geographical flows are traversed and the geographical flow clustering results are generated.
2. The method according to claim 1, characterized in that , the expression of the shortest network path distance is d(p i ,p j )=min(d net (p i ,p j )) Among them, d net (p i ,p j ) represents the road segment node p i With p j The network distance between the two nodes, min() represents the minimum value of all network path distances between the two nodes.
3. The method according to claim 2, characterized in that ,The expression for calculating the distance between the starting and starting points and the end and end points of different geographical flows is d(O m ,O n )=d(O m ,p i )+d(O n ,p j )+d(p i ,p j ) Among them, d(O m ,p i ), d(O n ,p j ) refers to the network distance between the flow origin and the nearest node, d(p i ,p j ) represents the shortest network path distance between two nodes.
4. The method according to claim 3, characterized in that , the calculation formula of the similarity is in, Indicates the network distance between the starting points and the end points of two flows, α indicates the length adjustment threshold, len i 、len j It represents the length of geographic flows fi and fj, which are obtained by Euclidean distance. min() means taking the minimum value of the length of the two flows.
5. The method according to claim 4, characterized in that , the step 2.4 specifically includes: Step 2.4.1, find the flow cluster C to which the geographic flows fi and fj belong respectively i and Cj, and determine whether the two geographical flows belong to the same flow cluster; Step 2.4.2: If the two geographies belong to different flow clusters, calculate the flow cluster C. i and the similarity between Cj; Step 2.4.3, if the flow cluster C i If Cj and Cj are the same flow cluster, traverse to the next neighbor flow of fi and repeat steps 2.4.1 and 2.4.
2.
6. The method according to claim 5, characterized in that When the flow cluster contains more than one geographic flow, the step 2.4.2 further includes: Compute flow cluster C i The average coordinate of the starting point of all flows in O ave and the average coordinate of the end point D ave , and then traverse the starting position of all stream data in the entire data set and O ave The distance between them is obtained by looking up the distance from the average coordinate O ave The nearest point is taken as the starting point of the flow cluster center O cen Similarly, we get the center endpoint D of the flow cluster cen , thus we get the representative flow cluster C i The central flow at the center position fci=(O cen ,D cen ), similarly, the center flow fcj of the flow cluster Cj is obtained, and finally the similarity between fci and fcj is calculated based on the position and length information of the center flows fci and fcj.
Citation Information
Patent Citations
Geographic flow method for expanding kernel density space analysis
CN114020785A
Massive high-dimensional AIS trajectory data clustering method
WO2023029461A1