Evaluation and optimization of ecological spatial resilience of Yanhe River Basin based on complex network theory

The loess hilly and gully areas have broken terrain, vertical and horizontal ravines and fragile ecological environments. Improving the resilience of the regional ecological space is conducive to improving the quality of the local ecological environment. With the ecological space of the Yanhe River Basin selected as the research object, this paper constructs a research framework of "network identification topology-resilience evaluation-spatial optimization" and uses morphological spatial pattern analysis (MSPA) and the minimum cumulative resistance model (MCR) to identify ecological spatial networks. Based on circuit theory, the ecological pinch point is identified, the ecological spatial network is optimized, and scenario simulation is performed. Through complex network theory and related indicators, the ecological spatial resilience of the basin is evaluated, and the hierarchical optimization strategy of the ecological space is confirmed. According to the ecological function of the source area and the results of the resilience evaluation, the boundaries of the protected control area, guidance development area, remediation area, and maintenance and improvement area of the basin are delineated. The importance of ecological source and corridor protection is classified, and corresponding protection strategies are proposed. The research results can provide theoretical support and practical guidance for the territorial spatial planning and ecological space construction of the Yanhe River Basin and provide a reference for the ecological restoration, resource development and environmental governance of the Yanhe River Basin.

The Yanhe River is a first-class tributary of the Yellow River, flowing into the Yellow River from the northwest to southeast.As a typical loess hilly and gully region, the soil erosion problem in the Yanhe River Basin is particularly prominent.The loess hilly and gully region is broken, and it has horizontal ravines.The fragile ecological environment in the region, coupled with the strong human activity interference, makes it one of the regions with the most serious soil water erosion in China and even in the world 1 .Since the large-scale implementation of the Grain for Green (GFG) program in 1999 2 , regional vegetation coverage has greatly improved 3 .However, the ecological environment has not significantly improved.There are two main reasons.First, large-scale urban construction and environmental governance have caused the fragmentation of the ecological patch area and have ruptured the ecological corridor in the region 4 .Second, Excessive ecological construction in non-key areas consumes limited water resources in the region, resulting in unstable vegetation restoration and deterioration of environmental quality.Restoring local ecological environment is supposed to be a sustainable and continuous process, during which a resilient mindset of continuous adaptation and active response is required.Cumming et al. proposed the concept of spatial resilience 5,6 , and the combination of resilience and spatial optimization can better find ways to optimize the quality of ecological environment.They integrated resilience theory into the framework of landscape ecology and used resilience indicators to quantify spatial attributes such as connectivity and the importance of spatial location.Connectivity conservation is critical for managing healthy ecosystems, preserving biodiversity, and adapting to climate change across all biological communities and spatial scales 7 .The maintenance and improvement of key nodes are also important factors influencing the impact of ecological spatial resilience 8 .Therefore, it is urgent to evaluate and optimize the resilience of the ecological space in the region.Basin is the basic spatial unit of natural landforms and soil and water conservation management on provide good ecological service functions.However, ecological nodes in the eastern part of the basin were less connected with other nodes.The average node degree value of the optimized ecological space network was 5.04, which increased by 0.21 compared with the status quo.Moreover, diversity increased by 4.34%.The highest node degree of the optimized network was 11, accounting for 1.78%.Forty-eight percent of the nodes had a degree less than or equal to 4. In contrast, the highest node degree value increased, and the network was more uniform.The  Collaboration.As shown in Fig. 3, the structural hole of the current basin is mainly located in the ecological space at the edge of the basin, which is usually located on the slope at the edge of a watershed.The structural hole values of the Qianfo Temple Grottoes (10), Majiagou Reservoir (15), Wangyao Reservoir (17), Fangjiahe Reservoir (23), economic forest (25), and ecological forest (13, 19, 22, 27, 32, 36, 40) nodes in the basin were low, which helped to form a more effective "network" connection between ecological source regions in the area.Therefore, attention should be given to the protection and development of these nodes.With 0.56 as the threshold, the proportion of nodes located in the structural hole to the structural hole in the area was 9.76%.After optimization, the structural hole ratio of the ecological space network was reduced to 8.93%, and the collaboration was increased by 0.83%, thus forming a more effective ecological connection.
Interdependence.As shown in Fig. 4, in the future, the ecological space of the basin will form four clusters of nodes around the Wangyao Reservoir (17), ecological forest (22) and the Fangjiahe Reservoir (23), ecological forest (36), and the Angou Reservoir (41).After optimization, the proportion of nodes with lower clustering coefficients was reduced to 23.21%, and the interdependence performance was improved by 6.06%.Optimizing the primary ecological node is one of the important ways to improve interdependence.Stability.As shown in Figs. 5 and 6, the maximum value of the complex network "k-core" in the Yanhe River Basin was 3-core.The ecological stability of the 3-core area was higher.Most of the watersheds were 3-core nodes.Only the Angou Reservoir (41) and ecological forest (38, 39) nodes in the south and east of the basin were 2-core.The 2-core network vulnerable areas accounted for 7.32%.At present, the number of core nodes in the network is 38, and they are ecological forest and economic forest.In the future, the 3-core area will expand.The proportion of regional ecological nodes reached 92.86%.There were only four 2-core nodes in the south and southeast of the basin, with a ratio of 7.14%.Furthermore, the stability improved by 0.18%.There were a total of 49 core nodes in the network.With the further expansion of the core area in the watershed, new core areas appeared in the middle reaches and in the south of the watershed, which enhanced the energy flow between substances and increased the stability of the ecological space.
Connectivity.As shown in Fig. 7, the main ecological corridors of the basin were divided into two lines from west to east.Both corridors departed from the Angou Reservoir (41).The ecological corridors in the middle passed through the ecological forest (22), Fangjiahe Reservoir (23), Wangyao Reservoir (17) and ecological forest (13) and finally reached ecological forest (19).The ecological corridor on the south side started from the Angou Reservoir (41), passed through the ecological forest (32, 40), Wanhua Mountain Scenic Area (31) and ecological forest (36), and finally merged with the central corridor in the ecological forest (19).In the future, the role of the ecological corridor along the river will gradually increase.A new hub corridor will be generated, which will depart from the Wazhuang Reservoir (52), pass through ecological forest (22) and new ecological forest (48) and arrive at the Fangjiahe Reservoir (23).In addition, a mountain landscape corridor connected with the ecological forest (43, 36, 53) will appear.The overall connectivity computed based on the betweenness value

Dynamic resilience evaluation
Redundancy.As shown in Figs. 8 and 9, in the scenario with the greatest disturbance, 17.07% of nodes could be deleted without affecting the connectivity robustness of the network.At this time, the network was relatively complete, and the ecological service function was not significantly affected.When 73.17% of the nodes were deleted, the robustness of network connectivity was 0, and the energy flow of the ecological spatial network was basically lost.In the random scenario of natural evolution, when 43.90% of nodes were deleted, the connectivity robustness of the network was not affected, and the network was relatively complete.When 90.27% of the nodes were deleted, the network connectivity robustness was 0, and the ecological spatial network collapsed.
In the future, under the extreme disturbance scenario, when 14.29% of nodes are deleted, the connectivity robustness of the network is not affected, and the network is relatively complete.When 78.57% of the nodes are deleted, the network connectivity robustness is 0, and the energy flow of the ecological spatial network is basically lost.In the future random scenario of natural evolution, when 10.71% of nodes are deleted, the connectivity robustness of the network is not affected, and the network is relatively complete.When 94.64% of nodes are deleted, the connectivity robustness of the network is 0, and the ecological space network collapses.When the network crashes, the number and proportion of disturbed nodes increase compared with that before optimization.Under disturbance, redundancy increases by 5.40%.Under natural evolution, redundancy increases by 4.37%.This result shows that the resilience of the basin to deal with risks is further strengthened, and the numbers of patches and corridors that maintain basic ecological functions and energy flow when the ecological environment is damaged increase.
Adaptability.As shown in Figs. 10 and 11, in the extreme scenario of disturbance, when 26.83% of nodes were deleted, the restore robustness of the network decreased more rapidly.At this time, many important ecological patches in the basin were destroyed.When 73.17% of the nodes were deleted, the restore robustness of the  www.nature.com/scientificreports/network was 0, and the energy flow of the ecological spatial network was basically lost.In the random scenario of natural evolution, when 53.66% of the nodes were deleted, the restore robustness of the network first decreased gently and then decreased sharply.When 92.68% of the nodes were deleted, the restore robustness of the network was 0, and the ecological spatial network collapsed.
In the future, under the extreme disturbance scenario, when 30.36% of nodes were deleted, the restore robustness of the network decreased more rapidly.When 78.57% of the nodes were deleted, the restore robustness was 0, and the energy flow of the ecological spatial network was basically lost.In the random scenario of natural evolution, when 37.50% of the nodes were deleted, the restore robustness of the network first decreased gently and then decreased sharply.When 94.64% of the nodes were deleted, the restore robustness of the network was 0, and the ecological spatial network collapsed.At this time, the number and proportion of disturbed nodes increased compared with those before optimization.Under disturbance, fitness increased by 5.40%.Under natural evolution, fitness increased by 1.96%.Therefore, it can be concluded that when the ecological environment is destroyed, the time needed to maintain efficient material flow in the watershed is extended, and the efficiency of biological flow operation is significantly improved.

Ecological space network optimization
As shown in Fig. 12, the importance of ecological source region development was classified into three categories.The primary ecological source regions were located in the middle of the basin and the southern mountainous area, and they focus on the improvement of ecological functions and external penetration.Secondary ecological source regions focus on reducing human disturbance and increasing species diversity.General ecological source regions focus on maintaining existing ecological functions.The specific spatial optimization strategy is shown in Table 3.The importance of ecological corridor maintenance was also divided into three levels.There were 15 first-level ecological corridors connecting primary ecological source regions in series, which played an important role in species richness, migration and dispersal 22 .These corridors should be widened, and the service capacity should be improved.Under the premise of ensuring steady growth in scale, high-quality forest  www.nature.com/scientificreports/belts with high economic benefits and strong protection effects can be constructed through measures such as higher grafting and rejuvenation.There were 46 s-level ecological corridors covering secondary ecological source regions, which complemented the ecological spatial network.For second-level ecological corridors, their existing service capabilities should be maintained.With the direction of building ecological and functional ecological corridors, spatial optimization should adhere to the suitable forest and grassland areas, promote the connection and upgrading of corridors, and consolidate and expand the achievements of corridor construction.There were 80 third-level ecological corridors, which completed the entire ecological spatial network.There is an urgent need to restore ecological service capabilities to enhance ecological spatial connectivity.Through the combination of natural restoration and artificial promotion, key projects such as comprehensive shelterbelt system construction, the Grain for Green (GFG) program, and natural forest resource protection have been carried out, and they aim to focus on the construction of ecological forest belts, prevent water soil erosion, and promote species migration and energy flow 23 .

Ecological pattern optimization
The resilience evaluation results of the ecological space in the Yanhe River Basin are shown in Fig. 13.The basin forms the protection control area, the guide development area, the remediation area, and the maintenance and improvement area.For protection control areas, it is necessary to vigorously promote the construction of protected areas, continue closing mountains for afforestation, improve tree diversity and quality, and increase biodiversity.Restrictions on development and construction activities can help reduce water consumption.By building a forestland buffer zone around the water sources, regional water conservation can be achieved.For the guide development area, it is necessary to rely on the Wanhua Mountain Scenic Area and Fodaoping Scenic Area to delineate the scope of protection and development, fully consider the advantages of natural resources, and gradually develop the southwestern mountain forest.For the remediation area, it is necessary to reduce the impact of human activities on the mountain, green the exposed parts of the mountain, and consolidate the achievements of the Grain for Green (GFG) restoration project.For the maintenance and improvement area, it is necessary to improve the resilience of farmland and promote the construction of high-standard farmland.Additionally, a water conservation axis, recreational viewing axis and mountain landscape belt should be created in the basin, and the ecological axis along the Yanhe River should be strengthened to connect more ecological nodes and strengthen the connection between different areas.The water conservation axis connects the Angou Reservoir (41), Wazhuang Reservoir (52), Suntai Reservoir (46), Fangjiahe Reservoir (23), Majiagou Reservoir (15) and Wangyao Reservoir (17) in series.The recreational viewing axis will create a natural landscape belt along the Fodaoping Scenic Area (33) and Wanhua Mountain Scenic Area (31) and penetrate both sides.By adding new nodes 43, 53, 54, and 55, the mountain landscape belt will gradually connect to the ecological node of the mountain on the south side of the basin with the largest primary ecological source region (36).

Discussion
The ecological nodes of the basin are related to each other, and some key nodes play important ecological functions.For example, the core nodes Wangyao Reservoir (17) and Fangjiahe Reservoir ( 23) are in the core area of the river basin, with strong ecological service capabilities.Although node 36 is located at the edge of the basin, it still plays an important ecological function.The newly added nodes of ecological forest (48) and Wazhuang Reservoir (52) are small in size, they play an important role in the energy flow and species migration of the entire system, which needs to be protected and controlled during planning.The complex network method can quantify the complex changes in the ecological space, evaluate the ecological functions of different nodes and carry out differentiated control.Therefore, this study conducted scenario simulation and topology simulation on the ecological space of the basin, evaluated ecological nodes and corridors based on 7-type indicators, and proposed an optimization strategy for classification.Spatial resilience research based on landscape ecology focuses on the spatial attributes and spatial connections of a system 27 .Different from the traditional method based on spatial attribute overlay to study landscape patterns, in this paper, we can identify the nodes that have an important impact on the resilience of ecological space from www.nature.com/scientificreports/ the perspectives of structure and ecological processes.As far as ecological network structural optimization is concerned, nodes are the crux of network connectivity so that their quantity and quality must be guaranteed 28 .
Besides, This study verified the rationality of the indicators.On the basis of enriching the spatial resilience evaluation indicators, this study further divided the indicators from the perspectives of static resilience and dynamic resilience.The key nodes and corridors in the ecological space were found through mathematical models such as node degree, structural hole, and betweenness.For different types of nodes and corridors, differentiated management and control can be carried out separately.Through connectivity robustness and restoration robustness, the changes in the spatial resilience of ecological space under different scenarios were evaluated.It should be noted that the scenario simulation was only for changes at a certain moment in the future.It is necessary to have a long-term under-standing and simulation of the entire revision development process.The ecological space in the Yanhe River Basin presented the characteristics of water tendency and regional concentration overall.Therefore, spatial optimization must consider some aspects.Water systems, reservoirs and surrounding areas will play greater ecological roles.The surrounding human activities should be reduced, and protected forests should be built.In addition, the construction of landscape belts along both sides of the river should be strengthened 29 .For the middle reaches of the basin, ecological restoration should be strengthened.In contrast, the remediation area identified in this study should prioritize the Grain for Green (GFG) area and vegetation cover on bare land surfaces 2 .For the upstream and estuary areas of the watershed, the existing Grain for Green (GFG) program achievements should be consolidated, and the types and structures of trees should be adjusted to improve species richness 30 .
Based on complex network theory, this paper conducted research on the resilience evaluation and optimization of ecological space in the basin and conducted scenario simulation and testing on the evolution of ecological space in the future.First, the ecological space within the basin was considered as a whole.Through network means, the evolution of the ecological space of the basin was simulated, and the research paradigm of the ecological space was enriched.Second, this study proposed 5 types of static resilience evaluation indicators from the perspective of ecological background and 2 types of dynamic resilience evaluation indicators from the perspective of ecological disturbance, which enriched the evaluation indicators of basin ecological spatial resilience.Finally, an empirical study was carried out taking the basin of the Grain for Green (GFG) program as an example, and the results provide guidance for ecological restoration and ecological pattern optimization in the basin.This method can be used to identify important ecological nodes in the basin, simulate and identify the ecological patches for priority development and protection in the future, and propose protection strategies according to local conditions.With the Yanhe River Basin as an example, it now has 41 ecological source regions and 82 ecological corridors.Based on circuit theory, 15 ecological pinches were identified, and 59 ecological corridors were added.Through ecological pattern optimization based on resilience evaluation, the scopes of the protection control area, the guide development area, the remediation area, and the maintenance and improvement area were delineated, and corresponding control requirements were proposed.Three types of development axes occurred within the water conservation axis, recreational viewing axis and mountain landscape belt.For ecological spatial networks, ecological source regions were divided into primary ecological source regions, secondary ecological source regions, and general ecological source regions.Furthermore, corresponding optimization strategies were proposed.It must be acknowledged that this study has limitations.In the selection of resistance factors, this study failed to fully consider the different impacts of rivers on the migration of terrestrial and aquatic organisms.In addition, there was a lack of consideration of ecological break points created when roads intersect corridors.Moreover, the widening and optimization range of the ecological corridor needs further research.
In this paper, the existing research methods of ecological spatial resilience are expanded.In terms of ecological spatial network optimization, through circuit theory, ecological pinch points can be identified and the ecological spatial network can be optimized.In terms of resilience evaluation, the resilience of the future ecological spatial network is evaluated by using the indicators of complex networks, and the optimization degree of ecological spatial network resilience is obtained by comparing with the current situation.In the future research, further in-depth research can be carried out on source identification and corridor optimization.The method of combining MSPA and index evaluation can be used to make source identification closer to the actual situation.The definition of corridor width and corridor optimization scope can be taken as further research directions for ecological corridor optimization.

Materials and methods
With the ecological space of the Yanhe River Basin as the research object, the research framework of "network identification-resilience evaluation-spatial optimization" was constructed.MSPA was used to identify the ecological source region, and an ecological spatial network based on the resistance surface and minimum cumulative resistance model (MCR) was constructed.The network was verified by data such as remote sensing and surface characteristics.The static and dynamic resilience of the ecological space was quantitatively evaluated through the complex network structure.Circuit theory was used to identify ecological pinch points, and the structural changes in the complex network were used to simulate the future spatial and temporal changes in ecological space.Finally, the content of spatial optimization was determined.

Research area
The Yanhe River Basin has a total area of 7725 square kilometres and an altitude of 1600 m-1823 m, where the Yanhe River runs from northwest to southeast.The region has a continental warm temperate monsoon climate, and the terrain is high in the northwest and low in the southeast, as shown in Fig. 14

Data sources
The data sources for this study were as follows.The Land-sat8 OLI satellite remote sensing digital product with a 30 m resolution from May 1st to June 31st, 2020, was derived from the geospatial data cloud(https:// www.gsclo ud.cn/).The 30 m resolution digital elevation model data were derived from the geospatial data cloud(https:// www.gsclo ud.cn/).Artificial landscape and scenic reservoir data for the Yanhe River Basin were derived from field studies.

Data processing
Land use characteristics: ENVI5.1 software was used for radiometric calibration, atmospheric correction, clipping and supervised classification of remote sensing images.According to the Classification Guidelines for Land and Sea Use in Territorial Spatial Planning and the actual situation of the Yanhe River Basin, land use was divided into forestland, grassland, water area, cultivated land and other land.Among them, ecological space refers to land use types including forestland, grassland, and water area.Normalized difference vegetation index: ENVI5.1 software was used for radiometric calibration, atmospheric correction and clipping of the remote sensing images(https:// envi.geosc ene.cn/).However, the normalized difference vegetation index was calculated.Through data error correction, the value range of NDVI is [-1,1], as shown in the formula 31 .

Ecological source identification
The land use data were reclassified and then imported into Guidos Toolbox software(https:// forest.jrc.ec.europa.eu/ en/ activ ities/ lpa/ gtb/) for landscape pattern analysis, in which core areas, bridge areas, edge areas, pores, island patches, branch lines, and round island areas were identified 32 .As an important habitat patch, the larger the core area is, the higher the ecological quality.For the top 50 ecological patches in the core area, Conefor2.6(http:// conef or.org/) was used to calculate the patch importance index (dPC), as shown in the formula 33 .
where n is the number of core areas.a i and a j are the areas of the habitat patches i and j. p ij is the maximum product probability of all possible paths between patches i and j (including single-step paths).A L is the total value of the landscape in the study area.PC represents the possible continuous interpretation index of a certain landscape, and the value ranges from 0 to 1.The larger the PC value is, the higher the connectivity of the landscape plate.dPC represents the importance of the patch, and PC remove represents the possible connectivity index after deleting a certain patch 34 .
(1) Based on the study scale and the actual distance between the patches in the study area, the distance threshold was set to 2500, and the connectivity probability was set to 0.5.Core patches with dPC > 1 were selected as ecological source regions.

Extraction of ecological corridor
In this study, the minimum cumulative resistance model (MCR), which quantifies ecological processes in terms of expended cost distance, was used to extract the ecological corridor.During the construction of the resistance surface system, this study selected land use types, distances from water bodies, elevations, slopes, and NDVIs as the index factor systems for resistance surface evaluation (Table 4) 35 .For resistance factor, a corresponding single-factor resistance surface was constructed.Through the Analytical Hierarchy Process (AHP) method, the weight of each factor was determined 36 .The single-factor resistance surface was then overlaid by the mosaic to a new raster tool to obtain the composite resistance surface of the Yanhe River Basin.
All potential ecological corridors in the area were determined by the cost distance and cost back link between each source and the remaining target sources calculated based on the composite resistance surface, as shown in the formula 37 .
where MCR is the minimum cumulative resistance model.f is a function reflecting the proportional relationship between MCR and variables D ij and R i .D ij indicates the spatial distance between ecological source regions i and j.R i indicates the resistance value of patch i during species migration.

Scenario simulation
Scenario simulation refers to the description of complex and uncertain future possible situations through the simulation of future risk analysis and risk response measures 38 .According to the characteristics and trends of ecological space changes in the Yanhe River Basin in the past 50 years, as well as the specific requirements for territorial spatial planning, the Grain for Green (GFG) project, and ecological restoration projects, the future ecological spatial pattern will rely on natural development, ecological priority, and economic priority to form new connections (Table 5) 39 .The scenario of natural development refers to the expansion of ecological space caused by ecological processes such as wetland expansion and bare land greening.The ecological priority scenario refers to the possible situation of ecological construction, such as GFG and ecological restoration work.The economic priority scenario refers to the park construction and environmental governance situation developed for economic construction.
The new nodes in the process were determined by the location and size of the ecological pinch points.Based on circuit theory and sports ecology, this study used the Pinchpoint module in the Linkage-mapper tool to identify pinch regions.The position and size of the ecological pinch points were determined by the ecological patch with a certain area and the importance of the patch.Among them, electric charges represent species, conductive

Network resilience evaluation
Static resilience evaluation Diversity.Diversity is an indication of the hierarchical nature of a node and the ability to maintain a high level of functionality after some nodes are disconnected.The node degree reflects the influence and importance of the node in the topological network.The larger the degree is, the more important it is in the region, and the stronger the diversity 20 .Node degree Ek i is the number of edges connected to node i in the network, e ij represents the edges of the connected node i with node j, and F is the set of all the edges in the network 41 , as shown in the formula: Collaboration.Collaboration represents the ability of ecological nodes to coordinate and communicate with different subjects.A structural hole can be understood as a gap between two unconnected nodes that is filled when the two are connected through a third node.Node structural holes reflect the relative competitive advantage of the nodes in the region.Node structural hole EC i is the degree of dependence of node e i on other nodes in the network, which is also called the network constraint coefficient 10 .The smaller the constraint coefficient of node I is, the easier the node becomes a node occupying a structural hole, the more diverse the selection of connections, and the stronger the collaboration between nodes 41 , as shown in the following formulas: where node q is the common adjacent point of node i and node j.P ij represents the weight ratio of node j in all adjacent points of node i.
Interdependence.Interdependence refers to the ability of a node, as part of an interconnected and integrated network, to establish functional and physical relationships with other nodes and to gain support therefrom.
Clustering coefficients are used to describe the "tightness" of nodes in the network.The higher the clustering coefficients are, the higher the degree of clustering around the nodes and the stronger the interdependence 20,41 , as shown in the following formulas: where E i is the number of edges that actually exist between the adjacent first-level nodes of node i.The clustering coefficient is the first layer clustering coefficient, that is, the absolute degree of the first layer neighbour clustering around node i, ECc i is the node clustering coefficient, and ECC i is the overall network clustering coefficient.
Stability.Stability represents the ability of ecological spatial networks to stabilize and operate continuously.If all points in one of the subgraphs in the network are adjacent to at least k other points in the subgraph, such a subgraph is called a "k-core".The higher the ratio of the k value to the k-core is, the more components that are locally stable in the network, and the higher the resilience of the network as a whole 10 .
Connectivity.Connectivity is the ability of nodes in ecological spatial networks to connect through each other.
In a complex network, this property is reflected by node betweenness and edge betweenness.Node betweenness and edge betweenness are measurement indicators that characterize the global structural properties of ecological nodes and edges in the topological network, which can reflect the service strength and importance of nodes and edges in the entire network.The larger the value of betweenness is, the more important the corresponding nodes and edges are in the entire network, and the stronger the connectivity.At this point, the node acts as a hub in the region 41 , as shown in the following formula: (5) where Eb ij is the ratio of the number of shortest paths passing through edge e ij in all shortest paths between nodes to the total number of shortest paths between all nodes.n st is the number of shortest paths connecting nodes e s and e t .n st (e ij ) is the number of shortest paths connecting nodes e s and e t and passing through edge e ij .

Dynamic resilience evaluation
The stability of ecological space is closely related to natural disasters and human activities.In natural disasters, ecological space is randomly destroyed.When affected by human activities, ecological space is subject to deliberate destruction.The damage to the ecological space caused by the two cannot be quickly recovered in a short period of time.In the ecological spatial network, after the corresponding node is deleted, it cannot be recovered.The dynamic resilience of ecological spatial networks was evaluated by simulating extreme scenarios of deliberate disturbance and random scenarios of natural evolution 42 .Extreme scenarios include felling trees in important patches and constructing recreational areas and public works and building highways in the central patch.The ecological nodes were arranged from high to low according to the node degree and point betweenness, and the structural holes were arranged in order from low to high, which were then removed in turn.Random scenarios included fires, floods, earthquakes and animal disease spreads with random spatial patterns 43 .According to the random data generator, ecological nodes were sorted and removed sequentially.
Redundancy.Redundancy indicates the degree of redundancy of the eco-spatial network.When interference occurs, redundant nodes can undertake some functions to ensure the operation of the network.Connection robustness was used to measure when the ecological space network lost some ecological patches, ecological nodes or ecological corridors, the network maintained structural integrity and the ability of the remaining elements to transfer matter and energy to each other.We measured redundancy by the percentage of the number of nodes removed at the complete loss of network function, as shown in the following formula 44 : where R is the connection robustness of the ecological space network.C MAX is the number of nodes in the largest connected subgraph after the network is disturbed and some nodes are lost.n is the number of nodes before the network is disturbed.n' is the number of nodes lost after the network is disturbed.
Adaptability.Adaptability represents the ability of the network to adapt and return to a certain operating state after interference.Restore robustness is used to describe the ability to maintain the efficient operation of biological flow after the ecological spatial network is disturbed, which is usually measured by the global efficiency of the topology network.The higher the global efficiency is, the higher the efficiency of the ecological spatial network to ensure the operation of the biological flow after being distrurbed.We measured adaptability by the percentage of the number of nodes removed when the biological flow completely lost its ability to run efficiently, as shown in the following formula 45 : where E is the restore robustness.n is the number of all nodes in the network.G is the set of network nodes.Node i and node j are any two points in network G. d ij is the shortest path length from node i to node j.The correspondence of spatial resilience to network resilience is shown [46][47][48][49][50] in Fig. 15.

Figure 1 .
Figure 1.Ecological space and network topology.

Figure 3 .
Figure 3. Structural holes and changes in the complex network.

Figure 4 .
Figure 4. Clustering coefficients and changes in the complex network.

Figure 5 .
Figure 5. k-core and changes in the complex network.

Figure 6 .
Figure 6.Core-periphery and changes in the complex network.

Figure 7 .
Figure 7. Nodes/edge betweenness and changes in the complex network.

Figure 8 .
Figure 8.Current ecological spatial network connectivity robustness changes.

Figure 9 .
Figure 9. Current ecological spatial network restore robustness changes.

Figure 10 .
Figure 10.Network connectivity robustness changes in scenario simulation.

Figure 11 .
Figure 11.Network restore robustness changes in scenario simulation.

Figure 12 .
Figure 12.Classification results of the ecological spatial network in the Yanhe River Basin.

Figure 13 .
Figure 13.An optimized ecological pattern of the Yanhe River Basin.

Figure 14 .
Figure 14.Study area location and elevation.

Figure 15 .
Figure15.The relationship between spatial resilience and complex network resilience.

Table 1 .
Node list of the original ecological source areas in the Yanhe River Basin.

Table 2 .
Node list of new ecological source areas in the Yanhe River Basin.

Table 4 .
Ecological resistance factor assignment table.

Table 5 .
40ological space scenario simulation table.surfacesrepresentresistancesurfaces, circuit nodes represent habitats, and pinches represent regions with high probability or irreplaceable passage of species during migration40.To better show the position of the pinch point, 1 km was set to the corridor width.Finally, the node and edge information from future simulation results of the watershed ecological space were imported into Pajek (http:// mrvar.fdv.uni-lj.si/ pajek/) for computational analysis.The final result was painted in Arcgis 10.5 (https:// www.esri.com/) and Adobe Photoshop 2021 (https:// www.adobe.com/ cn/).