A Rectangular Cartogram Generation Method

By using objective function optimization and greedy algorithm solution in the rectangular Cartogram generation, combined with the simulated annealing algorithm, the problems of low automation and insufficient topological accuracy in the rectangular Cartogram generation process are solved, and efficient and accurate rectangular segmentation map generation is achieved.

CN114862986BActive Publication Date: 2024-10-01Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210575084.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2024-10-01
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

The low degree of automation and complex steps in the rectangular Cartogram generation process make it difficult to reconcile data accuracy, geographical accuracy and topological accuracy. The existing algorithm cannot obtain the optimal layout, has limitations in applicable objects, has many topological errors, and has poor recognizability. Difference.

Method used

By obtaining the initial rectangular layout, establishing a plane coordinate system, extracting the relationship between the rectangle and free variables, establishing an objective function to optimize the rectangular layout, using greedy algorithm and simulated annealing algorithm to solve the objective function, and adding disturbance and constraint conditions to improve algorithm efficiency. Ensure planarity and topological constraints.

Benefits of technology

It achieves efficient generation of rectangular segmentation diagrams, can truly reflect the distribution of thematic data values, improves the automation and recognition of the algorithm, reduces topological errors, and obtains the optimal layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862986B_ABST
    Figure CN114862986B_ABST
Patent Text Reader

Abstract

The present invention relates to a rectangular cartogram generation method, and belongs to the technical field of data visualization. The present invention establishes a connection between thematic data values ​​and rectangular layouts by extracting free variables and deriving an objective function, uses the objective function as an evaluation of the rectangular layout, converts the transformation problem from the rectangular layout to the rectangular cartogram into an optimization problem of the objective function, and uses a greedy algorithm and a simulated annealing algorithm to solve the problem. When solving the problem, the topological constraints and geographical constraints of the layout are implicitly included in the extraction of free variables and the addition of disturbances, which effectively reduces the calculation amount of the objective function and improves the efficiency of the algorithm. The obtained rectangular segmentation map can truly reflect the distribution of thematic data values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a rectangular Cartogram generation method, and belongs to the technical field of data visualization. Background Art

[0002] The explosive growth of data has led to a demand for new visualization methods and automated construction tools. How to intelligently transform massive geospatial data into easy-to-understand information to facilitate knowledge acquisition and expression has become a hot topic in geospatial data visualization research in recent years. Traditional geospatial data representation methods focus on expressing accurate geographic locations. Even if thematic information is superimposed, it is limited to the geographic coordinate framework, requiring users to analyze more irrelevant information when acquiring knowledge. In this context, cognitively appropriate geospatial data visualization methods, such as topological maps and network maps, have been studied and applied.

[0003] Among the visualization methods of geospatial data suitable for cognition, Cartogram (statistical map) is a representation method corresponding to the mental map in our brain, which is suitable for the cognitive expression of location-specific information. The simplified and deformed characteristics of Cartogram can quickly change the public's traditional cognition of the geographical world, providing the public with a new perspective on the world, and its novel and unique appearance is more likely to attract people's attention. Cartogram has played an important role in population trend analysis and natural disaster prediction.

[0004] Rectangular Cartogram is a branch of Cartogram, belonging to simple continuous Cartogram, which uses simple rectangles to represent complex outer boundaries and regions in the map. Using the same graphics to represent different entities eliminates the differences caused by geographical boundaries, provides space for the display of data characteristics, and helps to identify the differences in thematic data. At the same time, as a continuous Cartogram, its expression takes into account the topological relationship between regions, and the expression is rich and novel. The use of rectangular cartogram can be traced back to the 1880s, but it was not until 1934 that Raisz gave the first formal definition of rectangular cartogram and hand-painted the rectangular cartogram of the census at that time. More than 80 years later, in 2004, van Kreveld et al. and Heilmann et al. respectively published the automatic generation algorithm of rectangular cartogram. The construction methods of rectangular cartogram can be divided into two categories. One is the construction algorithm based on rectangular segmentation map, which is based on the rectangular segmentation map generated by the plane layout algorithm. The other type is the heuristic construction algorithm, which directly uses the geographic information provided by the original map, sets the constraint function according to the characteristics of the rectangular cartogram, and then uses the constraint function to heuristically construct the rectangular cartogram, such as the linear movement algorithm, the quasi-linear parsing algorithm, etc. This method is simple in theory and has fewer steps, but it does not fully utilize the original map information, resulting in more topological errors and poor recognizability.

[0005] In view of the shortcomings of the above two types of algorithms, some scholars have improved many aspects of the existing generation methods, such as abstracting the problem into a linear programming problem; using genetic algorithms to select the optimal layout; adding ocean rectangular blocks to correct topological relationships to improve the overall visualization of the map; describing the process of solving rectangular layout as an integer mixed linear programming model; constructing a rectangular domain Cartogram, and obtaining a rectangular Cartogram by adding horizontal and vertical constraints on each edge. In general, the construction of rectangular Cartogram still has the following problems: First, it is difficult to reconcile data accuracy, geographic accuracy, and topological accuracy, and the obtained rectangular Cartogram has poor recognizability, the algorithm has a low degree of automation, and the applicable objects are limited; second, the two main existing construction methods have their own shortcomings, and the heuristic construction algorithm does not fully utilize the original map information, resulting in more topological errors and poor recognizability; the algorithm based on the rectangular segmentation map requires more preprocessing work and the steps are cumbersome; third, the existing algorithm cannot obtain the optimal layout. Summary of the invention

[0006] The purpose of the present invention is to provide a rectangular cartogram generation method to solve the problems of low automation and complex process in the current rectangular segmentation map generation process.

[0007] In order to solve the above technical problems, the present invention provides a rectangular Cartogram generation method, which comprises the following steps:

[0008] 1) obtaining an initial rectangular layout of the target object, establishing a plane coordinate system on the initial rectangular layout, making two coordinate axes of the plane coordinate system parallel to two right-angled sides of the rectangles in the initial rectangular layout, extracting common sides according to the coordinate values ​​of each rectangle in the initial rectangular layout, determining the relationship between each rectangle and the free variable, and using the coordinate values ​​of the four sides of each rectangle in the initial rectangular layout as the initial values ​​of the free variable;

[0009] 2) Count the difference between the area of ​​each rectangle in the rectangular layout and the ideal area determined by the thematic statistical value represented by the rectangle, and take the sum of the absolute values ​​of the difference between the area of ​​each rectangle and the corresponding ideal area as the objective function, so as to establish the objective function with free variables as variables;

[0010] 3) Taking the planarity of the free variables as a constraint condition, solving the objective function, obtaining the free variable value that can make the objective function obtain the minimum value, and the rectangular layout corresponding to the free variable value is the final rectangular segmentation map.

[0011] The present invention establishes a connection between thematic data values ​​and rectangular layouts by extracting free variables and deriving an objective function, takes the objective function as an evaluation of the rectangular layout, and converts the transformation problem from the rectangular layout to the rectangular cartogram into an optimization problem of the objective function. When solving the problem, the topological constraints and geographical constraints of the layout are implicitly included in the extraction of free variables, thereby improving the efficiency of the algorithm. The obtained rectangular segmentation map can truly reflect the distribution of thematic data values.

[0012] Furthermore, the step 3) adopts a greedy algorithm to solve the objective function.

[0013] The present invention utilizes the greedy algorithm iteration and utilizes the objective function to gradually correct the initial value of the free variable so that the area of ​​the rectangle approaches the ideal value, and can quickly realize the solution of the objective function.

[0014] Furthermore, in step 3), when the greedy algorithm is used to solve the objective function, a simulated annealing algorithm is used to make the greedy algorithm exit the loop of selecting only the current optimal solution, so as to obtain the global optimal solution of the objective function.

[0015] After adding disturbance, the error may become smaller or larger. In the greedy algorithm, only the disturbance that reduces the error is selected. At this time, only the local minimum can be obtained. The present invention uses the random function in the simulated annealing algorithm to change the strategy of the greedy algorithm to only select the current optimal solution. The simulated annealing algorithm has the opportunity to accept the disturbance that increases the error, thereby jumping out of the local minimum trap, avoiding the problem of the greedy algorithm falling into the local optimum, and ensuring that the global optimal solution can be obtained.

[0016] Furthermore, the objective function established in step 2) is:

[0017]

[0018] where t i Represents an object in the object set T; Indicates t i The ideal area in the Cartogram is given by t i The thematic statistical value of is determined; Indicates t i The area of ​​the rectangle in the current rectangular layout, determined by the free variables.

[0019] Furthermore, the ideal area in the Cartogram is:

[0020]

[0021] in Represents object t i The ideal area in the Cartogram, value i Represents object t i The thematic statistical value, sumvalue represents the sum of all thematic statistical values, and D represents the total area of ​​the map.

[0022] Furthermore, the formula used to calculate the area of ​​a rectangle in a rectangular layout using free variables is:

[0023]

[0024] in and Respectively represent the object t i The coordinates of the four sides of the rectangle in a rectangular layout.

[0025] Furthermore, the constraints are:

[0026]

[0027]

[0028] in Represents object ti The coordinates in the rectangle away from the positive x-axis, Represents object t i The coordinates in the rectangle close to the positive x-axis, Represents object t i The coordinates in the rectangle close to the positive y-axis, Represents object t i The coordinate in the rectangle away from the positive y-axis.

[0029] In order to ensure that the obtained rectangular graph satisfies the constraint of planarity, the present invention adds a constraint condition so that the requirement of planarity can be met in the process of solving the objective function.

[0030] Furthermore, when solving the objective function using the constraint conditions, the constraint conditions are added to the objective function as interference terms.

[0031] The present invention adds constraint conditions to the objective function in the form of interference terms, and can accurately exclude solutions that do not meet the constraint conditions when solving the objective function, thereby improving the efficiency of the algorithm.

[0032] Furthermore, the interference term is characterized by a symbolic function, and the objective function after adding the interference term is:

[0033]

[0034]

[0035]

[0036] where value i Represents object t i The thematic statistical value, sumvalue represents the sum of all thematic statistical values, μ is the weight, and Respectively represent the object t i In a rectangular layout, the coordinates of the four sides of the rectangle, sign() is the sign function.

[0037] The present invention constructs the interference caused by constraint conditions through symbolic functions, which can directly and accurately express the impact on the objective function when the constraint conditions are not met, and further improve the efficiency of the solution process. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the rectangular Cartogram generation method of the present invention;

[0039] Figure 2-a is a schematic diagram of the relationship between the rectangular layout and the free variables in an embodiment of the present invention;

[0040] Figure 2-b is a schematic diagram of the mapping relationship between the rectangular layout data structure and the free variables in an embodiment of the present invention;

[0041] Figure 3 It is a flow chart of the greedy search algorithm adopted by the present invention;

[0042] Figure 4 It is a flow chart of the present invention using simulated annealing algorithm to search;

[0043] Figure 5-a It is a schematic diagram comparing the actual area and the ideal area of ​​the rectangle under the German GDP topic obtained by the greedy algorithm and the simulated annealing algorithm respectively in the experimental process of the present invention;

[0044] Figure 5-b 1 is a schematic diagram comparing the actual area and the ideal area of ​​a rectangle under the German population topic obtained by the greedy algorithm and the simulated annealing algorithm respectively in the experimental process of the present invention;

[0045] Figure 5-c It is a schematic diagram comparing the actual area and the ideal area of ​​the rectangle under the Italian GDP topic obtained by the greedy algorithm and the simulated annealing algorithm respectively in the experimental process of the present invention;

[0046] Figure 5-d It is a schematic diagram comparing the actual area and the ideal area of ​​the rectangle under the Italian population topic obtained by the greedy algorithm and the simulated annealing algorithm respectively in the experimental process of the present invention;

[0047] Figure 5-e It is a schematic diagram comparing the actual area and the ideal area of ​​a rectangle under the topic of US GDP obtained by the greedy algorithm and the simulated annealing algorithm respectively in the experimental process of the present invention;

[0048] Figure 5-f It is a schematic diagram comparing the actual area and the ideal area of ​​a rectangle under the U.S. population topic obtained by the greedy algorithm and the simulated annealing algorithm respectively during the experiment of the present invention. DETAILED DESCRIPTION

[0049] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.

[0050] The present invention, on the basis of obtaining an initial rectangular layout diagram, extracts common edges according to the coordinate values ​​of each rectangle in the initial rectangular layout, determines the relationship between each rectangle and the free variable, and the free variable is a variable obtained by simplifying the coordinates. The corresponding relationship between the rectangular layout and the free variable is established; the minimum value of the sum of the differences between the area of ​​each rectangle in the rectangular layout and the corresponding ideal area is used as the objective function, and the area of ​​each rectangle in the rectangular layout is characterized by the free variable, that is, the objective function can be represented by the free variable; finally, the objective function is solved to determine the free variable that can satisfy the objective function, and the rectangular layout corresponding to the free variable is the rectangular segmentation diagram to be obtained by the present invention. The present invention establishes a connection between the thematic data value and the rectangular layout through the objective function, uses the objective function as an evaluation of the rectangular layout, uses the objective function to control the free variables, and transforms the search problem of the optimal layout into an optimization problem of the objective function, and can obtain the optimal layout by solving the objective function. Therefore, the implementation process of the present invention is simple, does not require complicated processing work, and can quickly and accurately obtain the optimal rectangular layout. The implementation principle of this method is as follows Figure 1 As shown, the specific process is as follows.

[0051] 1. Obtain the initial rectangular layout that represents the thematic data, set free variables, and use the free variables to represent the rectangular layout.

[0052] The thematic data in the present invention may be indicators such as population, regional area, GDP, etc., and the initial rectangular layout representing the thematic data may be obtained by using the existing rectangular map construction method. Assume that the partial structure of the initial rectangular layout obtained in this embodiment is as follows Figure 2-a As shown, the initial layout (a rectangular division of the map) is object-type data with rectangles as objects. Each rectangle is determined by four sides. The rectangular layout is a plane layout method. Each rectangle is in a plane. Therefore, a plane coordinate system is established in the plane. To facilitate subsequent calculations, the two coordinate axes of the plane coordinate system are parallel to the two right-angled sides of the rectangle in the initial rectangular layout. Therefore, the coordinate values ​​of the four sides of the rectangle can be used to describe the position and size of the rectangle.

[0053] In this embodiment, the initial rectangular layout is as follows Figure 2-a The left half of the figure includes four rectangles. The present invention establishes a coordinate system based on the initial rectangular layout, and the x-axis and the y-axis are parallel to two adjacent right-angled sides of the rectangle, respectively. Figure 2-a The right half is shown, where the i-th rectangle is available and Indicates, respectively, the coordinates of the four sides of the rectangle, so the present invention will determine the coordinate values ​​of the four sides of the rectangle as free variables, and describe the rectangle through encoding. Encoding is a way of saying the conversion from plane layout to free variables.

[0054] like Figure 2-bAs shown in the figure, the data structure with rectangle as the object and the free variable are the range and domain of each other in the mapping. Its extraction process is the surjective relationship between the mapping function, free variables and rectangular layout, which realizes the expression and control of the layout by free variables and facilitates the addition of disturbances to find the optimal layout. The initial value of the free variable refers to the coordinate value of the four sides of each rectangle in the initial rectangular layout.

[0055] 2. Construct the objective function.

[0056] The key to the optimal layout search lies in the determination of the objective function and the selection of disturbances. The objective function is a comprehensive evaluation of the layout errors and is the bridge between the thematic data values ​​and the rectangular layout. Figure 2-b As shown, by evaluating the two-dimensional rectangular layout, the connection between the evaluation function and the free variables is established to realize the control of the objective function value on the free variables, thereby realizing the transformation from the search problem of the optimal layout to the optimization problem of the objective equation.

[0057] Topological accuracy and data accuracy are a pair of irreconcilable contradictions. The present invention uses data accuracy as an explicit constraint to control the change of free variables, and uses topological accuracy and geographic accuracy as implicit constraints (there is no clear control item in the objective function), and controls them through the extraction of free variables, domain restrictions and the selection of disturbances. The rectangular layout includes the topological relationship of the original image and the relative position relationship between objects. An equal step search is used for each variable, and the order (initial order) between variables is maintained, so that the relative position relationship between geographic objects is maintained while the graph is not flipped. The maintenance of the relative position relationship maintains the topological relationship between objects to a certain extent. Therefore, topological constraints and geographic constraints are included in the search process and are implicit constraints. In addition, topological accuracy and geographic accuracy can also be improved by additional constraints.

[0058] In summary, the present invention uses data accuracy as the objective function, calculates the difference between the area of ​​each rectangle in the rectangular layout and the ideal area determined by the thematic statistical value represented by the rectangle, and uses the sum of the absolute values ​​of the difference between the area of ​​each rectangle in the rectangular layout and the corresponding ideal area as the objective function, establishes a bridge connecting the thematic data value and the layout, and realizes a comprehensive evaluation of the rectangular layout error. The established objective function is:

[0059]

[0060] where t i Represents an object in the object set T; Indicates t i The ideal area in the Cartogram is given by t i The thematic statistical value of is determined; Indicates t i The area of ​​the rectangle in the current rectangular layout, determined by the free variables.

[0061] The ideal area of ​​each target object in the Cartogram is:

[0062]

[0063]

[0064] in Indicates t i The ideal area in the Cartogram, value i Indicates t i The thematic statistical value, sumvalue represents the sum of all thematic statistical values, and D represents the total area of ​​the map. When the thematic data statistical value is given It is a fixed value and can be considered a constant.

[0065] The formula used to calculate the area of ​​a rectangle in a rectangular layout using free variables is:

[0066]

[0067] in and Respectively represent the object t i In the rectangular layout, the coordinates of the four sides of the rectangle are free variables. Therefore, the objective function of the present invention can be rewritten as:

[0068]

[0069] It can be seen from this that the objective function can be written as a function of the free variables.

[0070] 3. Determine the constraints.

[0071] Free variables and Represents object t i The coordinates of the four sides of the rectangle in the rectangular layout, such as Figure 2-a As shown, it satisfies the following constraints:

[0072]

[0073]

[0074] Since the objective function has no exact solution and cannot guarantee the planarity of the rectangle during the transformation process, the present invention adds the above constraints as adjustment items to the objective function to keep the planarity of the transformation process. According to the computer calculation feature points, this embodiment selects a sign function to control the constraints. The constructed sign function is as follows:

[0075]

[0076]

[0077] The above symbolic function means: taking rectangle t i For example, for rectangle t i Analyze the left and right sides of No error occurs when a flip occurs Produce error; Similarly, for the rectangle t i Analyze the upper and lower sides of No error occurs when a flip occurs When the above symbol function is added to the objective function, a weight value is added to characterize the impact of the error. The specific weight value can be adjusted according to the actual situation. Generally, the weight value is a larger value. The objective function after adding is:

[0078]

[0079] Where μ is the weight value, which can be set to a maximum value, which can be the total area of ​​the map.

[0080] As other implementation methods, in addition to the symbolic function, other function forms can also be selected. As long as the planarity condition is met, the original objective function will not be affected. When the planarity condition is not met, the objective function will produce a maximum value.

[0081] Therefore, the present invention can change the values ​​of the x-axis and y-axis free variables by adding disturbances, and add constraints in the objective function as feedback to the disturbances.

[0082] 4. Solve the objective function.

[0083] Through steps 1, 2, and 3, two groups of free variables about the x-axis and the y-axis can be extracted according to the coordinates of the original geographic area and its topological relationship, and a relationship table between the free variables and the objects in the map can be established. The relationship table and the free variables can be used to achieve a one-to-one correspondence between the free variables and the rectangular layout. The value of each free variable represents the position of the corresponding line segment in the rectangular layout. The free variables are also the variables of the objective function. The objective function is used to gradually correct the initial values ​​of the free variables so that the area of ​​the rectangle approaches the ideal value. This embodiment uses a greedy algorithm to solve and obtain the free variables corresponding to each rectangle that minimizes the objective function. Since the iterative calculations of the x-axis and the y-axis are equivalent algorithms in different directions, the search process is explained below using the iterative algorithm of the x-axis as an example. The implementation process is as follows. Figure 3 As shown, the specific implementation process is as follows.

[0084] 1) Obtain an initial rectangular layout, extract the initial values ​​of free variables from it, and establish a relationship table between free variables and rectangular layout.

[0085] 2) Set a single free variable to move in equal steps in the positive (negative) direction at the current position, and calculate the error caused by the current position.

[0086] For example, for the free variable For example, assuming the current coordinates are Then, according to the set step size displacement, it moves along the x-axis in the positive direction of the x-axis. Assume that the coordinates of the free variable after movement are Calculate the value of the objective function according to the moved position.

[0087] 3) If the objective function value decreases (the data error decreases), the current value of the free variable is recorded and the above operation is performed on the next free variable.

[0088] The objective function value calculated based on the moving result of step 2) is a function that decreases if it means that this movement has brought a better effect. Therefore, the moving result of the free variable is retained and the next free variable is moved in the direction of step 2). For this example, a step size Δs is added along the positive direction of the x-axis.

[0089] 4) If the objective function value increases (data error increases), move in the negative (positive) direction by twice the step size and judge the current value.

[0090] If the objective function value calculated based on the moving result of step 2) increases, it means that this move does not bring good results. Therefore, the moving result of the free variable is not retained, and the free variable is moved in the opposite direction of step 2). For this example, two steps are added in the opposite direction based on the moving result of step 2), that is, After moving one step in the positive direction of the x-axis and then two steps in the negative direction of the x-axis, the coordinates of the free variable after moving are

[0091] 5) If the objective function value at the current position decreases, the above operation is performed on the next free variable, otherwise the free variable is restored to its initial value.

[0092] Based on the movement result of step 4), the objective function value is calculated. If the objective function value decreases, it means that this movement has brought good results. Therefore, the movement result of the free variable is retained. If the objective function value increases, it means that the movement result is not good, that is, the movement of the free variable in both directions cannot bring good results. At this time, the free variable is restored to the value before the movement. That is, the free variable is not moved.

[0093] 6) Search all free variables in turn until all variables have been searched.

[0094] Repeat steps 2)-5) to search for all free variables.

[0095] 7) Search all variables a specified number of times.

[0096] Through the above search process, the free variables of each rectangle corresponding to a relatively small objective function can be determined, thereby adjusting the initial rectangular layout and obtaining the final rectangular diagram, which can accurately reflect the true distribution of its thematic statistical values.

[0097] exist Figure 3 In the flowchart shown, vector X represents the free variable, which is the encoding value of the current rectangular layout (represented by the symbol P), l records the current number of iterations, i is the index value of the free variable, y is the control value of the inner loop, and vector di represents the direction of the current search. In this algorithm, let di = ei (ei is a unit vector), & is the step size of each iteration, and X±&di means that the i-th free variable moves & units in the positive (negative) direction. X′ is the variable value after the move, and P′ is the layout after the move. COST() is the objective function, and Costbest is the current optimal layout. Let n be the number of free variables, m be the maximum number of iterations, and a search for n variables is an inner loop. The algorithm ends after m iterative searches.

[0098] As other implementations, in addition to the greedy algorithm, other recursive algorithms, such as a dynamic programming algorithm, may also be used.

[0099] 5. Optimize the solution process.

[0100] Although the greedy algorithm can iterate quickly to solve the objective function, the greedy algorithm only considers the next operation of the current value in the search process, and the search path is single, which cannot break the problem of local optimal barriers. Often, only local optimal solutions can be obtained, and global optimal solutions cannot be obtained. For this reason, the present invention proposes a simulated annealing algorithm with random layout on the basis of the above-mentioned greedy algorithm. The simulated annealing algorithm is an effective algorithm suitable for solving approximate values ​​of complex combinatorial problems. Its basic idea is to simulate the metal annealing process to find the optimal solution of the optimization problem. When the metal reaches the minimum energy state, the objective function of the optimization problem also reaches the global optimal solution accordingly.

[0101] One of the characteristics of simulated annealing is that it can accept states where the objective function value is not very good according to a certain probability. This makes it possible for the algorithm to jump out even if it falls into the trap of a local optimal solution and converge to the global optimal solution or a near-optimal solution.

[0102] The process of simulated annealing is as follows Figure 4 As shown (variables and Figure 3 Consistent):

[0103] 1) Assume that the initial temperature is T=100, the initial point is X, and the function value calculated at this point is set to the optimal value Costbest=COST(X).

[0104] For this embodiment, the initial point X refers to the initial coordinates of the free variable, and the objective function value corresponding to the initial coordinates of the free variable is used as the optimal objective function value.

[0105] 2) Generate disturbance &di, obtain new coordinates X′=X+&di, and calculate the new coordinate objective function value COST(X′).

[0106] During the search process, each free variable is moved and adjusted, and the corresponding objective function value is calculated based on the adjusted free variable.

[0107] 3) If COST(X′)≤Costbest, accept the new point as the initial point for the next simulation.

[0108] If the objective function value corresponding to the adjusted free variable is less than or equal to the optimal objective function value, it means that this adjustment can bring better results and make the objective function value smaller. Therefore, the adjustment result is received and the optimal objective function value Costbest is updated to the objective function value calculated this time.

[0109] 4) If COST(X′)>Costbest, calculate the acceptance probability of the point: Exp(-T). At the same time, use the random function to generate a random number r∈[0,1] in the interval [0,1]. If Exp(-T)≥r, accept the new point as the initial point for the next simulation; otherwise, abandon the new point and still take the initial value as the initial point for the next simulation.

[0110] As the simulation algorithm iterates, the cooling function T=0.95T is used to make the temperature gradually approach 0, the value of Exp(-T) gradually approaches 1, and the acceptance probability of the wrong solution (Exp(-T)≥r) gradually approaches 0, that is, the point that increases the error is not accepted. At this time, the simulated annealing algorithm can be gradually transitioned to a greedy search algorithm.

[0111] Therefore, through the above process, the present invention can use the random function in the simulated annealing algorithm to change the strategy of the greedy algorithm to only select the current optimal solution. By making a judgment before excluding the poor results, if the judgment conditions are met, the current poor results are accepted, thereby being able to jump out of the local optimum of the greedy algorithm and obtain the global optimum.

[0112] Experimental verification

[0113] In order to fully illustrate that the rectangular segmentation map obtained by the present invention can accurately characterize the relationship between thematic statistical values, three countries with large differences in object quantity, economic characteristics and topological relationships, namely the United States, Germany and Italy, are selected for experiments. At the same time, in order to maintain the integrity of the rectangle, some areas of the United States are discarded and individual areas are merged (thematic data and political divisions are all from the Wikipedia mirror website).

[0114] like Figure 5-a , Figure 5-b , Figure 5-c , Figure 5-d , Figure 5-e and Figure 5-f As shown in the figure, the solid grey line represents the ideal area, the dotted dashed line represents the actual area obtained by the greedy algorithm, and the hollow dashed line represents the actual area obtained by adding the simulated annealing algorithm. The actual area of ​​each object is basically consistent with the ideal area, which reflects the actual size of the data as a whole. However, the actual value of some areas is quite different from the ideal value. For example, the ideal area of ​​the object represented by point A in the U.S. population map is relatively small, but the actual area is second only to California. In addition, the present invention uses a simulation algorithm to experiment with GDP data of Italy and Germany. The results shown in the figure are the results with the smallest total error among the 10 calculation results. Figure 5-a , Figure 5-b , Figure 5-c , Figure 5-d , Figure 5-e and Figure 5-f It can be seen that the actual area obtained by the simulated annealing algorithm is closer to the ideal area.

[0115] Tables 1 and 2 list two measurement results of two types of data from three countries: maximum cartographic error and average cartographic error. It can be seen from Tables 1 and 2 that the minimum average cartographic error is 1.96%, the maximum average cartographic error is 18.8%, and the minimum maximum cartographic error is 6.6%. For reference, the algorithm that also covers the entire map is the heuristic segmentation algorithm proposed by Heilmann. It conducted ten experiments on rectangular cartograms with election data from each state in the United States, and the average cartographic error was between 25% and 30%. The average cartographic error of the population-themed rectangular cartograms of each state obtained by the present invention using the greedy algorithm is 14.9%, and the average cartographic error of the GDP-themed rectangular cartograms of each state is 18.8%. The results obtained by the simulated annealing algorithm are better, with the two data being 13.4% and 12.6% respectively.

[0116] Table 1

[0117]

[0118] Table 2

[0119]

[0120] From Table 1, Table 2 and Figure 5-a to Figure 5-f As shown in the figure, the simulated annealing algorithm obtains a smaller overall error result, which effectively improves the problem of single search path of the greedy algorithm.

[0121] The present invention converts the transformation problem of rectangular layout to rectangular cartogram into an optimization problem of the target equation by extracting free variables and deriving the target equation, and solves the problem by using a greedy algorithm and a simulated annealing algorithm. When solving the problem, the topological constraints and geographical constraints of the layout are implicit in the extraction of free variables and the addition of disturbances, which effectively reduces the calculation amount of the target function and improves the efficiency of the algorithm.

Claims

1. A rectangular Cartogram generation method, characterized in that: The generation method comprises the following steps: 1) obtaining an initial rectangular layout of the target object, establishing a plane coordinate system on the initial rectangular layout, making two coordinate axes of the plane coordinate system parallel to two right-angled sides of the rectangles in the initial rectangular layout, extracting common sides according to the coordinate values ​​of each rectangle in the initial rectangular layout, determining the relationship between each rectangle and the free variable, and using the coordinate values ​​of the four sides of each rectangle in the initial rectangular layout as the initial values ​​of the free variable; 2) Count the difference between the area of ​​each rectangle in the rectangular layout and the ideal area determined by the thematic statistical value represented by the rectangle, and take the sum of the absolute values ​​of the difference between the area of ​​each rectangle and the corresponding ideal area as the objective function, so as to establish the objective function with free variables as variables; 3) Taking the planarity of the free variable as a constraint condition, solving the objective function, obtaining the free variable value that can make the objective function obtain the minimum value, and the rectangular layout corresponding to the free variable value is the final rectangular segmentation map; The objective function established in step 2) is: where t i Represents an object in the object set T; Indicates t i The ideal area in the Cartogram is given by t i The thematic statistical value of is determined; Indicates t i The area of ​​the rectangle in the current rectangular layout is determined by the free variables; When solving the objective function using the constraint condition, adding the constraint condition as an interference term to the objective function; The interference term is characterized by a symbolic function, and the objective function after adding the interference term is: where value i Represents object t i The thematic statistical value, sumvalue represents the sum of all thematic statistical values, μ is the weight, and Respectively represent the object t i In a rectangular layout, the coordinates of the four sides of the rectangle, sign() is the sign function.

2. The rectangular Cartogram generation method according to claim 1, characterized in that: The step 3) uses a greedy algorithm to solve the objective function.

3. The rectangular Cartogram generation method according to claim 2, characterized in that: In the step 3), when the greedy algorithm is used to solve the objective function, a simulated annealing algorithm is used to make the greedy algorithm exit the loop of selecting only the current optimal solution, so as to obtain the global optimal solution of the objective function.

4. The rectangular Cartogram generation method according to claim 1, characterized in that: The ideal area in the Cartogram is: in Represents object t i The ideal area in the Cartogram, value i Represents object t i The thematic statistical value, sumvalue represents the sum of all thematic statistical values, and D represents the total area of ​​the map.

5. The rectangular Cartogram generation method according to claim 1, characterized in that: The formula used to calculate the area of ​​a rectangle in a rectangular layout using free variables is: in and Respectively represent the object t i The coordinates of the four sides of the rectangle in a rectangular layout.

6. The rectangular Cartogram generation method according to claim 5, characterized in that: The constraints are: in Represents object t i The coordinates in the rectangle away from the positive x-axis, Represents object t i The coordinates in the rectangle close to the positive x-axis, Represents object t i The coordinates in the rectangle close to the positive y-axis, Represents object t i The coordinate in the rectangle away from the positive y-axis.