# Water Allocation Optimization and Environmental Planning with Simulated Annealing Algorithms

Authors: Dongling Cheng
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Because of the continuous deterioration of water environment, it is ensured that the basic water demand of ecological environment is the key task of water resources utilization and control in China. In view of the uneven distribution of domestic water resources “more in the South and less in the north, more in the East and less in the west,” it is very necessary to optimize the allocation of water resources. This paper aims to optimize the allocation of water resources through simulated annealing algorithm (SAA), hoping to optimize the allocation of water resources through diversion, water intake, and storage measures such as pipelines. Based on this, this paper proposes an improved SAA pipeline construction algorithm. Aiming at the distribution of water sources in the Yangtze River Basin, the algorithm is used to optimize the objective function path to solve the unbalanced problem of rich and lack of regional water resources. And after optimizing the annealing simulation algorithm, the simulation optimization ability is significantly improved. Experiments show that the improved SAA can improve the optimal configuration by more than 50% and up to 96%, indicating that the improved algorithm has a more stable optimization planning function for the optimization of objectives and can often get a more perfect route.


---

## Body

## 1. Introduction

While diversified water resource utilization provides convenience to human life and production, it also brings huge social, ecological, and even economic benefits to mankind. As an “economic man,” while continuously pursuing the ultimate goal of maximizing their own interests, the uncontrolled and one-sided profit-seeking process will inevitably lead to the serious consequences of low water resource allocation efficiency and deterioration of the ecological environment. Therefore, whether it is for the purpose of improving the efficiency of water resources allocation or protecting the ecological environment, it is necessary to theoretically and model research on the optimal allocation of water resources.There are many researches on SAAs and their applications are relatively wide. For example, Jiang et al. developed a new hybrid prediction model called E-SA-BP, which combines ensemble empirical mode decomposition and Simulated Annealing (SA) Algorithm and Back-Propagation Neural Network (BPNN), used to perform wind speed prediction [1]. Wang et al. proposed a new image encryption scheme based on chaos and SAA. This algorithm regards the generation of random sequence as a problem of seeking the optimal solution and then uses the SAA to further obtain the optimal pseudorandom sequence [2]. Lukovac et al. proposed a new model based on neurofuzzy method to develop human resource portfolio. The SAA is used to build an adaptive neural network. This model enables decision-makers to assess and assess human resource potential based on the environment and its circumstances. The purpose of creating this model is to gain insight into the existing potential and plan assets to improve and enhance the potential of the company’s employees [3]. Leno et al. used an integrated approach to design both the cell layout and the flow path layout of the MHS. The quality of the final layout is evaluated by minimizing the total material handling cost [4]. Chen et al. discussed the optimization of the delivery injection plan along the intermediate station of a one-way multiproduct pipeline. A mixed-integer linear programming model was developed to minimize the pump speed variation along each pipeline section within the scheduling range [5]. As for the allocation of water resources, more analysis is aimed at specific places. Song et al. measured China’s provincial water resources efficiency from both static and dynamic perspectives. They used the panel Tobit model to affect water efficiency. The research results show that the efficiency of water resource utilization is obviously insufficient, and there are significant differences between provinces [6]. Cao and Hu and others, on the basis of comprehensive analysis of the Beijing-Tianjin-Hebei region’s water resources regulation and water environment security status and challenges, proposed regional water resources and water environment regulation and safety assurance strategies. Comprehensive environmental management and national ecological civilization construction provide decision support [7]. Chen et al. analyzed the water resources change mechanism of Minqin Oasis and revealed the relationship between water resources development and utilization and hydrological cycle changes [8]. In general, the research on the planning and allocation of water resources and environment is more focused on specific places and research and analysis under specific conditions. And in terms of methods, more methods such as literature analysis, field surveys, and sampling surveys and statistics are used, and there is no research based on specific algorithms. Therefore, this paper proposes optimization based on SAA for the allocation of national water resources.In this article, the following innovations are made for the above research: (1) The research on the allocation of water resources is no longer limited to a certain city or location, but the research on the overall domestic water system. (2) An improved SAA is proposed for the optimal allocation of water resources.


## 2. Algorithms and Models

### 2.1. SAA

#### 2.1.1. Typical SAA

The SAA will be different due to the different acceptance criteria, cooling speed table, memory function, and parallel function [9], so according to these several index algorithm models, there are roughly the following classifications. This article explains the acceptance criteria of the dominant relationship between the new comprehensive solution and the current solution.Synthesizing the acceptance criterion of the dominance relationship between the new solution and the current solution, the probability of accepting the new solution isp, as in the following formula:(1)p=1,Δr≤0,exp−ΔrUa,Δr>0,where a is converted from a multidimensional standard distance to Δr single-dimensional distance; use the weight vector λi to transform the multistandard information into one process, as shown in the following formula:(2)Δr=rfm,λ−rfn,λ,rF,λ.Or it can be expressed as follows:(3)Δr=∑i=1Mλifi.The following equation is the expression of the function(4)r⋅=f⋅,λ.This model only compares the new solution with the current solution, and the scope of reliable consideration of the solution is not comprehensive because it does not consider the comparison of the new solution with other previous solutions.The latest state of the SAA is generated based on the previous state. The parallel algorithm model can essentially improve the performance of the model and narrow the scope of the search solution.U is defined by the probability convergence obtained from the normal distribution, as follows:(5)g−UrM<Egi<g+UrM.In the calculation process, setting a set of initial annealing temperatures and annealing speeds, the initial result obtained can be expressed byg. In independent identical distribution [10], the mean squared difference of g can be calculated; then the expected value of g obeys an approximate normal distribution and satisfies(6)g−UrM<Egi<g+UrM,where g is the initial result set, as in the following formula:(7)g=g1,g2,…,gi.Search for the optimal value by controlling the weight value of the objective function in the solution process, allowing a specific weight value to perform multiple iterations. The weight value function is [11], as in thefollowing equation:(8)λi=pλiq,nim≥nim′,λiqp,nim<nim′.In equation (8), q > 1, which explains the new solution for the minimum algorithm; the minimum value is the minimum value of the objective function, as in thefollowing equation:(9)min1,∏i=1Mexpλinim−nizU.This model can increase or decrease the acceptance probability of the new solution so that the new solution is not limited to a certain local range [12].


#### 2.1.2. Combinatorial Optimization Problem

A data point in the combinatorial optimization problem can be expressed as (h, f). Among them, the solution space h is a feasible solution set, and the objective function f is a mapping [13].In combinatorial optimization, the minimization problem is to find the minimum value of the objective function through a function [14], as shown in thefollowing equation:(10)minfx,x∈H.The problem of maximization is to find the maximum value of the objective function through a function [15], as in the following formula:(11)maxfx,x∈H.


#### 2.1.3. Metropolis Guidelines

The Metropolis criterion expression is shown inthefollowing equation, where i and j are the states at the corresponding time:(12)r=expEi,EjKT.In equation (12), a random number generator is usually used to generate a random number in the interval [0, 1]. This random number must be less than r, r < 1. In the new state, j is the important state, and the i state is replaced to become the new current state; if j is not an important state, discard j, and i remains the current state.


#### 2.1.4. The Characteristics of the SAA

In the combinatorial optimization problem determined by analysis, if the Metropolis criterion is used for constraint update at anyT value, there are not many related studies on other criteria, so Metropolis criterion is chosen to make the optimization problem reach a balanced state distribution [16], as shown in thefollowing equation:(13)pix=i=qiT=1N0texp−ciT.In equation (13), X is the random variable in the current state of the SAA [17], and(14)N0t=∑j=ξexp−cjT.Equation (14) is the normalization factor. If (13) is satisfied, the SAA has a convergence trend, which can make the overall convergence to the optimal solution [18].Water Resources Allocation. In the process of water resources allocation and development and utilization, the relatively fair of the main water use needs of various uses must be guaranteed so as to achieve the most reasonable and scientific water resources allocation effect. Therefore, it is necessary to strengthen the control of the use of water resources and strive to achieve true fair distribution and sustainable use of water resources [19, 20].The distribution method is discussed in two situations: one is the situation of oversupply, which adopts the form of distribution on demand; the other is the situation where supply exceeds demand, and this situation is also divided into two ways. One is to allocate proportionally according to demand. When the development of each district is similar, it is allocated to each district according to the proportion of water demand; if the development levels of the two places are inconsistent, priority should be given to efficiency. Appropriately tilt towards high-efficiency industries so that the guarantee rate of high-efficiency water industries is higher than that of low-efficiency water industries [21].The early allocation of water resources was guided by the optimal dispatch of reservoirs and the pursuit of maximum economic benefits at this stage. The distribution of water quantity is realized by the method of “determining supply based on demand” and “determining supply based on demand” [22]. By the 1980s, the problem of water pollution received people’s attention, and the allocation of water resources began from a single water allocation to a combined allocation of water and quality [23].With the development of the theory of optimal allocation of water resources, the types of optimal allocation of water resources have gone through the following stages: (1) optimal allocation of water resources based on water quantity allocation; (2) optimal allocation of water resources considering water quality factors; (3) surface-groundwater joint optimal allocation; (4) regional water resources optimal allocation; and (5) basin water resources optimal allocation and cross-basin water resources optimal allocation (also called pan-basin water resources optimal allocation). Due to the needs of water resources allocation practice, the research content mainly focuses on allocation theory, allocation method, allocation mechanism, and allocation evaluation.


### 2.2. Current Status of Water Resources Environment

As a large country in the world, China has a large land area and complex and diverse terrain, which has caused obvious imbalances in water resources. Generally speaking, “the east is more and the west is less, and the south is more and the north is less.” There are many reasons for this, and there are many discussions among relevant geographers. Then, this article will do related research based on the perspective of science based on the uneven distribution of water resources [24].As shown in Figure1, the central and western regions of China are generally in a state of water shortage, and even many central regions are only transitional zones, not with sufficient water. The figure shows the water level line of precipitation. It can be found that there is relatively abundant precipitation in Jiangxi, Fujian, Guangdong, Yunnan, Hainan, and Taiwan, which also provides a large reserve of water resources in the south of the Yangtze River. The Yangtze and Yellow Rivers in the central region, Heilongjiang, Songhua River, and Yarlung Zangbo River in Tibet in the northeast provide abundant water resources for the local area. China has recognized ten major rivers, which provide huge reserves of domestic water resources [25].Figure 1
Distribution map of China’s water resources.


#### 2.2.1. Analysis of Runoff Characteristics

The ten major rivers in China are the Yangtze River, Yellow River, Heilongjiang River, Songhua River, Pearl River, Yarlung Zangbo River, Canglan River, Nujiang River, Han River, and Liao River. These are ten big rivers that have watered the vast land of China, provided abundant water resources for the descendants of Yan and Huang, and lived and worked in peace and contentment on both sides of the river.In Figure2, the flow lengths of the ten major rivers. Transnational rivers only calculate the internal flow length and area, drainage area, and runoff (annual average value). It can be seen that as two major rivers, the Yangtze River and the Yellow River are at the forefront in terms of length and runoff, and the drainage area is several times that of other rivers.Figure 2
Overview of China’s top ten rivers.Figure3 shows the average annual runoff of the Yangtze River from 1956 to 2014; runoff is the amount of water flow in a certain cross section of a river, which can be used to express the abundance of water in the river, in order to analyze the country’s water resources allocation through the Yangtze River, the first river in China. In the follow-up situation, research is also done on the Yangtze River because it will take a lot more energy to conduct homogeneity research on other rivers.Figure 3
Average annual runoff of the Yangtze River.


### 2.3. Model Fitting

#### 2.3.1. Water Resources Zoning and Restoration Calculation

Zoning. China’s vast territory cannot be generalized, so the entire China is divided into regions. According to the degree of water shortage, it is divided into high water area, transition area, water shortage area, and extreme water shortage area. The partition conditions are shown in Figure 1 and are divided according to the amount of precipitation.Restoration. In the process of water resources calculation, the runoff data measured by the hydrological station is the data under the influence of human activities. As the influence of human activities intensifies, the hydrological variables measured at different periods cannot be regarded as coming from the same whole, and the consistency of the entire hydrological sequence is destroyed. In order to eliminate this influence and fully estimate the amount of water resources in the basin, it is necessary to restore and calculate the hydrological sequence so that they belong to the same population to ensure the consistency of the hydrological sequence.The method of restoring calculation here adopts the itemized survey method to restore the runoff data. The itemized survey method is to restore the unmeasured water volume on the cross section item by item and add the measured runoff of the cross section to obtain the natural runoff of the cross section. The basis of the item survey method is the water balance, and the formula for the water balance during the restoration calculation period is(15)W0=Wt+W′,where W0 is natural runoff, Wt is measured runoff, and W′ is reduced runoff.(16)W′=∏i=1nWi.In equation (16), i is various factors affecting water resources, such as agricultural water, industrial water, domestic water, water storage, rainwater, evaporation, water diversion, and so on. The reduction runoff is the sum of them.Among them, the runoff reduction affected by the reservoir regulation and storage is based on the water level storage curve of the reservoir and the water level data on the dam, and the water balance method is used to calculate the runoff reduction, and the period of the reduction calculation is monthly. If there are data on the inflow and outflow of the reservoir, the calculation results of the runoff restoration of the reservoir can be checked accordingly. The calculation formula for runoff reduction isasfollows:(17)Q0=Qt+v1−v2T.In equation (17), Q0 is the natural runoff, Qt is the measured runoff, v1 is the flow at the end of the month, and v2 is the flow at the beginning of the month.According to the restored formula, the other water usage of the Yangtze River can be found from the statistics of the Bureau of Statistics, and the approximate natural runoff can be estimated, as shown in Figure4.Figure 4
The average annual reduced runoff from 1956 to 2014.In Figure4, the average annual reduced runoff is generally larger than the measured runoff in Figure 3, and the trend is not much different. This shows the effectiveness of the reduction algorithm, and it can be found that the reduction runoff will be about 2000 larger than the actual measurement on average. This shows that human production and life have a greater impact on the runoff of the Yangtze River. Therefore, we should consider the production and life of human beings in terms of the optimal allocation of water resources. In the subsequent algorithm simulation, the corresponding restriction conditions will be mentioned.


#### 2.3.2. Analysis of Supply and Demand Balance

Water supply facilities refer to all water supply and water source projects; in addition to water source projects under the jurisdiction of the water conservancy department, water source projects belonging to other departments are also included. For example, reservoirs, pumping stations of municipal water plants, self-provided water source projects of industrial and mining enterprises, and groundwater wells of rural residents are all water supply facilities. Water supply capacity refers to the maximum amount of water that a water supply project can provide under the condition of sufficient incoming water, generally refers to the maximum water supply capacity, and is related to the scale of the water conservancy project. Water storage project: it refers to the storage limit of the reservoir and the water storage capacity of some greening. Water diversion project: it refers to canals, water station pipes, and other channels with drainage capacity. Water lifting project: it refers to the extraction of water from seawater desalination and groundwater wells. Groundwater supply: it refers to groundwater resources that have not been fully extracted underground. The specific water supply capacity is shown in Figure5.Figure 5
The proportion of water supply capacity of various water supply projects in the water supply capacity of the whole basin.As shown in Figure5, the water supply capacity of groundwater projects is the largest, because the freshwater reserves of groundwater are the largest. Because it is difficult to extract water for self-use, the reserves are always available, which can be used as emergency water supply and can last a long time. Many other projects, such as water diversion and water lift projects, are based on water plants, and often supply exceeds demand. Particularly in water-scarce areas, there is a shortage of water supply.


#### 2.3.3. SAA Model

In the SAA, the binary conversion strategy for the current solution is obtained at each temperature, optimizing with 0 to 1 transformation, 1 to 1 transformation, and 1 to 0 transformation. On the premise of satisfying the constraints set by oneself, if the new solution of the water supply strategy is better than the current water supply strategy, the new solution will be regarded as the new current solution.In determining the annealing strategy, the principle of convergence is generally qualitatively summarized as follows: The initial temperature is high enough; the cooling rate is slow enough; and the end temperature is low. In this chapter, based on a large number of experiments, the temperature drop rule is determined to be a proportional drop, wherek is the cooling coefficient. The number of iterations at each temperature takes a fixed step and is determined according to the scale of the problem. Generally, rules related to the neighborhood are adopted. The algorithm stop condition adopts the zero-degree method: That is, given a small positive number, when the temperature is less than or equal to this positive number, the algorithm stops and the temperature reaches the lowest.The specific SAA process is described as follows:(1)
Set the initial temperature, end temperature and temperature decay rate.(2)
Judge the selection condition; if it is met, go to step 5; otherwise, go to step 3.(3)
Initialize the number of inner loopsl.(4)
Implement the aforementioned three neighborhood transformation mechanisms for the current solution based on the probability, determine whether the generated solution meets all constraints, and select a feasible generated solution as the neighborhood solution.(5)
Calculate the cost of the neighborhood solution and the cost of the current solution.(6)
Output optimal solution.Through the introduction of the model, we know that the parameter setting is very important. Setting a number parameter can make the algorithm effect much better, and a poor parameter will delay the efficiency of the algorithm or even get a worse solution. Therefore, in the selection of parameters, we conduct comparative screening through multiple trials. However, there are many parameters of the SAA. This article selects two important parameters, the cooling rate and the initial temperature, to conduct experiments to measure the sensitivity of the algorithm model to the two parameters. Through a large number of experiments, the optimal parameters of a SAA based on water resource allocation can be obtained.In order to ensure the validity of the experiment, the experiment is carried out in the way of controlling variables. When other parameters remain unchanged, only the cooling rate and initial temperature are changed. Because it is a comparison of a single parameter, there is no experimental group in which the two variables of the initial temperature and the cooling rate are changed at the same time. For the cooling rate, set it to 0.7, 0.75, 0.8, 0.85, 0.9, and 0.95, and perform 30 simulation runs on each rate. Recording the improvement rate of 30 times, respectively, and take the average value as the average improvement rate. For the initial temperature, set 500, 600, 700, 800, 900, and 1000. At each temperature, 30 simulation runs are performed on it, and the improvement rate of 30 times is recorded respectively, and the average value is taken as the average improvement rate. The improvement rate is as follows: (optimized solution-initial solution)/initial solution.It can be seen from Figure6 that whether it is the initial temperature or the cooling rate, as the independent variable increases, the average improvement rate also increases. When the initial temperature is 500, the average improvement rate is 32%; when it reaches 1000, the average improvement rate reaches 49%, an increase of 17%, and an increase of 49%; when the cooling rate is 0.7, the average improvement rate is 59%. When the cooling rate reached 0.95, the average improvement rate was 79%, an increase of 20%, and the increase reached 33%. Therefore, we should set a larger value for the parameters of the algorithm.Figure 6
The effect of cooling rate and initial temperature on the average improvement rate.After getting the effect of parameter changes on the improvement rate, we updated the parameters, choosing the initial temperature as 1000 and the cooling rate as 0.90. Because the cooling rate of 0.95 is too fast, the algorithm has stopped before reaching the optimal solution, so the cooling rate of 0.9 is selected. We set the temperature iteration here to 50, and perform the SAA 10 times on our initial data, and record the improvement rate and the running time of the algorithm each time, as shown in Figures7 and 8.Figure 7
Improvement rate of annealing algorithm.Figure 8
Running time.Figure7 shows that after running the annealing algorithm, the improvement rate is above 40%. And in 10 operations, the improvement rate is greater than 50% accounted for 90%, 60% or higher accounted for 70%, 80% or higher accounted for 50%, 90% or higher 40%, and the highest rate reached 96%. This can show that after the SAA, the optimization strategy can meet the optimization requirements of our algorithm design to provide the bigger the better the initial solution, and the optimization improvement rate is in a relatively high state.Figure8 is the time for ten operations, which can be found to be between 6.5 s and 10.2 s. In ten operations, the calculation time of the algorithm fluctuates due to the difference in the optimization path and value of the objective function. Generally speaking, when the optimization efficiency is high, the operation time of less than 10 s is satisfactory.


#### 2.3.4. Example Analysis

We optimized the allocation of water resources in the Yangtze River Basin, taking the initial temperature as 1000 and taking the cooling rate as 0.9, and optimizing the objective function we defined. The results are shown in Table1.Table 1
Results of SAA solution example 1.
Initial valueObjective functionRelative error(0.7, 40)101.33570.02%(2.0, 40)101.31390(0.5, 60)101.33570.02%(2.5, 60)101.31390(6.0, 100)101.31390It can be seen from Table1 that when the initial value is different, the error rate of the objective function is very low, which can be said to be zero error. Due to the low error, considering the situation of multiparameter optimization, the cooling rate, iteration length, and k are analyzed, and the results are shown in Table 2.Table 2
Analysis of cooling speed and iteration length.
akLengthObjective function0.9871920110.8120.9528320101.3130.913830101.9790.86650136.870.74150150.1240.521100240In Table2, changing multiple parameters, the accuracy of the objective function is still high, but at the initial temperature, k is low. Therefore, the error is relatively large when the number of iterations is too high and even reaches 100% of the error. Finally, the initial temperature and termination temperature are analyzed. The results are shown in Table 3.Table 3
Analysis of starting temperature and ending temperature.
T0TeObjective function2000.0001101.313920.0001101.38870.20.0001101.83392000.001101.3382000.01101.40122000.1101.697In Table3, when both the temperature and the termination temperature change, the accuracy of the objective function is very high, especially when the initial temperature does not change to 200, the change of the end temperature is not high for the change of the objective function, indicating that the termination temperature is not very sensitive to the change of the objective function.


## 2.1. SAA

### 2.1.1. Typical SAA

The SAA will be different due to the different acceptance criteria, cooling speed table, memory function, and parallel function [9], so according to these several index algorithm models, there are roughly the following classifications. This article explains the acceptance criteria of the dominant relationship between the new comprehensive solution and the current solution.Synthesizing the acceptance criterion of the dominance relationship between the new solution and the current solution, the probability of accepting the new solution isp, as in the following formula:(1)p=1,Δr≤0,exp−ΔrUa,Δr>0,where a is converted from a multidimensional standard distance to Δr single-dimensional distance; use the weight vector λi to transform the multistandard information into one process, as shown in the following formula:(2)Δr=rfm,λ−rfn,λ,rF,λ.Or it can be expressed as follows:(3)Δr=∑i=1Mλifi.The following equation is the expression of the function(4)r⋅=f⋅,λ.This model only compares the new solution with the current solution, and the scope of reliable consideration of the solution is not comprehensive because it does not consider the comparison of the new solution with other previous solutions.The latest state of the SAA is generated based on the previous state. The parallel algorithm model can essentially improve the performance of the model and narrow the scope of the search solution.U is defined by the probability convergence obtained from the normal distribution, as follows:(5)g−UrM<Egi<g+UrM.In the calculation process, setting a set of initial annealing temperatures and annealing speeds, the initial result obtained can be expressed byg. In independent identical distribution [10], the mean squared difference of g can be calculated; then the expected value of g obeys an approximate normal distribution and satisfies(6)g−UrM<Egi<g+UrM,where g is the initial result set, as in the following formula:(7)g=g1,g2,…,gi.Search for the optimal value by controlling the weight value of the objective function in the solution process, allowing a specific weight value to perform multiple iterations. The weight value function is [11], as in thefollowing equation:(8)λi=pλiq,nim≥nim′,λiqp,nim<nim′.In equation (8), q > 1, which explains the new solution for the minimum algorithm; the minimum value is the minimum value of the objective function, as in thefollowing equation:(9)min1,∏i=1Mexpλinim−nizU.This model can increase or decrease the acceptance probability of the new solution so that the new solution is not limited to a certain local range [12].


### 2.1.2. Combinatorial Optimization Problem

A data point in the combinatorial optimization problem can be expressed as (h, f). Among them, the solution space h is a feasible solution set, and the objective function f is a mapping [13].In combinatorial optimization, the minimization problem is to find the minimum value of the objective function through a function [14], as shown in thefollowing equation:(10)minfx,x∈H.The problem of maximization is to find the maximum value of the objective function through a function [15], as in the following formula:(11)maxfx,x∈H.


### 2.1.3. Metropolis Guidelines

The Metropolis criterion expression is shown inthefollowing equation, where i and j are the states at the corresponding time:(12)r=expEi,EjKT.In equation (12), a random number generator is usually used to generate a random number in the interval [0, 1]. This random number must be less than r, r < 1. In the new state, j is the important state, and the i state is replaced to become the new current state; if j is not an important state, discard j, and i remains the current state.


### 2.1.4. The Characteristics of the SAA

In the combinatorial optimization problem determined by analysis, if the Metropolis criterion is used for constraint update at anyT value, there are not many related studies on other criteria, so Metropolis criterion is chosen to make the optimization problem reach a balanced state distribution [16], as shown in thefollowing equation:(13)pix=i=qiT=1N0texp−ciT.In equation (13), X is the random variable in the current state of the SAA [17], and(14)N0t=∑j=ξexp−cjT.Equation (14) is the normalization factor. If (13) is satisfied, the SAA has a convergence trend, which can make the overall convergence to the optimal solution [18].Water Resources Allocation. In the process of water resources allocation and development and utilization, the relatively fair of the main water use needs of various uses must be guaranteed so as to achieve the most reasonable and scientific water resources allocation effect. Therefore, it is necessary to strengthen the control of the use of water resources and strive to achieve true fair distribution and sustainable use of water resources [19, 20].The distribution method is discussed in two situations: one is the situation of oversupply, which adopts the form of distribution on demand; the other is the situation where supply exceeds demand, and this situation is also divided into two ways. One is to allocate proportionally according to demand. When the development of each district is similar, it is allocated to each district according to the proportion of water demand; if the development levels of the two places are inconsistent, priority should be given to efficiency. Appropriately tilt towards high-efficiency industries so that the guarantee rate of high-efficiency water industries is higher than that of low-efficiency water industries [21].The early allocation of water resources was guided by the optimal dispatch of reservoirs and the pursuit of maximum economic benefits at this stage. The distribution of water quantity is realized by the method of “determining supply based on demand” and “determining supply based on demand” [22]. By the 1980s, the problem of water pollution received people’s attention, and the allocation of water resources began from a single water allocation to a combined allocation of water and quality [23].With the development of the theory of optimal allocation of water resources, the types of optimal allocation of water resources have gone through the following stages: (1) optimal allocation of water resources based on water quantity allocation; (2) optimal allocation of water resources considering water quality factors; (3) surface-groundwater joint optimal allocation; (4) regional water resources optimal allocation; and (5) basin water resources optimal allocation and cross-basin water resources optimal allocation (also called pan-basin water resources optimal allocation). Due to the needs of water resources allocation practice, the research content mainly focuses on allocation theory, allocation method, allocation mechanism, and allocation evaluation.


## 2.1.1. Typical SAA

The SAA will be different due to the different acceptance criteria, cooling speed table, memory function, and parallel function [9], so according to these several index algorithm models, there are roughly the following classifications. This article explains the acceptance criteria of the dominant relationship between the new comprehensive solution and the current solution.Synthesizing the acceptance criterion of the dominance relationship between the new solution and the current solution, the probability of accepting the new solution isp, as in the following formula:(1)p=1,Δr≤0,exp−ΔrUa,Δr>0,where a is converted from a multidimensional standard distance to Δr single-dimensional distance; use the weight vector λi to transform the multistandard information into one process, as shown in the following formula:(2)Δr=rfm,λ−rfn,λ,rF,λ.Or it can be expressed as follows:(3)Δr=∑i=1Mλifi.The following equation is the expression of the function(4)r⋅=f⋅,λ.This model only compares the new solution with the current solution, and the scope of reliable consideration of the solution is not comprehensive because it does not consider the comparison of the new solution with other previous solutions.The latest state of the SAA is generated based on the previous state. The parallel algorithm model can essentially improve the performance of the model and narrow the scope of the search solution.U is defined by the probability convergence obtained from the normal distribution, as follows:(5)g−UrM<Egi<g+UrM.In the calculation process, setting a set of initial annealing temperatures and annealing speeds, the initial result obtained can be expressed byg. In independent identical distribution [10], the mean squared difference of g can be calculated; then the expected value of g obeys an approximate normal distribution and satisfies(6)g−UrM<Egi<g+UrM,where g is the initial result set, as in the following formula:(7)g=g1,g2,…,gi.Search for the optimal value by controlling the weight value of the objective function in the solution process, allowing a specific weight value to perform multiple iterations. The weight value function is [11], as in thefollowing equation:(8)λi=pλiq,nim≥nim′,λiqp,nim<nim′.In equation (8), q > 1, which explains the new solution for the minimum algorithm; the minimum value is the minimum value of the objective function, as in thefollowing equation:(9)min1,∏i=1Mexpλinim−nizU.This model can increase or decrease the acceptance probability of the new solution so that the new solution is not limited to a certain local range [12].


## 2.1.2. Combinatorial Optimization Problem

A data point in the combinatorial optimization problem can be expressed as (h, f). Among them, the solution space h is a feasible solution set, and the objective function f is a mapping [13].In combinatorial optimization, the minimization problem is to find the minimum value of the objective function through a function [14], as shown in thefollowing equation:(10)minfx,x∈H.The problem of maximization is to find the maximum value of the objective function through a function [15], as in the following formula:(11)maxfx,x∈H.


## 2.1.3. Metropolis Guidelines

The Metropolis criterion expression is shown inthefollowing equation, where i and j are the states at the corresponding time:(12)r=expEi,EjKT.In equation (12), a random number generator is usually used to generate a random number in the interval [0, 1]. This random number must be less than r, r < 1. In the new state, j is the important state, and the i state is replaced to become the new current state; if j is not an important state, discard j, and i remains the current state.


## 2.1.4. The Characteristics of the SAA

In the combinatorial optimization problem determined by analysis, if the Metropolis criterion is used for constraint update at anyT value, there are not many related studies on other criteria, so Metropolis criterion is chosen to make the optimization problem reach a balanced state distribution [16], as shown in thefollowing equation:(13)pix=i=qiT=1N0texp−ciT.In equation (13), X is the random variable in the current state of the SAA [17], and(14)N0t=∑j=ξexp−cjT.Equation (14) is the normalization factor. If (13) is satisfied, the SAA has a convergence trend, which can make the overall convergence to the optimal solution [18].Water Resources Allocation. In the process of water resources allocation and development and utilization, the relatively fair of the main water use needs of various uses must be guaranteed so as to achieve the most reasonable and scientific water resources allocation effect. Therefore, it is necessary to strengthen the control of the use of water resources and strive to achieve true fair distribution and sustainable use of water resources [19, 20].The distribution method is discussed in two situations: one is the situation of oversupply, which adopts the form of distribution on demand; the other is the situation where supply exceeds demand, and this situation is also divided into two ways. One is to allocate proportionally according to demand. When the development of each district is similar, it is allocated to each district according to the proportion of water demand; if the development levels of the two places are inconsistent, priority should be given to efficiency. Appropriately tilt towards high-efficiency industries so that the guarantee rate of high-efficiency water industries is higher than that of low-efficiency water industries [21].The early allocation of water resources was guided by the optimal dispatch of reservoirs and the pursuit of maximum economic benefits at this stage. The distribution of water quantity is realized by the method of “determining supply based on demand” and “determining supply based on demand” [22]. By the 1980s, the problem of water pollution received people’s attention, and the allocation of water resources began from a single water allocation to a combined allocation of water and quality [23].With the development of the theory of optimal allocation of water resources, the types of optimal allocation of water resources have gone through the following stages: (1) optimal allocation of water resources based on water quantity allocation; (2) optimal allocation of water resources considering water quality factors; (3) surface-groundwater joint optimal allocation; (4) regional water resources optimal allocation; and (5) basin water resources optimal allocation and cross-basin water resources optimal allocation (also called pan-basin water resources optimal allocation). Due to the needs of water resources allocation practice, the research content mainly focuses on allocation theory, allocation method, allocation mechanism, and allocation evaluation.


## 2.2. Current Status of Water Resources Environment

As a large country in the world, China has a large land area and complex and diverse terrain, which has caused obvious imbalances in water resources. Generally speaking, “the east is more and the west is less, and the south is more and the north is less.” There are many reasons for this, and there are many discussions among relevant geographers. Then, this article will do related research based on the perspective of science based on the uneven distribution of water resources [24].As shown in Figure1, the central and western regions of China are generally in a state of water shortage, and even many central regions are only transitional zones, not with sufficient water. The figure shows the water level line of precipitation. It can be found that there is relatively abundant precipitation in Jiangxi, Fujian, Guangdong, Yunnan, Hainan, and Taiwan, which also provides a large reserve of water resources in the south of the Yangtze River. The Yangtze and Yellow Rivers in the central region, Heilongjiang, Songhua River, and Yarlung Zangbo River in Tibet in the northeast provide abundant water resources for the local area. China has recognized ten major rivers, which provide huge reserves of domestic water resources [25].Figure 1
Distribution map of China’s water resources.


### 2.2.1. Analysis of Runoff Characteristics

The ten major rivers in China are the Yangtze River, Yellow River, Heilongjiang River, Songhua River, Pearl River, Yarlung Zangbo River, Canglan River, Nujiang River, Han River, and Liao River. These are ten big rivers that have watered the vast land of China, provided abundant water resources for the descendants of Yan and Huang, and lived and worked in peace and contentment on both sides of the river.In Figure2, the flow lengths of the ten major rivers. Transnational rivers only calculate the internal flow length and area, drainage area, and runoff (annual average value). It can be seen that as two major rivers, the Yangtze River and the Yellow River are at the forefront in terms of length and runoff, and the drainage area is several times that of other rivers.Figure 2
Overview of China’s top ten rivers.Figure3 shows the average annual runoff of the Yangtze River from 1956 to 2014; runoff is the amount of water flow in a certain cross section of a river, which can be used to express the abundance of water in the river, in order to analyze the country’s water resources allocation through the Yangtze River, the first river in China. In the follow-up situation, research is also done on the Yangtze River because it will take a lot more energy to conduct homogeneity research on other rivers.Figure 3
Average annual runoff of the Yangtze River.


## 2.2.1. Analysis of Runoff Characteristics

The ten major rivers in China are the Yangtze River, Yellow River, Heilongjiang River, Songhua River, Pearl River, Yarlung Zangbo River, Canglan River, Nujiang River, Han River, and Liao River. These are ten big rivers that have watered the vast land of China, provided abundant water resources for the descendants of Yan and Huang, and lived and worked in peace and contentment on both sides of the river.In Figure2, the flow lengths of the ten major rivers. Transnational rivers only calculate the internal flow length and area, drainage area, and runoff (annual average value). It can be seen that as two major rivers, the Yangtze River and the Yellow River are at the forefront in terms of length and runoff, and the drainage area is several times that of other rivers.Figure 2
Overview of China’s top ten rivers.Figure3 shows the average annual runoff of the Yangtze River from 1956 to 2014; runoff is the amount of water flow in a certain cross section of a river, which can be used to express the abundance of water in the river, in order to analyze the country’s water resources allocation through the Yangtze River, the first river in China. In the follow-up situation, research is also done on the Yangtze River because it will take a lot more energy to conduct homogeneity research on other rivers.Figure 3
Average annual runoff of the Yangtze River.


## 2.3. Model Fitting

### 2.3.1. Water Resources Zoning and Restoration Calculation

Zoning. China’s vast territory cannot be generalized, so the entire China is divided into regions. According to the degree of water shortage, it is divided into high water area, transition area, water shortage area, and extreme water shortage area. The partition conditions are shown in Figure 1 and are divided according to the amount of precipitation.Restoration. In the process of water resources calculation, the runoff data measured by the hydrological station is the data under the influence of human activities. As the influence of human activities intensifies, the hydrological variables measured at different periods cannot be regarded as coming from the same whole, and the consistency of the entire hydrological sequence is destroyed. In order to eliminate this influence and fully estimate the amount of water resources in the basin, it is necessary to restore and calculate the hydrological sequence so that they belong to the same population to ensure the consistency of the hydrological sequence.The method of restoring calculation here adopts the itemized survey method to restore the runoff data. The itemized survey method is to restore the unmeasured water volume on the cross section item by item and add the measured runoff of the cross section to obtain the natural runoff of the cross section. The basis of the item survey method is the water balance, and the formula for the water balance during the restoration calculation period is(15)W0=Wt+W′,where W0 is natural runoff, Wt is measured runoff, and W′ is reduced runoff.(16)W′=∏i=1nWi.In equation (16), i is various factors affecting water resources, such as agricultural water, industrial water, domestic water, water storage, rainwater, evaporation, water diversion, and so on. The reduction runoff is the sum of them.Among them, the runoff reduction affected by the reservoir regulation and storage is based on the water level storage curve of the reservoir and the water level data on the dam, and the water balance method is used to calculate the runoff reduction, and the period of the reduction calculation is monthly. If there are data on the inflow and outflow of the reservoir, the calculation results of the runoff restoration of the reservoir can be checked accordingly. The calculation formula for runoff reduction isasfollows:(17)Q0=Qt+v1−v2T.In equation (17), Q0 is the natural runoff, Qt is the measured runoff, v1 is the flow at the end of the month, and v2 is the flow at the beginning of the month.According to the restored formula, the other water usage of the Yangtze River can be found from the statistics of the Bureau of Statistics, and the approximate natural runoff can be estimated, as shown in Figure4.Figure 4
The average annual reduced runoff from 1956 to 2014.In Figure4, the average annual reduced runoff is generally larger than the measured runoff in Figure 3, and the trend is not much different. This shows the effectiveness of the reduction algorithm, and it can be found that the reduction runoff will be about 2000 larger than the actual measurement on average. This shows that human production and life have a greater impact on the runoff of the Yangtze River. Therefore, we should consider the production and life of human beings in terms of the optimal allocation of water resources. In the subsequent algorithm simulation, the corresponding restriction conditions will be mentioned.


### 2.3.2. Analysis of Supply and Demand Balance

Water supply facilities refer to all water supply and water source projects; in addition to water source projects under the jurisdiction of the water conservancy department, water source projects belonging to other departments are also included. For example, reservoirs, pumping stations of municipal water plants, self-provided water source projects of industrial and mining enterprises, and groundwater wells of rural residents are all water supply facilities. Water supply capacity refers to the maximum amount of water that a water supply project can provide under the condition of sufficient incoming water, generally refers to the maximum water supply capacity, and is related to the scale of the water conservancy project. Water storage project: it refers to the storage limit of the reservoir and the water storage capacity of some greening. Water diversion project: it refers to canals, water station pipes, and other channels with drainage capacity. Water lifting project: it refers to the extraction of water from seawater desalination and groundwater wells. Groundwater supply: it refers to groundwater resources that have not been fully extracted underground. The specific water supply capacity is shown in Figure5.Figure 5
The proportion of water supply capacity of various water supply projects in the water supply capacity of the whole basin.As shown in Figure5, the water supply capacity of groundwater projects is the largest, because the freshwater reserves of groundwater are the largest. Because it is difficult to extract water for self-use, the reserves are always available, which can be used as emergency water supply and can last a long time. Many other projects, such as water diversion and water lift projects, are based on water plants, and often supply exceeds demand. Particularly in water-scarce areas, there is a shortage of water supply.


### 2.3.3. SAA Model

In the SAA, the binary conversion strategy for the current solution is obtained at each temperature, optimizing with 0 to 1 transformation, 1 to 1 transformation, and 1 to 0 transformation. On the premise of satisfying the constraints set by oneself, if the new solution of the water supply strategy is better than the current water supply strategy, the new solution will be regarded as the new current solution.In determining the annealing strategy, the principle of convergence is generally qualitatively summarized as follows: The initial temperature is high enough; the cooling rate is slow enough; and the end temperature is low. In this chapter, based on a large number of experiments, the temperature drop rule is determined to be a proportional drop, wherek is the cooling coefficient. The number of iterations at each temperature takes a fixed step and is determined according to the scale of the problem. Generally, rules related to the neighborhood are adopted. The algorithm stop condition adopts the zero-degree method: That is, given a small positive number, when the temperature is less than or equal to this positive number, the algorithm stops and the temperature reaches the lowest.The specific SAA process is described as follows:(1)
Set the initial temperature, end temperature and temperature decay rate.(2)
Judge the selection condition; if it is met, go to step 5; otherwise, go to step 3.(3)
Initialize the number of inner loopsl.(4)
Implement the aforementioned three neighborhood transformation mechanisms for the current solution based on the probability, determine whether the generated solution meets all constraints, and select a feasible generated solution as the neighborhood solution.(5)
Calculate the cost of the neighborhood solution and the cost of the current solution.(6)
Output optimal solution.Through the introduction of the model, we know that the parameter setting is very important. Setting a number parameter can make the algorithm effect much better, and a poor parameter will delay the efficiency of the algorithm or even get a worse solution. Therefore, in the selection of parameters, we conduct comparative screening through multiple trials. However, there are many parameters of the SAA. This article selects two important parameters, the cooling rate and the initial temperature, to conduct experiments to measure the sensitivity of the algorithm model to the two parameters. Through a large number of experiments, the optimal parameters of a SAA based on water resource allocation can be obtained.In order to ensure the validity of the experiment, the experiment is carried out in the way of controlling variables. When other parameters remain unchanged, only the cooling rate and initial temperature are changed. Because it is a comparison of a single parameter, there is no experimental group in which the two variables of the initial temperature and the cooling rate are changed at the same time. For the cooling rate, set it to 0.7, 0.75, 0.8, 0.85, 0.9, and 0.95, and perform 30 simulation runs on each rate. Recording the improvement rate of 30 times, respectively, and take the average value as the average improvement rate. For the initial temperature, set 500, 600, 700, 800, 900, and 1000. At each temperature, 30 simulation runs are performed on it, and the improvement rate of 30 times is recorded respectively, and the average value is taken as the average improvement rate. The improvement rate is as follows: (optimized solution-initial solution)/initial solution.It can be seen from Figure6 that whether it is the initial temperature or the cooling rate, as the independent variable increases, the average improvement rate also increases. When the initial temperature is 500, the average improvement rate is 32%; when it reaches 1000, the average improvement rate reaches 49%, an increase of 17%, and an increase of 49%; when the cooling rate is 0.7, the average improvement rate is 59%. When the cooling rate reached 0.95, the average improvement rate was 79%, an increase of 20%, and the increase reached 33%. Therefore, we should set a larger value for the parameters of the algorithm.Figure 6
The effect of cooling rate and initial temperature on the average improvement rate.After getting the effect of parameter changes on the improvement rate, we updated the parameters, choosing the initial temperature as 1000 and the cooling rate as 0.90. Because the cooling rate of 0.95 is too fast, the algorithm has stopped before reaching the optimal solution, so the cooling rate of 0.9 is selected. We set the temperature iteration here to 50, and perform the SAA 10 times on our initial data, and record the improvement rate and the running time of the algorithm each time, as shown in Figures7 and 8.Figure 7
Improvement rate of annealing algorithm.Figure 8
Running time.Figure7 shows that after running the annealing algorithm, the improvement rate is above 40%. And in 10 operations, the improvement rate is greater than 50% accounted for 90%, 60% or higher accounted for 70%, 80% or higher accounted for 50%, 90% or higher 40%, and the highest rate reached 96%. This can show that after the SAA, the optimization strategy can meet the optimization requirements of our algorithm design to provide the bigger the better the initial solution, and the optimization improvement rate is in a relatively high state.Figure8 is the time for ten operations, which can be found to be between 6.5 s and 10.2 s. In ten operations, the calculation time of the algorithm fluctuates due to the difference in the optimization path and value of the objective function. Generally speaking, when the optimization efficiency is high, the operation time of less than 10 s is satisfactory.


### 2.3.4. Example Analysis

We optimized the allocation of water resources in the Yangtze River Basin, taking the initial temperature as 1000 and taking the cooling rate as 0.9, and optimizing the objective function we defined. The results are shown in Table1.Table 1
Results of SAA solution example 1.
Initial valueObjective functionRelative error(0.7, 40)101.33570.02%(2.0, 40)101.31390(0.5, 60)101.33570.02%(2.5, 60)101.31390(6.0, 100)101.31390It can be seen from Table1 that when the initial value is different, the error rate of the objective function is very low, which can be said to be zero error. Due to the low error, considering the situation of multiparameter optimization, the cooling rate, iteration length, and k are analyzed, and the results are shown in Table 2.Table 2
Analysis of cooling speed and iteration length.
akLengthObjective function0.9871920110.8120.9528320101.3130.913830101.9790.86650136.870.74150150.1240.521100240In Table2, changing multiple parameters, the accuracy of the objective function is still high, but at the initial temperature, k is low. Therefore, the error is relatively large when the number of iterations is too high and even reaches 100% of the error. Finally, the initial temperature and termination temperature are analyzed. The results are shown in Table 3.Table 3
Analysis of starting temperature and ending temperature.
T0TeObjective function2000.0001101.313920.0001101.38870.20.0001101.83392000.001101.3382000.01101.40122000.1101.697In Table3, when both the temperature and the termination temperature change, the accuracy of the objective function is very high, especially when the initial temperature does not change to 200, the change of the end temperature is not high for the change of the objective function, indicating that the termination temperature is not very sensitive to the change of the objective function.


## 2.3.1. Water Resources Zoning and Restoration Calculation

Zoning. China’s vast territory cannot be generalized, so the entire China is divided into regions. According to the degree of water shortage, it is divided into high water area, transition area, water shortage area, and extreme water shortage area. The partition conditions are shown in Figure 1 and are divided according to the amount of precipitation.Restoration. In the process of water resources calculation, the runoff data measured by the hydrological station is the data under the influence of human activities. As the influence of human activities intensifies, the hydrological variables measured at different periods cannot be regarded as coming from the same whole, and the consistency of the entire hydrological sequence is destroyed. In order to eliminate this influence and fully estimate the amount of water resources in the basin, it is necessary to restore and calculate the hydrological sequence so that they belong to the same population to ensure the consistency of the hydrological sequence.The method of restoring calculation here adopts the itemized survey method to restore the runoff data. The itemized survey method is to restore the unmeasured water volume on the cross section item by item and add the measured runoff of the cross section to obtain the natural runoff of the cross section. The basis of the item survey method is the water balance, and the formula for the water balance during the restoration calculation period is(15)W0=Wt+W′,where W0 is natural runoff, Wt is measured runoff, and W′ is reduced runoff.(16)W′=∏i=1nWi.In equation (16), i is various factors affecting water resources, such as agricultural water, industrial water, domestic water, water storage, rainwater, evaporation, water diversion, and so on. The reduction runoff is the sum of them.Among them, the runoff reduction affected by the reservoir regulation and storage is based on the water level storage curve of the reservoir and the water level data on the dam, and the water balance method is used to calculate the runoff reduction, and the period of the reduction calculation is monthly. If there are data on the inflow and outflow of the reservoir, the calculation results of the runoff restoration of the reservoir can be checked accordingly. The calculation formula for runoff reduction isasfollows:(17)Q0=Qt+v1−v2T.In equation (17), Q0 is the natural runoff, Qt is the measured runoff, v1 is the flow at the end of the month, and v2 is the flow at the beginning of the month.According to the restored formula, the other water usage of the Yangtze River can be found from the statistics of the Bureau of Statistics, and the approximate natural runoff can be estimated, as shown in Figure4.Figure 4
The average annual reduced runoff from 1956 to 2014.In Figure4, the average annual reduced runoff is generally larger than the measured runoff in Figure 3, and the trend is not much different. This shows the effectiveness of the reduction algorithm, and it can be found that the reduction runoff will be about 2000 larger than the actual measurement on average. This shows that human production and life have a greater impact on the runoff of the Yangtze River. Therefore, we should consider the production and life of human beings in terms of the optimal allocation of water resources. In the subsequent algorithm simulation, the corresponding restriction conditions will be mentioned.


## 2.3.2. Analysis of Supply and Demand Balance

Water supply facilities refer to all water supply and water source projects; in addition to water source projects under the jurisdiction of the water conservancy department, water source projects belonging to other departments are also included. For example, reservoirs, pumping stations of municipal water plants, self-provided water source projects of industrial and mining enterprises, and groundwater wells of rural residents are all water supply facilities. Water supply capacity refers to the maximum amount of water that a water supply project can provide under the condition of sufficient incoming water, generally refers to the maximum water supply capacity, and is related to the scale of the water conservancy project. Water storage project: it refers to the storage limit of the reservoir and the water storage capacity of some greening. Water diversion project: it refers to canals, water station pipes, and other channels with drainage capacity. Water lifting project: it refers to the extraction of water from seawater desalination and groundwater wells. Groundwater supply: it refers to groundwater resources that have not been fully extracted underground. The specific water supply capacity is shown in Figure5.Figure 5
The proportion of water supply capacity of various water supply projects in the water supply capacity of the whole basin.As shown in Figure5, the water supply capacity of groundwater projects is the largest, because the freshwater reserves of groundwater are the largest. Because it is difficult to extract water for self-use, the reserves are always available, which can be used as emergency water supply and can last a long time. Many other projects, such as water diversion and water lift projects, are based on water plants, and often supply exceeds demand. Particularly in water-scarce areas, there is a shortage of water supply.


## 2.3.3. SAA Model

In the SAA, the binary conversion strategy for the current solution is obtained at each temperature, optimizing with 0 to 1 transformation, 1 to 1 transformation, and 1 to 0 transformation. On the premise of satisfying the constraints set by oneself, if the new solution of the water supply strategy is better than the current water supply strategy, the new solution will be regarded as the new current solution.In determining the annealing strategy, the principle of convergence is generally qualitatively summarized as follows: The initial temperature is high enough; the cooling rate is slow enough; and the end temperature is low. In this chapter, based on a large number of experiments, the temperature drop rule is determined to be a proportional drop, wherek is the cooling coefficient. The number of iterations at each temperature takes a fixed step and is determined according to the scale of the problem. Generally, rules related to the neighborhood are adopted. The algorithm stop condition adopts the zero-degree method: That is, given a small positive number, when the temperature is less than or equal to this positive number, the algorithm stops and the temperature reaches the lowest.The specific SAA process is described as follows:(1)
Set the initial temperature, end temperature and temperature decay rate.(2)
Judge the selection condition; if it is met, go to step 5; otherwise, go to step 3.(3)
Initialize the number of inner loopsl.(4)
Implement the aforementioned three neighborhood transformation mechanisms for the current solution based on the probability, determine whether the generated solution meets all constraints, and select a feasible generated solution as the neighborhood solution.(5)
Calculate the cost of the neighborhood solution and the cost of the current solution.(6)
Output optimal solution.Through the introduction of the model, we know that the parameter setting is very important. Setting a number parameter can make the algorithm effect much better, and a poor parameter will delay the efficiency of the algorithm or even get a worse solution. Therefore, in the selection of parameters, we conduct comparative screening through multiple trials. However, there are many parameters of the SAA. This article selects two important parameters, the cooling rate and the initial temperature, to conduct experiments to measure the sensitivity of the algorithm model to the two parameters. Through a large number of experiments, the optimal parameters of a SAA based on water resource allocation can be obtained.In order to ensure the validity of the experiment, the experiment is carried out in the way of controlling variables. When other parameters remain unchanged, only the cooling rate and initial temperature are changed. Because it is a comparison of a single parameter, there is no experimental group in which the two variables of the initial temperature and the cooling rate are changed at the same time. For the cooling rate, set it to 0.7, 0.75, 0.8, 0.85, 0.9, and 0.95, and perform 30 simulation runs on each rate. Recording the improvement rate of 30 times, respectively, and take the average value as the average improvement rate. For the initial temperature, set 500, 600, 700, 800, 900, and 1000. At each temperature, 30 simulation runs are performed on it, and the improvement rate of 30 times is recorded respectively, and the average value is taken as the average improvement rate. The improvement rate is as follows: (optimized solution-initial solution)/initial solution.It can be seen from Figure6 that whether it is the initial temperature or the cooling rate, as the independent variable increases, the average improvement rate also increases. When the initial temperature is 500, the average improvement rate is 32%; when it reaches 1000, the average improvement rate reaches 49%, an increase of 17%, and an increase of 49%; when the cooling rate is 0.7, the average improvement rate is 59%. When the cooling rate reached 0.95, the average improvement rate was 79%, an increase of 20%, and the increase reached 33%. Therefore, we should set a larger value for the parameters of the algorithm.Figure 6
The effect of cooling rate and initial temperature on the average improvement rate.After getting the effect of parameter changes on the improvement rate, we updated the parameters, choosing the initial temperature as 1000 and the cooling rate as 0.90. Because the cooling rate of 0.95 is too fast, the algorithm has stopped before reaching the optimal solution, so the cooling rate of 0.9 is selected. We set the temperature iteration here to 50, and perform the SAA 10 times on our initial data, and record the improvement rate and the running time of the algorithm each time, as shown in Figures7 and 8.Figure 7
Improvement rate of annealing algorithm.Figure 8
Running time.Figure7 shows that after running the annealing algorithm, the improvement rate is above 40%. And in 10 operations, the improvement rate is greater than 50% accounted for 90%, 60% or higher accounted for 70%, 80% or higher accounted for 50%, 90% or higher 40%, and the highest rate reached 96%. This can show that after the SAA, the optimization strategy can meet the optimization requirements of our algorithm design to provide the bigger the better the initial solution, and the optimization improvement rate is in a relatively high state.Figure8 is the time for ten operations, which can be found to be between 6.5 s and 10.2 s. In ten operations, the calculation time of the algorithm fluctuates due to the difference in the optimization path and value of the objective function. Generally speaking, when the optimization efficiency is high, the operation time of less than 10 s is satisfactory.


## 2.3.4. Example Analysis

We optimized the allocation of water resources in the Yangtze River Basin, taking the initial temperature as 1000 and taking the cooling rate as 0.9, and optimizing the objective function we defined. The results are shown in Table1.Table 1
Results of SAA solution example 1.
Initial valueObjective functionRelative error(0.7, 40)101.33570.02%(2.0, 40)101.31390(0.5, 60)101.33570.02%(2.5, 60)101.31390(6.0, 100)101.31390It can be seen from Table1 that when the initial value is different, the error rate of the objective function is very low, which can be said to be zero error. Due to the low error, considering the situation of multiparameter optimization, the cooling rate, iteration length, and k are analyzed, and the results are shown in Table 2.Table 2
Analysis of cooling speed and iteration length.
akLengthObjective function0.9871920110.8120.9528320101.3130.913830101.9790.86650136.870.74150150.1240.521100240In Table2, changing multiple parameters, the accuracy of the objective function is still high, but at the initial temperature, k is low. Therefore, the error is relatively large when the number of iterations is too high and even reaches 100% of the error. Finally, the initial temperature and termination temperature are analyzed. The results are shown in Table 3.Table 3
Analysis of starting temperature and ending temperature.
T0TeObjective function2000.0001101.313920.0001101.38870.20.0001101.83392000.001101.3382000.01101.40122000.1101.697In Table3, when both the temperature and the termination temperature change, the accuracy of the objective function is very high, especially when the initial temperature does not change to 200, the change of the end temperature is not high for the change of the objective function, indicating that the termination temperature is not very sensitive to the change of the objective function.


## 3. Simulation Experiment Analysis

Although the improvement rate based on the annealing algorithm has been able to meet the requirements, it is necessary to improve the algorithm for China’s complex geographic situation.The judgment conditions of the improved algorithm have been explained in the introduction of the simulated annealing algorithm. The improvement this time is more about the changes in the order and some parameters. The improved algorithm flow is shown in Figure9.Figure 9
Improved SAA solution process.


### 3.1. Coding

The encoding method selected in this article is a more commonly used method, that is, path representation. Directly express the selection and visit order of the city as the order selection of the path. To give a simple example, the TSP question selects 7 cities to visit. For [4275163], the order of visits to the cities is 4-2-7-5-1-6-3, that is, to visit locations 2, 7, 5, 1, 6, and 3 in sequence from location 4 according to the sequence number, and finally return to location 4, to obtain a complete path visit sequence without loops.


### 3.2. Objective Function

The objective function of the optimal allocation of water resources is also the fitness function. We can simply understand it as the sum of the paths to each city, as shown inthefollowing equation:(18)Zz1,z2,…,zn=∑i=1n−1dzi,zi+1+dz1,zn.In the end, seeking the final solution to the problem of optimal allocation of water resources will become the problem of seeking the minimum, that is, using the execution process of the SAA to find the extreme value of the objective function. It can be considered thats∗=c1∗,c2∗,…,cn∗ is the final solution of the problem.


### 3.3. Difference in Objective Function

The objective function difference is the difference between the new solution produced in this iteration and the current solution as shown in the following equation:(19)Δf=ZSi′−Zsi.In (16), Δf represents the difference of the objective function, Z() represents the objective function, that is, the cost function, si′ is the new solution, and si is the current solution.


### 3.4. Comparative Analysis

In the experiment, the optimal allocation of water resources in the Yangtze River Basin is aimed at covering the largest area with the shortest pipeline route, and the optimization of the allocation of water resources will no longer have the situation of abundant water while lack of water. For the original algorithm and the improved algorithm, ten algorithm calculations are performed respectively, and the average value is taken as the comparison data. The results are shown in Table4.Table 4
Performance comparison between the original SAA and the improved SAA.
AlgorithmOriginal annealing algorithmImproved SAAAverage3043.5692753.072Maximum3245.4522972.298Minimum2865.4602498.986In Table4, the average distance optimized by the original SAA is 3043.569 km, while the improved algorithm is 2753.072 km, which saves about 289 km compared with the original algorithm. In actual situations, adding losses can save even more. In the original algorithm, the maximum value is 3245.452 and the minimum value is 2865.460, both of which are higher than the improved algorithm. This shows that the improved algorithm can be more effective than the original algorithm and can achieve a better water resource allocation optimization effect.Afterwards, iterative value analysis is performed on the original SAA and the improved SAA that obtain the minimum objective function value, as shown in Figure10.Figure 10
The optimization curve of the original annealing algorithm and the improved algorithm.As shown in Figure10, for the original algorithm for 200 to 1000 times of optimization roadmap, it achieved the minimum value of 2865.460 in 825 iterations and reached the optimal solution in a very short time; for the improved algorithm, it iterated 2000 to 5600 times, and it reached the optimal solution at 3800, which dropped to 2498.986; regarding the number of iterations, this shows that the improved genetic algorithm will be a lot more cautious in the cooling strategy, and it takes more iterations to reach the optimal solution. The original algorithm cools down very quickly, and the optimal solution is reached immediately, but the value of the optimal solution is also higher. This shows that the improved algorithm has a more stable optimization plan for the optimization of the objective function and can often get a more perfect route.


## 3.1. Coding

The encoding method selected in this article is a more commonly used method, that is, path representation. Directly express the selection and visit order of the city as the order selection of the path. To give a simple example, the TSP question selects 7 cities to visit. For [4275163], the order of visits to the cities is 4-2-7-5-1-6-3, that is, to visit locations 2, 7, 5, 1, 6, and 3 in sequence from location 4 according to the sequence number, and finally return to location 4, to obtain a complete path visit sequence without loops.


## 3.2. Objective Function

The objective function of the optimal allocation of water resources is also the fitness function. We can simply understand it as the sum of the paths to each city, as shown inthefollowing equation:(18)Zz1,z2,…,zn=∑i=1n−1dzi,zi+1+dz1,zn.In the end, seeking the final solution to the problem of optimal allocation of water resources will become the problem of seeking the minimum, that is, using the execution process of the SAA to find the extreme value of the objective function. It can be considered thats∗=c1∗,c2∗,…,cn∗ is the final solution of the problem.


## 3.3. Difference in Objective Function

The objective function difference is the difference between the new solution produced in this iteration and the current solution as shown in the following equation:(19)Δf=ZSi′−Zsi.In (16), Δf represents the difference of the objective function, Z() represents the objective function, that is, the cost function, si′ is the new solution, and si is the current solution.


## 3.4. Comparative Analysis

In the experiment, the optimal allocation of water resources in the Yangtze River Basin is aimed at covering the largest area with the shortest pipeline route, and the optimization of the allocation of water resources will no longer have the situation of abundant water while lack of water. For the original algorithm and the improved algorithm, ten algorithm calculations are performed respectively, and the average value is taken as the comparison data. The results are shown in Table4.Table 4
Performance comparison between the original SAA and the improved SAA.
AlgorithmOriginal annealing algorithmImproved SAAAverage3043.5692753.072Maximum3245.4522972.298Minimum2865.4602498.986In Table4, the average distance optimized by the original SAA is 3043.569 km, while the improved algorithm is 2753.072 km, which saves about 289 km compared with the original algorithm. In actual situations, adding losses can save even more. In the original algorithm, the maximum value is 3245.452 and the minimum value is 2865.460, both of which are higher than the improved algorithm. This shows that the improved algorithm can be more effective than the original algorithm and can achieve a better water resource allocation optimization effect.Afterwards, iterative value analysis is performed on the original SAA and the improved SAA that obtain the minimum objective function value, as shown in Figure10.Figure 10
The optimization curve of the original annealing algorithm and the improved algorithm.As shown in Figure10, for the original algorithm for 200 to 1000 times of optimization roadmap, it achieved the minimum value of 2865.460 in 825 iterations and reached the optimal solution in a very short time; for the improved algorithm, it iterated 2000 to 5600 times, and it reached the optimal solution at 3800, which dropped to 2498.986; regarding the number of iterations, this shows that the improved genetic algorithm will be a lot more cautious in the cooling strategy, and it takes more iterations to reach the optimal solution. The original algorithm cools down very quickly, and the optimal solution is reached immediately, but the value of the optimal solution is also higher. This shows that the improved algorithm has a more stable optimization plan for the optimization of the objective function and can often get a more perfect route.


## 4. Discussion

### 4.1. Save Water

#### 4.1.1. The Principle of Adapting Measures to Local Conditions

Adjust measures to local conditions, that is, choose the most suitable method according to different geographical locations and natural resources in different regions. My country ranks third in the world in terms of land area, with a vast territory, complex topography, numerous rivers, and different regions in terms of natural environment, water resources reserves and utilization conditions, and economic development levels. Therefore, the construction of my country’s water resource use control system should be followed. Based on the principle of adapting measures to local conditions, the national water function zoning and the national and provincial main function zoning shall be fully considered in the control of water resources use and different levels of restrictions on water use behaviors for different purposes in different regions, such as the tightness of the restrictions on water extraction permits. The level, the setting of the level of total control indicators, and the formulation of differentiated water prices. By adopting different levels of control measures, scientifically standardize the order of water use for various purposes, rationally use water resources, and promote the optimal allocation of water resources [26].


#### 4.1.2. The Principle of Priority Protection for Residents’ Domestic Water

Water resources are the material basis for human survival. Without water, humans will not survive. Only when humans survive will there be demand for water for production and ecology. Therefore, in the three types of water resources for life, production, and ecology, must first protect domestic water [27].


### 4.2. Sustainable Use of Water Resources

#### 4.2.1. Control of the Degree of Utilization of Domestic Water

Domestic water is mainly composed of two parts: residential water and public domestic water. Residential water refers to the water needed to meet the daily needs of residents. According to the degree of water demand, it can be divided into three categories: subsistence water (drinking water, kitchen water, etc.), general consumer water (water for bathing, washing, toilet flushing, etc.), and luxury water (recreational water and car wash water, etc.). Public domestic water is water with a public welfare nature, mainly referring to municipal sanitation water [28].


#### 4.2.2. Control of Agricultural Water Utilization

The characteristic of agricultural water use is the large amount of water used. According to the data in the Water Resources Bulletin in the past three years, the proportion of agricultural water consumption in the total water consumption of the country has basically remained at 63.5%, which is equivalent to three times the proportion of industrial water consumption. The agricultural water consumption rate (the percentage of the total water consumed) is also basically maintained at 65%, which is second only to the water consumption rate of the ecological environment. Irrigation water accounts for the largest proportion of agricultural water. With the rapid development of social economy and the rapid increase of industrial and urban water consumption, under the condition of water shortage, the allocation of water resources will definitely tend to increase the supply of industrial and urban domestic water and reduce the supply of agricultural water.


#### 4.2.3. Control of the Degree of Utilization of Industrial Water

Industrial water has the characteristics of complex water use process, high technical requirements, easy pollution, and high recycling rate. In our country, industrial water consumption ranks second in water consumption for various purposes. Therefore, efforts must be made to improve the efficiency of industrial water use and save industrial water [29].


## 4.1. Save Water

### 4.1.1. The Principle of Adapting Measures to Local Conditions

Adjust measures to local conditions, that is, choose the most suitable method according to different geographical locations and natural resources in different regions. My country ranks third in the world in terms of land area, with a vast territory, complex topography, numerous rivers, and different regions in terms of natural environment, water resources reserves and utilization conditions, and economic development levels. Therefore, the construction of my country’s water resource use control system should be followed. Based on the principle of adapting measures to local conditions, the national water function zoning and the national and provincial main function zoning shall be fully considered in the control of water resources use and different levels of restrictions on water use behaviors for different purposes in different regions, such as the tightness of the restrictions on water extraction permits. The level, the setting of the level of total control indicators, and the formulation of differentiated water prices. By adopting different levels of control measures, scientifically standardize the order of water use for various purposes, rationally use water resources, and promote the optimal allocation of water resources [26].


### 4.1.2. The Principle of Priority Protection for Residents’ Domestic Water

Water resources are the material basis for human survival. Without water, humans will not survive. Only when humans survive will there be demand for water for production and ecology. Therefore, in the three types of water resources for life, production, and ecology, must first protect domestic water [27].


## 4.1.1. The Principle of Adapting Measures to Local Conditions

Adjust measures to local conditions, that is, choose the most suitable method according to different geographical locations and natural resources in different regions. My country ranks third in the world in terms of land area, with a vast territory, complex topography, numerous rivers, and different regions in terms of natural environment, water resources reserves and utilization conditions, and economic development levels. Therefore, the construction of my country’s water resource use control system should be followed. Based on the principle of adapting measures to local conditions, the national water function zoning and the national and provincial main function zoning shall be fully considered in the control of water resources use and different levels of restrictions on water use behaviors for different purposes in different regions, such as the tightness of the restrictions on water extraction permits. The level, the setting of the level of total control indicators, and the formulation of differentiated water prices. By adopting different levels of control measures, scientifically standardize the order of water use for various purposes, rationally use water resources, and promote the optimal allocation of water resources [26].


## 4.1.2. The Principle of Priority Protection for Residents’ Domestic Water

Water resources are the material basis for human survival. Without water, humans will not survive. Only when humans survive will there be demand for water for production and ecology. Therefore, in the three types of water resources for life, production, and ecology, must first protect domestic water [27].


## 4.2. Sustainable Use of Water Resources

### 4.2.1. Control of the Degree of Utilization of Domestic Water

Domestic water is mainly composed of two parts: residential water and public domestic water. Residential water refers to the water needed to meet the daily needs of residents. According to the degree of water demand, it can be divided into three categories: subsistence water (drinking water, kitchen water, etc.), general consumer water (water for bathing, washing, toilet flushing, etc.), and luxury water (recreational water and car wash water, etc.). Public domestic water is water with a public welfare nature, mainly referring to municipal sanitation water [28].


### 4.2.2. Control of Agricultural Water Utilization

The characteristic of agricultural water use is the large amount of water used. According to the data in the Water Resources Bulletin in the past three years, the proportion of agricultural water consumption in the total water consumption of the country has basically remained at 63.5%, which is equivalent to three times the proportion of industrial water consumption. The agricultural water consumption rate (the percentage of the total water consumed) is also basically maintained at 65%, which is second only to the water consumption rate of the ecological environment. Irrigation water accounts for the largest proportion of agricultural water. With the rapid development of social economy and the rapid increase of industrial and urban water consumption, under the condition of water shortage, the allocation of water resources will definitely tend to increase the supply of industrial and urban domestic water and reduce the supply of agricultural water.


### 4.2.3. Control of the Degree of Utilization of Industrial Water

Industrial water has the characteristics of complex water use process, high technical requirements, easy pollution, and high recycling rate. In our country, industrial water consumption ranks second in water consumption for various purposes. Therefore, efforts must be made to improve the efficiency of industrial water use and save industrial water [29].


## 4.2.1. Control of the Degree of Utilization of Domestic Water

Domestic water is mainly composed of two parts: residential water and public domestic water. Residential water refers to the water needed to meet the daily needs of residents. According to the degree of water demand, it can be divided into three categories: subsistence water (drinking water, kitchen water, etc.), general consumer water (water for bathing, washing, toilet flushing, etc.), and luxury water (recreational water and car wash water, etc.). Public domestic water is water with a public welfare nature, mainly referring to municipal sanitation water [28].


## 4.2.2. Control of Agricultural Water Utilization

The characteristic of agricultural water use is the large amount of water used. According to the data in the Water Resources Bulletin in the past three years, the proportion of agricultural water consumption in the total water consumption of the country has basically remained at 63.5%, which is equivalent to three times the proportion of industrial water consumption. The agricultural water consumption rate (the percentage of the total water consumed) is also basically maintained at 65%, which is second only to the water consumption rate of the ecological environment. Irrigation water accounts for the largest proportion of agricultural water. With the rapid development of social economy and the rapid increase of industrial and urban water consumption, under the condition of water shortage, the allocation of water resources will definitely tend to increase the supply of industrial and urban domestic water and reduce the supply of agricultural water.


## 4.2.3. Control of the Degree of Utilization of Industrial Water

Industrial water has the characteristics of complex water use process, high technical requirements, easy pollution, and high recycling rate. In our country, industrial water consumption ranks second in water consumption for various purposes. Therefore, efforts must be made to improve the efficiency of industrial water use and save industrial water [29].


## 5. Conclusions

Satisfying the water demand for the ecological environment is the basic guarantee for the sound operation of the entire natural ecological cycle system and is the basic condition for human social life and economic development. Therefore, in an environment where the issue of ecological protection is gradually receiving human attention and research, the water demand for the ecological environment is guaranteed. This article is based on the SAA and analyzes the configuration optimization for the uneven distribution of domestic water resources and the problem of water waste. In this article, the SAA and the related theories of water resources allocation are first introduced. Then for the simulation of the SAA in this article, the current situation of domestic water resources distribution is introduced first, and then the relevant constraints and steps are formulated for the Yangtze River Basin, and then the parameters of the algorithm are tested. Parameters such as temperature, final temperature, and cooling rate are optimally selected. After that, because the algorithm may not be improved enough for the complex situation of domestic water resources, the original algorithm is optimized. After optimization, it has a more perfect effect on the value of the objective function. For environmental protection, we should appropriately learn from the concept of protection and priority satisfaction of water for the ecological environment in various countries, and under the premise of giving priority to the protection of water for urban and rural residents, pay attention to the protection of water for the ecological environment, learn advanced control measures, and strengthen the control of water use for the ecological environment.



---

*Source: 2281856-2022-05-27.xml*