Optimization of distribution of emergency resources for emergency rescue points of oil and gas pipelines

: According to the inherent characteristics of long-distance oil and gas pipelines, the optimization of emergency resources allocation can be implemented to maximize the utilization of pipeline emergency resources under a certain cost of emergency investment. We built an improved solution of a multiple knapsack problem in a greedy algorithm, proposed maximizing Emergency Resources Factor (ERF) as the greedy strategy, and established the optimization model of emergency resources allocation. This model innovatively combines factors such as the centrality of rescue points, the risk of pipe sections, and the necessity of emergency resources. The results show that, compared to a conventional resource allocation in a fixed proportion, an optimized allocation can reduce resource shortage and redundancy by 2.660% and 1.051%, respectively. Therefore, this model can be used to control the initialization of resource allocation in emergency rescue points of long-distance oil and gas pipelines.


Background
Pipeline transport takes over most of the transportation of oil and gas. It plays an important role in economic development, social stability and the national defense construction.
In the event of accidents on main oil and gas pipeline, emergency resources, such as personnel and materials, should be delivered from the nearest rescue point in time to minimize direct and indirect losses.
Under the presumption that the rescue points along the pipeline have been established and the total cost of the emergency resources is fixed, the allocation of various emergency resources of each rescue point, which ensures the emergency resources requirements for accidents at any location of the pipeline and minimize the repairing time of emergency resources allocation, is about to be established.

Research content classification
Emergency rescue problems are generally divided into 3 categories according to the order of response: a. the location of emergency rescue points; b. emergency resource allocation; and c. emergency resource scheduling and distribution [1].
The most widely studied problem is resource scheduling and distribution optimization [2].The research on the location of rescue points and resource allocation is generally involved in the research of the resource scheduling model [3].
In the general emergency rescue problem, the resource allocation process is regarded as a network connection with equal weights [4], [5] appliedmulti-criteria optimization for distribution of disaster relief aid in flood and famine network scenarios. [6]optimized the emergency response after the earthquake. However, at long-distance oil and gas pipelines distributed along the route, geographical environmental factors and traffic conditions have direct impacts on the resource usage efficiency. In addition, the corresponding accident probability and severity of different pipeline sections vary [7].

Optimization algorithm
The commonly used optimization methods include direct calculating, linear programming, dynamic programming, and data mining. Heuristic Algorithm is used for the path or scheduling optimization frequently.
Particle Swarm Optimization (PSO) was used to optimize paths in early research. [8] suggested a multi-objective robust stochastic programming approach and it was successfully applied to earthquake scenarios. A PSO algorithm was designed for complex road network environment with inaccurate information [9]. The performance of this algorithm was limited by the local optimal solution and the size of problem. [10] converted multi-objective into single-objective models and added local disturbances to the designed PSO algorithm. [11]achieved faster and better search of scheduling by using the distribution curve of the Gauss function and ergodicity of chaos.
The Genetic Algorithm and improved methods based on it are frequently used. [12]mixed local search and the genetic algorithm to balance the fairness and timeliness of material delivery mechanisms. [13] combined the mutation operator with a modified genetic algorithm and improved the convergence of the path planning algorithm. The Cellular Genetic Algorithm (CGA) could provide for a multi-objective and multi-period emergency resource distribution model better than the GA [14]. [15] combined the GA and PSO, and considered the psychological satisfaction of the affected people as a guideline in scheduling supplies.
There are also some studies on improving the Ant Colony Optimization. A model of path optimization for the emergency evacuation based on the improved adaptive ant colony algorithm was constructed [16]. [17] integrated and improved the GA and ACO to optimize logistics routes. The resource allocation model involved three categories of the emergency rescue problem established by [18] using the differential evolutionary algorithm. But it was short of the consideration of resource diversity and types. The linear programming model was easy to solve [19]. However, as the types of emergency resources continue increasing, the workload of calculating convergence will increase exponentially.
The rules and operation process of direct calculating are very simple. Go through all the combinations that meet the requirements and select the optimal solution from them. [4] studied the optimization of resource allocation for storage tank fire accidents and considered two emergency supplies: fire-fighting water and foam concentrate. When considering a variety of relief supplies, there is a large number of arrangements for the allocation of various resources at rescue points. The lack of a search strategy will cost a lot of time.
[20]improved the coverage and utilization of ambulances and rescue cars through data mining. But in most cases, the collection of training and testing data sources is a big problem.
The solution to the allocation problem was focused only on the final arrangement of the amount of emergency resources [21]. Therefore, it is more practical to find methods around dynamic programming.

Paper organization
The rest of the paper is organized as follows. Section 2 describes the studied problem, the assumptions, and the factors that influence the emergency resource allocation. In section 3,the greedy algorithm used in resource allocation is explained, and the concept of the Emergency Resource Factor for greedy strategy is proposed. Section 4 proposes the solution method for the model. Section 5 analyzes a case in detail, offers the optimal allocation, and compares its resource utilization rate with the case of normal resource allocation. Finally, the conclusions are provided in section 6.

Problem description
A model for optimizing the resource reserve of rescue points should be established according to the characteristics of long-distance oil and gas pipelines.
In an ideal situation, the more abundant and larger the reserves of emergency supplies in each emergency rescue point are, the more timely and powerful is the support to the disaster-stricken points along the route. However, considering the local material storage conditions, costs and other factors, it is necessary to optimize the allocation of emergency rescue points' resources according to the geographical location, distribution path, material storage, emergency resource cost, and so on. Therefore, the factors affecting the allocation of emergency resources are assumed as follows.
a. Geographical centrality of rescue points The distance between the rescue point and the pipeline is the dominant factor. The longer the length of the pipe section under the jurisdiction of an emergency rescue point, the more resource reserves it has.
b. Risk degree of pipe sections For pipe sections of the same length, the higher the risk degree of the pipe section, the greater the probability of an accident, so the more emergency resources are required.
c. Traffic condition The more paths from the rescue point to the pipeline, the better the road conditions, the faster the resourcesare sent to the damage point.
d. Cost of resource purchase Emergency supplies with lower purchase costs should be distributed in large quantities and dispersed. Valuable resource should be centrally allocated and deployed uniformly.
e. Cost of resource storage Consider the difficulty of resource storage at rescue point. For example, if a remote rescue point is not suitable for personnel to be stationed, the allocation of personnel to that point could be reduced appropriately.
f. Only consider the rescue force provided by the pipeline company Since most of the long-distance pipelines are routed in desolated areas such as mountains, deserts, tunnels, and wastelands, the public security rescue force can be little used. Therefore, no other emergency forces shall be considered except the known emergency rescue points established by the pipeline company.
The range of factors that may affect the allocation of emergency resources is defined in Table 1.

The principle and steps of the Greedy Algorithm
Greedy Algorithms always make the best choice in the current view when solving problems. In other words, what is achieved is a local optimal solution in the sense without considering the overall optimal solution. The greedy algorithm makes successive greedy choices in an iterative manner. Each greedy choice reduces the problem to a smaller sub-problem. Therefore, its steps can be summarized as follows: a. Start from an initial solution of the problem. b. According to the greedy strategy, find a solution element of a feasible solution. c. Judge whether the given goal is reached. If it is, proceed to the next step. Otherwise, iterate step b.
d. Combine all the solution elements into a feasible solution to the problem.

The Greedy Strategy
Sort all emergency resources according to the Emergency Resource Factor value of cost per unit. The Greedy Strategy is that the resources with the largest ERF value of cost per unit are always preferred for allocation. According to the strategy, search the optimal resource allocation of each rescue point under a certain cost, which is the corresponding optimal emergency resources allocation. One thing to note is that the necessity of emergency resources is inversely proportional to the allocated amount.
The resource allocation problem is different from the parameter calculation in the greedy strategy in the knapsack problem. When considering the choice of items in the greedy strategy of the knapsack problem, the one with the greatest value is generally preferred. And for a single object, its value is constant, as shown in figure 1(a).
1(a). The relationship between object value and quantity in the knapsack problem.
1(b). The relationship between resource necessity and quantity in the resource allocation. Fig. 1. Difference between resource allocation and knapsack problem in the greedy strategy.
In the problem of resource allocation, priority will be given to those resources that have the largest increase in the overall ERF for allocation. However, the contribution of individual resources to the ERF varies.When a certain type of resources does not exist or the stock is small, the necessity of the resource is high. When the resource allocation has a certain amount, the necessity will decrease accordingly, as shown in Figure 1(b). For example, curve a. can represent common emergency resources with a general demand, such as personnel. Curve b. can represent consumable emergency resources, such as grinding wheel and wood block. Curve c. can represent necessary but small demand resource types, such as a generator and a pump.

Correctness proof of Greedy Algorithm
The proof is to examine a global optimal solution and then modify the solution by greedy choice. This choice turns the original problem into a similar but smaller problem.
The chosen Greedy Strategy must have no aftereffect, which means that the latter situation would not be affected by the prior performance and is only associated with the actions at present. In the resource allocation problem, the efficiency of allocated resources will not change with the subsequent increase of re-sources. Therefore, the Greedy Algorithm can be used to solve the problem.
Suppose that all emergency resources are regarded as a set   which elements are arranged in order. The greedy strategy always preferentially selects opts min to allocate. When it is not available, opts min+1 is selected, and so on.
If opts i1 = s 1 , greedy selection is already included in the optimal solution S (i) . By analogy, opts i1+1 = s1+1, and so on.
If opts i1 ≠ s 1 , cut s i1 and replace it with s1, as the original solution does not contain the higher-value element. A better solution can be obtained, and the solution contains greedy choices.
Therefore, it can be proved that the optimal solution is obtained by choosing the greedy strategy, which proves the correctness of the greedy algorithm.

Model solving
The following symbols are used in this model.

Objective Function
The aim of the present study is to find an optimal strategy to choose the most efficient resource allocation under the same cost. The objective function (1) maximize the emergency resource factor ERF.

Max ERF ERF g dc tc s c dc tc
where s ik = emergency resources k allocation of emergency rescue po in ti, and takes nonnegative integer value; c ik * = demand for emergency resources k in rescue point i; dc i = the position centrality of rescue point i; and tc i = the traffic centrality of rescue point i.

Risk degree of pipe sections
Risk degree assessment considers the possibility and result of accidents. Factors related to accident probability take crossing, corrosion, technical state, and geological conditions of pipeline laying into account. Factors related to accident result take media kind, density of population, and protected areas into account. As shown in Table 2.R j , the risk degree of pipe section j,is equal to the average of all risk factors. Nature reserve -4, flammable and explosive warehouse-3, infrastructure-2, military facilities-1.5

Centrality of the rescue point position
On the distance centrality of emergency resources from the rescue point to any point on the pipeline, let's consider the weighted risk degree for a pipe section. This is the ratio of the corresponding pipe length, to which the rescue point is the closest, to the total pipe length, as shown in Equation 3 below.
where J = the total number of all pipe sections; L j = the length of pipe section j; L j * = the length of pipe section j considering the weighted risk degree; i 1 ,i 2 ,…,i j = the set of pipe sections of the rescue point,i is the nearest rescue point; and p j = the risk degree of an emergency in the pipe section j. We can analyze the crossing and cathodic protection to score the risk degree when there is no risk assessment result of the pipe sections.

Resource necessity
The demand for resources in emergency rescue activities at pipe sections under the jurisdiction of a rescue point. The necessity of the s ik +1 emergency resources is negatively related to the currently allocated reserve of resource k, as shown in Equation 4 below.
where c ik = the original demand of emergency resource k; and att = the attenuation index of resource necessity, which depends on the nature of the oil and gas pipeline and the nature of the resource itself.

ERF of rescue point
The Emergency Resource Factor for emergency rescue point I is the sum of the product of various emergency resource supplies and resource necessities, as shown in Equation 5 below.

ERF in total
The overall Emergency Resource Factor of the system is the sum of the product of ERFs of all emergency rescue points and their positions and traffic centrality, as shown in Equation  6 below.

Total cost constraints
As shown in Equation 7 below, the constraint refers to the maximum total cost available for each type of resources.
where b k = purchase and maintenance cost of emergency resource k; and B = the known total budget cost of the emergency resources.

Storage space constraints
As shown in Equation 8 below, the constraints refer to the maximum storage space for a single rescue point.
where v ik = required storage space for emergency resources k in rescue point i and V i = total storage space for emergency resources in rescue point i.

Basic Data
Based on the specific situation of a long-distance oil pipeline, we can build a basic pipeline model, which is described as follows.
The emergency resources are divided into 15 categories by personnel, emergency equipment, emergency appliances, and spare materials in Table 3, according to the resource requirements in various emergency plans of oil and gas pipelines.  Fire-protection suit 15 Gaz Mask

Risk assessment for a pipe section
The results of modeling for this pipeline are shown in Figure2. The x axis shows that the oil pipeline is divided into 32 pipe sections, and rescue points are respectively provided at the 1/5/17/27 pipe sections. Among them, rescue point 3 is an emergency command center, which directly manages the other three rescue points. The height of bars represents the corresponding length of each pipe section. The heat map below represents the corresponding risk degrees of each pipe section. Under the same conditions, the longer the section and the higher the risk degree at it, the more emergency resources it requires. Fig.2. The basic pipeline model based on the length and risk degree of pipe sections.

Results of allocation
Taking the case when the total cost is equal to 2.5 million as an example, let's calculate the resource allocation of each rescue point.
In the normal allocation, various emergency resources are allocated to each rescue point according to a fixed ratio. Since rescue point 3 is the emergency command center, it was assigned a larger proportion of emergency resources. In the optimized allocation, the characteristics of each pipe section and rescue point are considered. For example, the length of the pipeline under rescue point 1 is short and the risk degree is low. Therefore, with the total investment basically unchanged, the resources of rescue point 1 are reasonably allocated to rescue points 2/3/4 that need more resources.
3(a). Normal allocation: according to a fixed ratio.
3(b). Optimized allocation: consider compound factors. Fig. 3. The normal and optimized resource allocation when total cost = 2.5 million.

Comparison
Taking the case when the total cost = 2.5 million as an example, let's compare the resource satisfaction of the normal and optimizedallocation in Figure 4. It can be seen that the resource requirement of pipe section 17 is relatively large. So, the resources of point 1 are reduced and the resources at section 17 increased accordingly. At the same time, the indicators of the resource shortage and redundancy are extracted in Table 4. The comparison showed that in the optimized allocation, the total cost decreased by 22 thousand, while the ERF increased by 3.43. At the same time, resource shortage and redundancy rates dropped by 2.738 and 1.509, respectively. The resource allocation at all pipe sections is more in line with the actual resource requirements.  Let's change the total cost from 1 million to 3 million, compare the resource satisfaction of optimized normal and optimized allocation in Figure5. Both indicators have declined steadily and significantly. The percentage of shortage decreased by 2.660%, and the percentage of redundancy decreased by 1.051%. Therefore, this model improves the utilization of emergency resources effectively for optimization of allocation of rescue point resources for oil and gas pipelines.

Conclusion
This model provides for the optimization of resource distribution. As long as the total cost of the emergency resources is large, the greedy strategy can not only try as many resource allocation combinations as possible but also reduce the computational complexity. Considering the resource allocation problem as a value-variable multiple knapsack problem,the total cost is equivalent to the knapsack space, and the cost of a single resource is equivalent to the volume of an object in the knapsack. Since the attenuation relationship of the ERF resource with quantity is considered when formulating the greedy strategy, there is no need to worry about the solution result falling into a local optimum.
On the basis of the ideal resource allocation, the actual environment, and the risk for the pipeline sections, the modified the emergency resource allocation is more realistic.
With the digitalization of the full-cycle management of oil and gas pipelines, some constant parameters in the original emergency resource reserve optimization model will be replaced with dynamic real-time parameters.Those processes will make the mathematical solution of resource allocation optimization more practical and contribute to decisionmaking.