K-center problem solving method using small-batch data updating
By selecting the initial center point set from the full set in the solution of the k-center problem and gradually optimizing it in the way of small batch data updates, the problems of high time complexity and large computing resource occupancy in the existing methods are solved, and efficient Solve the k-center problem.
Patent Information
- Application Number
- CN202411292070.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-02-11
AI Technical Summary
The existing k-center problem solving methods have high time complexity, occupy large computing resources, and it is difficult to effectively process large-scale data.
The center point set is initialized by selecting any k points from the entire set, and then the remaining points in the entire set are divided into several batches, and only one batch of points is used to update the center point set at a time until all points are updated.
It reduces the time complexity to O(n), reduces the use of computing resources, and can efficiently handle k-center problems in streaming data.
Smart Images

Figure CN119415984A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data updating, and more specifically, to a method for solving a k-center problem using small batch data updating. Background Art
[0002] The k-center problem is to find k center points in the full set P to form the center point set C, so that the maximum distance between any point in the full set P and the nearest point in the center point set C is minimized. The points in the center point set C obtained by solving evenly cover all points in the full set P, so the center point set C is a small and representative subset of the full set P. In applications, using the center point set C instead of the full set P for related operations will greatly reduce the amount of data and improve the calculation speed.
[0003] However, if the k-center problem is solved directly, the time complexity of the algorithm is high and the algorithm is difficult to solve. The existing greedy k-center method needs to repeatedly traverse the data in the entire set, which occupies a large amount of computing resources. Therefore, this application proposes a method for solving the k-center problem with low time complexity and small computing resources. Summary of the invention
[0004] The object of the present invention is to provide a method for solving the k-center problem using small batch data updates, which method has low time complexity and occupies small computing resources.
[0005] The above technical purpose of the present invention is achieved through the following technical scheme: a method for solving the k-center problem using small batch data updates, wherein the method arbitrarily selects k points from the entire set to initialize the center point set, and then divides the remaining points in the entire set into several batches, and each time only one batch of points is used to update the center point set, and the final center point set is obtained after the update is completed.
[0006] The present invention is further configured as follows: the k-center problem is expressed by a mathematical formula:
[0007]
[0008] Where P = {p1, p2, ..., p n} is the complete set, C={c1,c2,…,c k} is the center point set, p is a point in the full set P, c is a point in the center point set C, and d(p,c) represents the distance between point p and point c;
[0009] The meaning of the above mathematical formula is: for the entire set P, calculate the maximum distance from any point in the entire set P to the nearest point in its subset, and the subset that can minimize the maximum value is the obtained center point set C.
[0010]
[0011] Then R represents the maximum distance from any point in the entire set P to the nearest point in its subset.
[0012] The present invention is further configured as follows: k points are randomly selected from the full set P to initialize the central point set C, and the points used for updating in the current batch are X = {x1, x2, ..., x k}, calculate the maximum value of the closest distance from a point in X to a point in the center point set C:
[0013]
[0014] And the point x in X that corresponds to this maximum:
[0015]
[0016] At the same time, calculate the minimum point spacing of the points in the center point set C:
[0017]
[0018] And the point corresponding to the minimum point spacing:
[0019]
[0020] when
[0021] d max (X,C)>|C| min (7)
[0022] , replace c1 with x: add x to the center point set C, and delete c1 from the center point set C; then repeat the process from formula (3) to formula (6) until formula (7) fails, thus completing a round of updates of the center point set C; thereafter, update the center point set C again with a new batch of points in the full set P as the subset X, completing multiple rounds of updates of the center point set C; when the center point set C is updated with all the points in the full set P, the final center point set C is obtained, and the k-center problem is solved.
[0023] The present invention also provides a specific application scenario of the k-center problem solving method:
[0024] (1) Layout of public facilities. The points obtained by k-center clustering are evenly distributed in the entire set. Based on the results of k-center clustering, relevant departments can reasonably plan the layout of public facilities (such as schools, hospitals, parks, etc.) to meet the needs of residents in various areas.
[0025] (2) Monitoring of abnormal financial behavior. The center point set obtained by k-center clustering evenly covers the points in the entire set. When there are abnormal points in the entire set, in order to ensure the coverage of the abnormal points, the abnormal points are more likely to enter the center point set than normal points. Therefore, the k-center clustering method can be used to monitor abnormal financial behaviors such as whether bank accounts have money laundering behavior and whether POS machines have cash-out behavior.
[0026] (3) Analysis of customer consumption behavior. The center point set obtained by k-center clustering divides the points in the whole set into k categories. The data within the categories are more similar, and the data between categories are more different. Therefore, in the retail and e-commerce fields, enterprises can use the k-center method to perform k-center clustering on multidimensional data such as customer purchase history, consumption frequency, and consumption amount, and divide customers into different groups, so as to better understand the behavior patterns of different customer groups and formulate more effective marketing strategies.
[0027] In summary, the present invention has the following beneficial effects:
[0028] (1) The time complexity of the method of the present invention is O(n), which is low;
[0029] (2) The method of the present invention only needs to use a small batch of data from the entire set for calculation each time, which occupies a small amount of computing resources;
[0030] (3) The method of the present invention only needs to use part of the data in the full set each time, so as to construct the center point set of the streaming data and solve the k-center problem of the streaming data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a schematic diagram of the k-center problem in an embodiment of the present invention;
[0032] Figure 2 Schematic diagram of a method for solving a k-center problem using small batch data update in an embodiment of the present invention;
[0033] Figure 3 It is the result of solving the k-center problem of two-dimensional data in the embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following is combined with Figure 1-3 The present invention is described in further detail.
[0035] Example: A method for solving the k-center problem using small batch data updates, such as Figure 1-3 As shown, the k-center problem is expressed mathematically as:
[0036]
[0037] Where P = {p1, p2, ..., p n} is the complete set, C={c1,c2,…,c k} is the central point set, p is a point in the full set P, c is a point in the central point set C, and d(p,c) represents the distance between point p and point c. The meaning of formula (1) is: for the full set P, calculate the maximum distance from any point in the full set P to the nearest point in its subset, and the subset that can minimize the maximum value is the central point set C.
[0038]
[0039] Then R represents the maximum distance from any point in the full set P to the nearest point in its subset. Combining formula (1) and formula (2), it can be seen that solving the k-center problem is the process of finding the subset C of the full set P that minimizes the R value.
[0040] Figure 1 This intuitively demonstrates the k-center problem. Figure 1 In each subgraph of , all 22 points constitute the full set P, and the 4 red points represent a subset of the full set P. Figure 1 -b has the smallest R value. According to formula (1), Figure 1 The set of red points in -b is the final center point set C. It can be seen that the points in the center point set C evenly cover all the points in the full set P.
[0041] However, the k-center problem is difficult to solve directly. The most direct way to solve the k-center problem is to find all subsets C1, C2, ... of the set P that contain k points, calculate the maximum distance between any point in the set P and the nearest point in each subset, and the subset corresponding to the smallest value among the maximum values is the center point set C. When the number of points in the set P is n, the number of subsets of the set P that contain k points is When this method is used to solve the k-center problem, the time complexity of the algorithm is O(n k ), which is difficult to solve.
[0042] The existing greedy k-center method solves the k-center problem in the following process: first, select a point p1 from the entire set P, then select the point p2 that is farthest from p1 in the entire set P, then select the point p3 that is farthest from p1 and p2, then select the point p4 that is farthest from p1, p2 and p3, and so on, until k points are found. This set of k points is the center point set C obtained by the greedy k-center method. It can be seen that the greedy k-center method needs to repeatedly traverse the data in the entire set P. When the amount of data in the entire set P is huge, this method occupies a large amount of computing resources.
[0043] Therefore, the present invention discloses a method for solving the k-center problem using small batch data update. The method first randomly selects k points from the entire set to initialize the center point set, then divides the remaining points in the entire set into several batches, and only uses a batch of points to update the center point set each time, and obtains the final center point set after the update is completed. The update process is described as follows.
[0044] Randomly select k points from the full set P to initialize the central point set C. Let the points used for updating in the current batch be X = {x1, x2, ..., x k}, calculate the maximum value of the closest distance from a point in X to a point in the center point set C:
[0045]
[0046] And the point x in X that corresponds to this maximum:
[0047]
[0048] At the same time, calculate the minimum point spacing of the points in the center point set C:
[0049]
[0050] And the point corresponding to the minimum point spacing:
[0051]
[0052] when
[0053] d max (X,C)>|C| min (7)
[0054] When x is added to the center point set C, c1 is deleted from the center point set C. Then, the process from formula (3) to formula (6) is repeated until formula (7) fails to hold, thus completing a round of updates to the center point set C. After that, a new batch of points in the full set P is used as the subset X to update the center point set C again, completing multiple rounds of updates to the center point set C. After the center point set C is updated with all the points in the full set P, the final center point set C is obtained, and the k-center problem is solved. Figure 2 Schematic diagram of the method of the present invention.
[0055] The method of the present invention is implemented in a programming language to solve the k-center problem of two-dimensional data. The results obtained are as follows: Figure 3 As shown. All the points in the figure constitute the universal set P, which has 10,000 points in total; all the red points in the figure represent the central point set C, which has 200 points in total. Figure 3 It can be seen that the points in the central point set C obtained by the method of the present invention evenly cover all the points in the full set P.
[0056] The specific application scenarios of the above k-center problem solving method are:
[0057] (1) Layout of public facilities. The points obtained by k-center clustering are evenly distributed in the entire set. Based on the results of k-center clustering, relevant departments can reasonably plan the layout of public facilities (such as schools, hospitals, parks, etc.) to meet the needs of residents in various areas.
[0058] (2) Monitoring of abnormal financial behavior. The center point set obtained by k-center clustering evenly covers the points in the entire set. When there are abnormal points in the entire set, in order to ensure the coverage of the abnormal points, the abnormal points are more likely to enter the center point set than normal points. Therefore, the k-center clustering method can be used to monitor abnormal financial behaviors such as whether bank accounts have money laundering behavior and whether POS machines have cash-out behavior.
[0059] (3) Analysis of customer consumption behavior. The center point set obtained by k-center clustering divides the points in the whole set into k categories. The data within the categories are more similar, and the data between categories are more different. Therefore, in the retail and e-commerce fields, enterprises can use the k-center method to perform k-center clustering on multidimensional data such as customer purchase history, consumption frequency, and consumption amount, and divide customers into different groups, so as to better understand the behavior patterns of different customer groups and formulate more effective marketing strategies.
[0060] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A method for solving the k-center problem using small batch data updates, characterized by: The method randomly selects k points from the entire set to initialize the central point set, and then divides the remaining points in the entire set into several batches. Each time, only one batch of points is used to update the central point set, and the final central point set is obtained after the update is completed.
2. The method for solving the k-center problem using small batch data update according to claim 1, characterized in that: The k-center problem is expressed mathematically as follows: Where P = {p1, p2, ..., p n } is the complete set, C={c1,c2,…,c k } is the center point set, p is a point in the full set P, c is a point in the center point set C, and d(p,c) represents the distance between point p and point c; The meaning of the above mathematical formula is: for the whole set P, calculate the maximum value of the distance from any point in the whole set P to the nearest point in its subset, and the subset that can minimize the maximum value is the obtained center point set C, denoted by Then R represents the maximum distance from any point in the entire set P to the nearest point in its subset.
3. The method for solving the k-center problem using small batch data update according to claim 2, characterized in that: Randomly select k points from the full set P to initialize the central point set C, and set the points used for updating in the current batch to be X = {x1, x2, ..., x k }, calculate the maximum value of the closest distance from a point in X to a point in the center point set C: And the point x in X that corresponds to this maximum: At the same time, calculate the minimum point spacing of the points in the center point set C: And the point corresponding to the minimum point spacing: when d max (X,C)>|C| min (7) , replace c1 with x: add x to the center point set C and delete c1 from the center point set C; Then, the process from formula (3) to formula (6) is repeated until formula (7) fails to hold, thus completing one round of updating of the center point set C. Thereafter, a new batch of points in the full set P is used as the subset X to update the center point set C again, completing multiple rounds of updating of the center point set C. When the center point set C is updated with all the points in the full set P, the final center point set C is obtained, and the k-center problem is solved.
4. The application of the method for solving the k-center problem according to any one of claims 1 to 3, characterized in that: The method can be applied to the following scenarios: (1) Layout of public facilities: The points obtained by k-center clustering are evenly distributed in the entire set. Based on the results of k-center clustering, relevant departments can reasonably plan the layout of public facilities to meet the needs of residents in each area; (2) Monitoring of abnormal financial behavior: The center point set obtained by k-center clustering evenly covers all points in the whole set. When there are abnormal points in the whole set, in order to ensure the coverage of the abnormal points, the abnormal points are more likely to enter the center point set than normal points. Therefore, the k-center clustering method can be used to monitor whether bank accounts have money laundering behavior, whether POS machines have cash-out behavior, and other abnormal financial behaviors. (3) Analysis of customer consumption behavior: The center point set obtained by k-center clustering divides all points in the set into k categories. The data within a category are more similar, and the data between categories are more different. Therefore, in the retail and e-commerce fields, companies can use the k-center method to perform k-center clustering on the multidimensional data consisting of customers' purchase history, consumption frequency, and consumption amount, and divide customers into different groups, so as to better understand the behavior patterns of different customer groups and formulate more effective marketing strategies.