Construction and optimization of ecological spatial network in typical mining cities of the Yellow River Basin: the case study of Shenmu City, Shaanxi

Background In resource-based cities, long-term irrational exploitation of resources has caused severe damage to ecosystem functions, mainly manifested in the significant decline of biodiversity, land degradation, water pollution, and the deterioration of air quality. This has led to a significant decline in the cities’ sustainable development capabilities. Establishing and optimizing an ecological spatial network (ESN) can promote the effective transmission of material energy and enhance the ecosystem functions, which holds fundamental importance in ensuring the ecological integrity of the region and promoting sustainable urban development. In this study, by combining the ecological environment with the landscape to determine the ecological sources, we constructed the ESN of Shenmu City, a mining city, based on the minimum cumulative resistance (MCR) model


Introduction
With the rapid development of global industrialization, the excessive exploitation of fossil fuels has become an important means to support economic growth.However, this development model has brought tremendous pressure on the ecosystem, resulting in the disruption of ecosystem functions (EFs) and many ecological challenges, such as a sharp decline in biodiversity, soil erosion, and water source pollution (Boldy et al. 2021;Chen et al. 2019;Zhu et al. 2016).These challenges have caused irreparable losses to the ecosystem (Eldridge et al. 2022), and at the same time, have had a huge negative impact on human security and green development (Liu and Liu 2010).Although the ecosystem has a certain self-regulatory ability, in the face of such a double impact of intense human activities and natural factors, this self-recovery ability has being severely weakened (Jones 2017).
EFs, as an important basis for maintaining the ecological balance of the earth and supporting the sustainable development of human society (Li et al. 2021a, b), cover complex ecological processes such as material circulation, energy flow, and information transmission.These functions not only reflect the natural attributes of the ecosystem itself, but are also directly related to the ecosystem services (ESs), that is, some functions that can directly or indirectly provide services to human beings (Liu et al. 2023).However, many factors in the current urban development process have had a serious impact on EFs and ESs.Factors such as the intensified urban expansion (Cetin et al. 2019), the increased land demand (Feist et al. 2017), and the excessive population growth have led to the reduction of cultivated land and the coverage rate of surface vegetation (Zhang et al. 2018), which in turn has caused the natural ecosystem to be damaged to varying degrees and the ESs to deteriorate gradually.Resource-based cities refer to cities that rise and develop due to the exploitation and processing of natural resources.These problems are extremely prominent in the development process of resource-based cities.The exploitation of natural resources (minerals, forests, petroleum, etc.) has caused many problems (Wu et al. 2020;Yu et al. 2019;Yuan et al. 2022).In order to deal with these ecological problems, under the guidance of the concept of "lucid waters and lush mountains are invaluable assets", restoring the ecosystem and ensuring ecological security have become important contents for the sustainable development of cities (Zhang et al. 2014).
In order to alleviate the decline of the ecosystem, it is particularly important to construct an ecological spatial network (ESN) that matches the ecosystem structure and EFs.The ESN is an important method for the identification and optimization of the ecological security pattern, and the connectivity of its network is crucial for maintaining the robustness of biodiversity and EFs (Klar et al. 2012).However, current studies often ignore the connectivity issue between ecosystems (Fischer and Lindenmayer 2007;Liquete et al. 2015).The ESN is composed of ecological source areas, ecological corridors, and ecological nodes (Yu 1996), and its integrity and quality determine the normal functioning of ESs.Through ecological corridors, separate habitat patches can be connected to reduce the threat of habitat fragmentation to the survival of organisms and improve the level of biodiversity conservation (Bennett and Mulongoy 2006).
The "identification of ecological source areas-construction of resistance surface-extraction of corridors and ecological nodes" has become the recognized paradigm for the construction of ESN (Ke et al. 2017;Pan et al. 2023;Peng et al. 2017).Currently, the identification of ecological source areas often selects nature reserves and forest land use types as ecological source areas.However, for mining cities that have experienced severe ecological damage, it is difficult to reflect the locations of real ecological source areas.The Minimum Cumulative Resistance (MCR) model is the main method for the construction and optimization of ESN (Beier et al. 2008).In the early stages, the resistance surface only considered different land use types.At present, more and more studies incorporate human activities such as population density and transportation infrastructure into the resistance (Ye et al. 2015).With the rapid development of resourcebased cities, human activities have greatly changed the layout of ecological spaces.Therefore, the resistance values of population activities and economic development must be considered (Correa Ayram et al. 2016).Methods for extracting potential ecological corridors include the MCR model, the Circuit Model (Wu et al. 2023a, b), the Scenario Analysis Method (Wu et al. 2023a, b), and the Patch Gravity Model (Moosavi Fatemi et al. 2023).Due to different construction methods of the resistance surface, there are significant differences in the results of ecological corridors.In summary, the effective identification of ecological source areas, the scientific construction of resistance surfaces, and the assessment of the importance of corridors have important practical significance for the construction of regional ESNs and the assessment of ecological security patterns (Li et al. 2013).
This study aims at the special background of Shenmu City, a coal resource-based city and a typical ecologically fragile area in the middle and lower reaches of the Yellow River.Through research on complex network theory (Zuo et al. 2018), landscape morphology, and the importance of EFs to clarify the spatial pattern of EFs in Shenmu City; on this basis, to construct an ESN and propose a practical and feasible optimization plan according to the correlation between the network topological structure and the EFs.Therefore, the main objectives of this research are to: (1) reveal the spatial distribution pattern of ESs such as biodiversity, water source conservation, and soil and water conservation in Shenmu City; and (2) analyze the interaction mechanism and influence law between the network topological structure of the ESN and the EFs, and provide a scientific basis for the optimization of the ecological space network.

Study area
Shenmu City is located in the northern part of Yulin City, Shaanxi Province, China, situated between 38° 13′-39° 27′ N latitude and 109° 40′-110° 54′ E longitude.It borders Shanxi Province and the Inner Mongolia Autonomous Region, lying in the transitional zone between the middle reaches of the Yellow River, the hinterlands of the Mu Us Desert, the Loess Plateau, and the Inner Mongolia Plateau.Shenmu City is the largest county (city) in Shaanxi Province by area.It features a temperate semiarid continental climate with cold winters, hot summers, and dry springs and winters.The average annual temperature is approximately 9.2 °C, and the average annual precipitation is approximately 441.9 mm, predominantly occurring in July, August, and September.The terrain of Shenmu City is high in the northwest and low in the southeast, and the landform types are complex and diverse.Its northwest is the sandy, grassy and beach area, and the southeast is the loess hilly and gully area, which account for 49% and 51% of the total area respectively.
Shenmu City, once acclaimed as the 'Coal Capital of the World' , has proven coal reserves exceeding 56 billion tons (Fig. 1).Bolstered by the coal economy, it swiftly emerged as the 'Number One County in the Western Top 100' , yet the ecological damage caused by mineral extraction has also buried a huge hidden danger for the sustainable development of Shenmu.The transformational development of Shenmu City requires proactive planning.Relying on the coal economy while adhering to an ecological priority and green development strategy has become an indispensable path for Shenmu City.

Data sources
The primary data sources utilized in this research: (1) The China Land Use/Cover Change (CNLUCC) data were downloaded from the Resource and Environmental Sciences and Data Center (https:// www.resdc.cn).The data have a spatial resolution of 30 m and employ a threetier classification system.The first level consists of six categories, primarily based on land resources and their utilization attributes: cultivated land, forest land, grassland, water bodies, constructed land, and unused land; (2) The digital elevation model (DEM) was sourced from the Shuttle Radar Topography Mission (SRTM) dataset (https:// lpdaac.usgs.gov/), with a spatial resolution of 30 m. Slope data were derived using the slope tool in ArcGIS 10.2 (https:// deskt op.arcgis.com/); (3) The normalized difference vegetation index (NDVI), wetness (WET), normalized difference bare soil index (NDBSI), and land surface temperature (LST) were all acquired via the Google Earth Engine (GEE) platform; (4) Precipitation and temperature data were from the A Big Earth Data Platform for Three Poles (http:// poles.tpdc.ac.cn), with resolutions of 1 km, respectively; (5) The soil dataset was sourced from the World Soil Database (HWSD); (6) Net Primary Productivity (NPP) was derived from the MOD17A3HGF dataset; (7) Population data were acquired from the WorldPop database (https:// hub.world pop.org/), with a spatial resolution of 100 m; and (8) Water and road network data were from the 2020 version of OpenStreetMap (OSM) (https:// www.opens treet map.org/).Water and road network density data were generated using the Kernel Density Analysis module in ArcGIS 10.2.
The administrative boundaries were sourced from the China Fundamental Geographic Information System.All the data above were standardized to a resolution of 30 m × 30 m and uniformly projected.The data were then cropped using the vector boundaries of the study area.

Methods
The research framework of this paper mainly encompasses three aspects (Fig. 2): Firstly, employing the morphological spatial pattern analysis (MSPA) to identify core areas, using remote sensing based ecological index (RSEI) and patch importance index (dPC) to determine ecological sources, and integrating eight resistance factors, including DEM, NDVI, modified normalized difference water index (MNDWI), water network density, road network density, population density, and nighttime light data.The MCR model is used to extract potential ecological corridors, thereby constructing the ESN of the study area, and examining the topological structure characteristics of the ESN.Secondly, the importance of EFs is evaluated by comprehensively considering water source conservation, soil and water conservation, and biodiversity.Thirdly, based on the correlation analysis results between the topological structure and the importance of EFs, optimization strategies are determined.The robustness comparison before and after optimization is used to verify the accuracy of the optimization strategy.

Ecological spatial network construction
MSPA can be used to identify various landscape structures within a landscape, such as core areas, bridges, gaps, edges, islets, and branches.In ecology, core areas typically represent important landscape structures such as large natural patches, wildlife habitats, and forest reserves and are the primary type of ecological source area.We used Guidos toolbox software (https:// forest.jrc.ec.europa.eu/ en/ activ ities/ lpa/ gtb/) to import the land use data in tiff format, used grasslands, woodlands, lakes and wetlands among the land types as the foreground data for the MSPA model, and executed the MSPA module under the Morphological module to obtain the distribution of the initial ecological source areas.
In this study, we used the RSEI and MSPA results as a basis; the core area with RSEI > 0.4 (Sun et al. 2024) was taken as the ecological source area.Then, patches with an area of less than 0.1 km 2 were excluded from the ecological source area considering the fragmentation of the resulting patches.Finally, with the goal of ensuring the coherent integrity of the ecological source area patches, the connectivity of the ecological sources was analyzed in-depth by applying the dPC.
The ecological flow from the ecological source to the outside is affected by a number of aspects of resistance, which are limited both by natural factors and by the daily activities of human beings.The MCR model was originally produced and applied by Knaappen et al. (1992), and was later used for species conservation and widely applied in fields such as landscape pattern analysis.The MCR model is composed of three factors: "resistance", "source", and "cumulative cost", which are analyzed to portray the cost consumed by the ecological source to overcome the resistance.The MCR model is generally expressed as (Hou et al. 2022): where Rmc is the MCR, f min is the positive correlation function between the MCR and the ecological process, Dij is the spatial distance from ecological source point i to landscape patch j , and Ri is the resistance coefficient of the landscape unit i in the region to the motion process.
Through a comprehensive analysis of the natural environment and human activity characteristics of Shenmu City, a total of seven factors, including elevation, slope, vegetation cover, MNDVI, water network density, road network density, and population density, were introduced to study and calculate the resistance surface.Considering that each factor has an indispensable role in the development of the present condition of the ecological environment security pattern, each factor is assigned the same influence weight.The natural breakpoint method conducts classification based on the distribution characteristics and change patterns of the data, avoiding the influence of subjective judgment.In the MCR model, it can identify and classify the resistance levels more accurately.The assignment is shown in Table 1.

Ecological environment quality evaluation
Ecological environment quality refers to the suitability of the current state of the ecological environment in the region for the survival and development of human beings and other organisms.Analysis of the ecological environment quality helps to identify potential ecological source areas, enabling a more targeted extraction of these sources.The RSEI consolidates four indicators: wetness (WET), greenness (NDVI), hotness (LST), and dryness (NDBSI), making the use of remote sensing an effective means for assessing the ecological environment quality of a region (Hu and Xu 2018).
In the RSEI framework, WET effectively reflects the moisture conditions of surface features, water bodies, and soils; NDVI is used to monitor vegetation health, coverage, and other growth indicators; NDBSI, based on the IBI and SI, adequately represents the state of constructed lands and bare grounds; LST, derived from sensor temperature calculations, indicates surface thermal radiation intensity, which is then converted to surface temperature, serving as a crucial indicator of ecological processes and climate change (Xu et al. 2018).The RSEI is generally expressed as: where RSEI 0 is the initial value of the remote sensing ecological index, RSEI 0 max , RSEI 0 min are the minimum and maximum values of in the target year, and RSEI is the final remote sensing ecological environment quality indicators.

Ecosystem services importance evaluation
Assessing the importance of ESs helps us identify areas with critical EFs and guide ecological restoration and functional zoning.According to the 'Shaanxi Province Main Functional Area Planning' and the 'Decision on Building an Ecological Civilization Demonstration Area in the Loess Plateau of Yulin City' and other related plans, it is pointed out that the study area should be (2) (3) RSEI = (RSEI 0 − RSEI)/(RSEI 0 max − RSEI 0 min ) evaluated for its importance from three perspectives: water source conservation (WR), soil and water conservation (Ac), and biodiversity maintenance (Sbio).WR refers to the function by which natural environments such as forests and wetlands, through their unique structures and functions, can intercept, store and slowly release precipitation.Ac refers to the function of preventing soil erosion, protecting soil resources, and maintaining land productivity through measures such as vegetation coverage, terrain modification, and other management measures.Sbio refers to the activity of protecting the species, genetic diversity, and ecosystem diversity of living things on Earth to ensure the continuation and reproduction of various life forms in nature.Among them, WR and Sbio were calculated using the NPP quantitative indicator assessment method specified in the 'Guidelines on Delimiting of Ecological Protection Red Line' (Zou et al. 2015), that is, the calculation model was constructed based on the net primary productivity of vegetation over many years.Ac is primarily calculated using a modified version of the Universal Soil Loss Equation (USLE) (Okou et al. 2016).

Landscape connectivity assessment
Ecological sources with poor connectivity are often relatively isolated, which may impede the normal migration and dispersal of species (Koen et al. 2014).Probability of Connectivity (PC) is a metric used to quantify landscape connectivity, widely used in landscape ecology (Saura and Pascual-Hortal 2007).This paper utilizes the Patch Importance Index (dPC) to quantitatively evaluate the connectivity of ecological sources.The calculation formula for dPC is as follows (Saura and Torné 2009) where n is the total number of patches in the landscape; a i and a j are the areas of patch i and patch j respec- tively.A is the total area of the landscape; P * ij is the highest probability of direct dispersal of species in patches i and j .PC remo is the comprehensive index of remaining patches after removal of individual patches i .dPC refers (4) to the use of the change in PC after a patch to measure the importance of the patch in maintaining landscape connectivity.The calculation process was implemented using the Conefor Sensinode software (http:// conef or.org/ conef orsen sinode.html).

Topological indicators of the ecological spatial network
The topological structure of complex networks is an important means to understand the properties and functions of complex systems.As a typical form of complex network, the ESN represents an organized arrangement of dispersed landscape patches in a network format.This organization aims to maximize the maintenance of material energy flow and other ecological processes.Therefore, the characteristics of the network's topological structure can be utilized to describe the EFs of nonspecific location nodes within the ecological network (Albert and Barabási 2002;Baranyi et al. 2011).Topological indicators are calculated with the help of Gephi software (https:// gephi.org).
Degree The degree of a node (Degree) is the number of ecological corridors connected to that node.A higher degree of a node means more edges connected to it, allowing the flow of energy and information through this node within the ecosystem.
Clustering coefficient In an ecosystem, the higher the degree of connectivity between a node and its adjacent nodes indicates the likelihood of their interconnectivity.A higher value suggests a higher probability of the node being closely connected with its neighbors, forming a tight-knit cluster.

Closeness centrality
The sum of the distances between a particular ecological node and other nodes in the network indicates the extent of connectivity among them.A higher node Closeness centrality has a greater likelihood of transmitting matter and energy through the network.
Betweenness centrality A higher betweenness centrality value signifies that the node is important in the propagation of ecological information within the network, and a greater proportion of ecological flow passes through this node.
Eigenvector centrality If an ecological node is more closely related to another node and potentially occupies a central position within the ecological network, this implies that the node has a higher eigenvector centrality.This indicates the functional importance of the node within the network.
Betweenness centrality, Closeness centrality, and Eigenvector centrality each serve as distinct measures to quantify the relative significance of nodes and are important bases for ESN optimization.Betweenness centrality is a key mediator connecting ecological sources; Closeness centrality indicates the node's accessibility and influence in the ESN.The more the node deviates from the network, the more the importance of the ecological node decreases.Eigenvector centrality is an important node in identifying the influence of ESN.
The correlation analysis between ESs and topological indicators of ESN was conducted to explore the interaction mechanism between ES and ESN topology of forest, watershed and grassland ecological sources, and then appropriate optimization strategies were adopted for different types of ecological nodes, so as to achieve the optimization of the ecological spatial network in Shenmu City.

Robustness analysis
The robustness of an ecological network refers to its ability to maintain core functionality and structural stability in the face of external perturbations.The stability of ESN is often measured using robustness models.The most commonly used indicators are connectivity robustness (CR) and recovery robustness (RR).The stability of complex networks is analyzed through the changing characteristics of CR and RR.
(1) Connection robustness (CR) In the natural environment, the ecological source is artificially destroyed, such as the change of land use type caused by construction and the disappearance of biological habitat, or the habitat is completely destroyed and destroyed by natural disasters such as fire, and these situations are manifested in the disappearance of edges or nodes in the ESN.
CR is the ability of other elements in the network to continue to deliver matter and energy to each other when the network is attacked and loses some ecological nodes or sources.The CR can reflect the connectivity performance of its elements after being damaged.The formula is as follows: where R represents the CR, S is the number of ecologi- cal nodes in the maximum connection subgraph after the node disappears, n is the number of nodes in the origi- nal ecological network, and n 1 is the number of nodes left after the ecological node disappears.
The ecosystem has a certain ability to self-repair within a certain disturbance range, such as minor deforestation, mild drought and freezing disaster.The performance of ESN is mainly the restoration of ecological nodes or ecological corridors.
There are two kinds of RR, edge RR and point RR, and the formulas are as follows: where D and E are point RR and edge RR respectively; n d is the total number of nodes recovered by the policy.L is the total number of edges in the initial network; L m the number of lost edges; L d is the number of edges recov- ered by the policy.

Ecological environment quality assessment
The quality of the ecological environment in Shenmu City gradually improves from the northwest to the southeast, exhibiting a pattern where the ecological conditions are better in the southeast and poorer in the northwest.Spatially (Fig. 3), the RSEI is generally at a low level of 0.2-0.6, and patches with poor ecological environment (7) quality are concentrated in the northwest.This area has poor humidity conditions and lacks water, and there are many construction and industrial and mining lands.These factors lead to the further deterioration of the ecological environment.The RSEI in the northern and central regions is greater than 0.6, and human activities are strong in this region.However, the humidity and vegetation conditions are better, the water content is higher, the vegetation grows vigorously, and the environment is relatively moderate.The eastern and southern regions are close to water sources, the terrain is flat, the residential density is low, and the ecological environment is excellent.

Ecological source extraction
The core patch (Core) in Shenmu City has the largest area of 474.26 km 2 , accounting for 87.49% of the total area of all the landscape types in Shenmu.Core patches are located in the eastern and northwestern portions of Shenmu City, providing habitats for species with high connectivity.The low distribution of cores in the central region indicates poor connectivity and unfavorable circulation of materials and energy.Core patches are large ecological patches with important status and functions, serving as an essential source of energy flow between ESNs.In this study, core patches larger than 0.1 km 2 were selected, resulting in 117 ecological source sites (Fig. 4).Only a few patches within Shenmu City play an important role for connectivity, and their land cover types are mainly woodland, grassland, and water bodies.The dPC value was calculated for core areas in the MSPA, and based on the results of ecological quality and dPC analysis, patches with dPC values less than 0.1 and RSEI values less than 0.4 were removed, resulting in a total of 117 patches identified as ecological source areas.The ecological source site dPC was classified into three levels, with larger values indicating that the ecological source site is more important.
As shown in Fig. 5 and Table 2, there is one patch with dPC > 15.58 in the northern part of the study area, covering an area of 45.54 km 2 , which is the inland lake Hongjiannao in Shenmu City.There are two patches with 5.76 ≤ dPC ≤ 15.58, which are mainly dominated by medium-to high-covered woodland patches; most patches have low connectivity importance in the landscape pattern of Shenmu City, and are mainly dominated by high-covered grassland and low-covered woodland patches in terms of land use types.

Ecological resistance surface construction
Shenmu City's base resistance factors are shown in Fig. 6.The topography of Shenmu City has a general distribution of high northwest and low southeast; the slope distribution is the opposite and belongs to the Loess Plateau region.The MNDWI index is lower overall, and the water network shows a consistent distribution of north and south, The higher density areas of the water network are primarily first-class tributaries of the Yellow River flowing through the region; Shenmu City's road network runs through the coal development zone in the northwest, is most dense in the center, and exhibits consistent spatiality with population density.In resource-based urban development, roads are often synergistically distributed with population.The ecological resistance surface of Shenmu City was formed by considering the resistance of various factors comprehensively (Fig. 7).The higher cumulative resistance surface values are located in the northern and central parts of Shenmu City and lower in the southeast.The originally fragile ecological environment in the north and central part of the county is also a major coal development zone.Long-term mining has led to poor ecological environment quality.Factors such as NDVI, MDNWI and water network density all show high resistance values, indicating that the ESN in the north and the middle are difficult to be effectively connected.Moreover, the areas with high resistance values are far from the ecological sources, lacking information flow and transfer, and the ecological space network is even more difficult to connect.On the contrary, the vegetation growth in the southeast is relatively vigorous and there are larger ecological sources, thus having a stronger ESN and a safer ecological space.

Ecological spatial network construction
The ESN of Shenmu City was extracted using Graphap software (Fig. 8a).Finally, 193 ecological corridors totaling 1095.45 km and 117 ecological source points were identified in Shenmu City.
Ecological corridors are primarily located in the southeast and northwest regions of Shenmu City.The ecological source areas in the southeast region are mainly high-cover grassland and forest land, where the ecological environment quality is better, ecological connectivity is stronger, and the comprehensive ecological resistance value of the surrounding area is lower.Compared with the northwest region, the southeastern region has a shorter overall corridor length and a more complex ecological network spatial structure.The central region lacks ecological corridors, and the corridor length between source and ecological source areas is relatively long, mainly because the source area is dominated by woodland types and distributed sparsely, the ecological resistance is relatively large and the ecological connectivity is poor in the central region.This area has high terrain and a large slope, and a high road network and population density, resulting in a high resistance surface value.The ecological environment is also relatively poor.At the same time, there is a lack of forest and grassland ecological patches, which has an adverse impact on the transfer of matter and energy.
After generating the adjacency matrix of the ESN of Shenmu City through Matlab and then importing it  into Gephi software (https:// gephi.org/), different ecological community structures were analyzed based on the principle of graph theory.By calculating the modularity index, the 117 ecological source points were divided into five communities (Fig. 8b).
Through modular analysis, we can understand the characteristics of each ecological community.Nodes with a high modularity index are mainly distributed in the southeastern region.The southeastern region of Shenmu City has dense communities, short ecological corridors, good resistance to external risks, and strong ecological recovery ability when damaged, while the communities in the central region are sparse.Its ecological network easily collapses when attacked, and its ecological recovery ability is weak after damage.

Topology analysis of ESN in Shenmu City
The topology of the ESN can represent the ecological functions of nodes and edges in non-specific spatial locations and can reflect the characteristics of the interaction between substances in the ecosystem.Degree describes the amount of information exchanged by ecological nodes; the more information, the more important the node.The clustering coefficient is a measure of the degree of aggregation between ecological nodes, and the greater the coefficient, the higher the degree of similarity with peripheral nodes.
The degree of nodes in the ESN in the study area ranges from 1 to 7 (Fig. 9a), with nodes 103, 32, and 15 having a large degree (Fig. 9b).Nodes 32 and 15 are in the northwest region of Shenmu City, and the source type is water and forest, indicating that the water and forest resources in the northwest region of Shenmu City play an  , 9, 18, 26, 55, 94, 78, 87, 90, 111 and 107 have the smallest degree, with a value of 1.These ecological sources are not closely connected with other ecological sources.When attacked by external forces, they have little impact on the structure and function of the ESN, but their resilience is weak.The network diameter of the ESN in Shenmu City is 15, and the average path length of the edges is 6.39, indicating that two ecological sources can be connected by an average of 6.39 edges.
Ecological nodes 36, 68, 70, 97, and 96 have high clustering coefficients (Fig. 9d).These ecological nodes, characterized by high clustering coefficient and interconnectedness through ecological corridors, facilitate the efficient exchange of matter and energy with their neighboring nodes.This intricate network topology is of profound importance in sustaining biodiversity within ecosystems.
The betweenness centrality values range from 0 to 2000, with the majority of nodes below 1000.Nodes 15,16,32,35,65,72,75,103,and 115, a total of 9 nodes (Fig. 9e), have betweenness centrality above 1000.These nodes possess significant control capabilities and the capacity for material and energy transfer within the ESN, serving as vital bridges connecting different ecological nodes.
The closeness centrality of the ESN in Shenmu City ranges from 0.1 to 0.25.Nodes 32, 35, 60, 65, and 72 have relatively higher closeness centrality (Fig. 9f ), enabling them to access more information resources and energy.
Eigenvector centrality identifies key nodes by considering both the number of adjacent ecological nodes and the importance of each ecological node.Node 32 has the highest eigenvector centrality (Fig. 9g), indicating that any disruption to this node would greatly alter the topological structure of the ESN.On the other hand, nodes 18 and 78 have the lowest eigenvector centrality, exerting minimal influence on other nodes.

Ecosystem services evaluation
This study evaluated the ESs of Shenmu City and normalized the evaluation results (Fig. 10).Firstly, regions with high values of water conservation are primarily concentrated in the central-western and southern parts.These areas are distant from mining areas, boast lush vegetation, and experience relatively less human disturbance (Fig. 10a), aligning with the patterns of precipitation characteristics.Low soil and water conservation functionality is predominantly found in the northwestern region.This area, characterized as sandy grassland prone to ecological fragility, is abundant in mining zones.Frequent mining activities have significantly damaged the surface vegetation, leading to heightened risks of soil erosion (Fig. 10b).From the perspective of biodiversity maintenance functionality (Fig. 10c), the southeastern part of Shenmu City is relatively more significant.These areas feature high vegetation coverage and, due to topographical influences, receive more rainfall, resulting in a rich diversity of flora and fauna.Overall, the areas of significant importance (levels IV and V) in Shenmu City are primarily distributed in the southeastern region, accounting for approximately 9.59% (Fig. 10d).Specifically, level I (0.0-0.11, the lowest) covers an area of 2326.79 km 2 (31.78%), predominantly located in the sandy grassland areas in the northwestern part of Shenmu City.Level II (0.11-0.24, relatively low) spans 2893.14 km 2 (39.52%), extending from the northeastern to the southwestern part of the city.This level overlaps with areas of high road network density and larger population, where biodiversity maintenance functionality is comparatively low and faces substantial ecological protection pressure.The area of level III (0.24-0.35, medium) is 1398.72 km 2 (19.11%), distributed in a concentric circle pattern around the higher importance areas of levels IV and V. Levels IV (0.35-0.50, relatively high) and V (0.50-1.0, the highest) are sporadically scattered in small patches in the central-western, southeastern, and northeastern parts of the city, covering areas of 518.18 km 2 (7.08%) and 183.99 km 2 (2.51%) respectively.The plateau location and arid climate of Shenmu City determine its fragile ecological environment.The distribution of water conservation aligns closely with areas of significant ecological function.Effective water conservation is of paramount importance for the sustainable development of Shenmu City's ecological environment.

Spatial structure optimization analysis Function and structure correlation analysis
The correlation analysis of the ESs and the ESN topology of Shenmu City (Fig. 11) reveals a significant positive correlation between the degree and eigenvector centrality of grassland nodes and the ESs.Similarly, a significant positive correlation is observed between the degree and eigenvector centrality of water source nodes and the ESs.This analysis indicates that the greater the degree and eigenvector centrality of grassland nodes, the higher the ESs of the grasslands.Ecological stepping stones are the remaining patches of forests, grasslands, etc., after the screening of ecological sources.They do not meet the criteria of ecological sources but can serve as potential transfer stations for ecological flows.We should enhance

Optimization strategy
The nodes with the lowest EF value, representing 10% of the grassland and water source nodes, were considered weak ecological function nodes.Figure 12 identifies nodes requiring enhanced ecological functions, denoted as 'E+' .There are 12 such nodes, with a higher concentration in the central region, where 7 source locations need strengthened ecological functions.In comparison, the southeastern and northwestern parts exhibit better performance.The central region has seven weaker ecological nodes (20,21,36,38,52,54,61), the northwestern region has two (2, 19), and the southeastern region has three (88,109,117).For these nodes with weaker ecological functions, it is recommended to undertake measures such as afforestation, increasing vegetation coverage, controlling excessive mining, preventing illegal mining and destructive development, and protecting the integrity and diversity of existing vegetation.
The addition of stepping stones and corridors through ecological connectivity analysis includes 22 new ecological stepping stone nodes and 83 new ecological corridors (Fig. 13), mainly found in the northwestern and central parts of Shenmu City.Specifically, the northwestern region originally had fewer ecological source areas and greater ecological resistance.This region, characterized by lower vegetation coverage and frequent mining activities, requires vegetation protection and rational mining practices as primary measures to enhance its ecological functions.In the central region, where ecological corridors are longer, the addition of new corridors and nodes is beneficial for maintaining effective connectivity within the ESN and increasing the exchange of material and energy.

Robustness analysis
Robustness models are commonly used to assess the stability of ESNs.In robustness analysis, random attacks and malicious attacks are two ways to evaluate the stability and recovery ability of the network under different disturbances.Random attacks refer to attacking the nodes in the network in a random manner, while malicious attacks refer to selectively targeting the most critical or influential nodes in the network.Following the optimization strategies involving ecological stepping stones and the addition of new corridors, the optimized ESN demonstrates improved robustness and stability (Fig. 14).
In Shenmu City, the initial value of the edge RR of the ecological network is set at 1.Under scenarios of random attacks, the rate of decline in edge RR is slower than under malicious attacks scenarios.The robustness declines more rapidly when the number of attacked nodes exceeds 38.When the maximum number of randomly disrupted nodes reaches 47, the rate of robustness decline accelerates.When the number of random attacks and malicious attacks nodes is 105 and 97 respectively, the RR drops to 0.2, and the ESN is close to paralysis.After optimization, the decline rate of edge RR is reduced.Compared with before optimization, the speeds of random attacks and malicious attacks have slowed down by 11% and 3% respectively.When the number of nodes is 117 and 100, its edge recovery robustness reaches 0.2.It can be seen that the optimized ESN has better stability and network connection ability.
In the study area's ESN, the node RR under scenarios of random attacks demonstrates that the network can recover when a very small number of nodes are disrupted.On the contrary, the node RR declines rapidly.This decline accelerates when the number of nodes reaches 94, and the initial ESN approaches paralysis as the count surpasses 112.In scenarios of malicious attacks, the node RR falls below 0.2 when the number of affected nodes exceeds 102, indicating a near collapse instability.In the initial ESN under random attacks scenarios, the node RR decreases to 0.9 when the number of nodes increases to 63.The optimized network shows higher node RR than the initial network; its robustness decreases to 0.9 when the number of attacked nodes reaches 77.In scenarios of malicious attacks, the rate of decline in robustness is also reduced.This suggests that the optimized ecological network has improved resilience to both random and malicious attacks compared to the initial network configuration.
The CR of the ecological network decreases with an increasing number of attacked nodes, exhibiting a concave downward curve.In the initial network under malicious attacks scenarios, the robustness paradoxically increases instead of decreasing when 28 nodes are disrupted, indicating network collapse and extremely poor ecological network connectivity.Similarly, under random attacks scenarios, when the number of attacked nodes reaches 39, the CR starts to increase, signifying a complete collapse of the network's stability.
In contrast, the optimized network shows a significantly slower decline in CR.Under random attacks scenarios, the robustness starts to increase when the number of disrupted nodes reaches 79, indicating a total collapse of the network structure.These observations suggest that the optimized network's CR has been substantially improved, resulting in enhanced stability of the ESN and overall better resilience.

Discussion
This research identified core ecological source areas based on RSEI and MSPA and constructed the ESN of Shenmu City using the MCR model.Complex network analysis was applied to characterize the network structure, which facilitated the analysis of the correlation between EF importance and the topology of the ecological network.Subsequently, optimization strategies were proposed to enhance the importance of EF through ESN optimization and plant protection.
Through the implementation of these optimization strategies, nodes requiring enhancement were identified, and the stability and importance of EF in Shenmu City's ESN were improved by adding ecological stepping stones and corridors.As a result of this optimization, 22 new ecological stepping stone nodes and 83 new ecological corridors were added to Shenmu City's ESN.This significant enhancement in the network's stability and the increased importance of EF demonstrate the effectiveness of the applied optimization strategies.

Effectiveness of ecological source screening based on connectivity and RSEI
Currently, most studies selecting ecological source areas primarily utilize the MSPA method.However, this method focuses only on the morphological spatial pattern of source areas, neglecting the ecological connectivity between them and the intrinsic ecological environmental quality of the source areas themselves.In our study, the selection process for ecological source areas not only considers their shape characteristics but also integrates connectivity and ecological attributes.Therefore, we introduced the connectivity index and the RSEI ecological index to refine the selection of ecological source areas more accurately.
Our study comprehensively considers both the intrinsic ecological environmental quality and the extrinsic spatial morphology of ecological patches, providing valuable insights for constructing ecological networks at various scales and for assessing ecological environmental quality.Our approach not only successfully addresses the issues of fragmentation and isolation of ecological source areas but also significantly enhances the connectivity and stability of Shenmu City's ESN.This contributes theoretical support for ecological conservation and management and lays the foundation for the sustainable development of Shenmu City's ecological system.

The necessity and strategy of ecological network optimization
With the intensification of human activities, the decline in ecological function importance due to landscape fragmentation has become a hot topic in numerous studies.Landscape fragmentation restricts species migration and material flow, leading to population isolation and threats to EF and stability.Protecting and enhancing EF through optimization can maintain biodiversity and sustainable development.
In our study of Shenmu City's ESN and the importance of EFs, we found a significant positive correlation between the importance of EF and both degree and eigenvector centrality.Optimization strategies should be determined based on the relationship between topological structure and ecological functions.During optimization, it is not sufficient to select source areas for enhancement solely based on ecological function importance.Instead, choices should be made based on the correlation results between structure and function.Different network topologies have different ecological significances, necessitating the selection of appropriate indicators to improve the scientific rigor and reliability of the optimization.
Our study emphasizes the comprehensiveness of optimization strategies, focusing on enhancing the overall functionality and benefits of the ecosystem.Compared to traditional restoration methods, our study places greater emphasis on the scientific and rational aspects of the entire ecosystem, providing a more feasible and sustainable approach to optimizing ESN.

Constraints and future directions
In future studies, it is crucial to strengthen the consideration of various factors in the ecological resistance surface, especially focusing on those factors that are recognized as important in the latest research.Due to the absence of factor weighting in this study, it was not possible to precisely differentiate the specific impacts of different factors on the formation of ecological corridors.Therefore, subsequent research should determine the relative importance of factors based on the latest scientific research and ecological principles, ensuring that the interrelationships and impacts among selected factors are fully considered, to construct a more comprehensive and realistic ecological resistance surface.While this study has initiated an exploration into the relationship between ecological function and the topology of ESNs, it is important to note that this relationship may be limited by spatial scale and the scope of the study.The operating mechanisms of ecosystems may significantly differ across different geographic environments and scales.Future research should pay more attention to the sensitivity to changes in spatial scale, to more comprehensively understand the relationship between EF and spatial network topology.

Conclusions
This study selected Shenmu City, a coal resourcebased city with a fragile ecological background, as an example.The evaluation results of ecological environment quality were introduced as the selection indicators of ecological sources, and optimization strategies were formulated based on the importance of EFs to coordinate the contradiction between urban development and ecological protection.The results show that based on the evaluation results of ecological environment quality and the connectivity index, the ecological sources were re-screened, and finally 117 ecological sources were determined, with an area of 250.93 km 2 .The main land use types were forest land, grassland and water bodies.In the study area, the ecological resistance was high in the central part, and the ecological corridors were relatively sparse and long, while the resistance was lower in the southeast, and the distribution of ecological corridors was denser and shorter.Therefore, the southeast region of Shenmu City has stronger risk resistance and ecological restoration capabilities.In addition, there is an obvious spatial differentiation in the importance of EFs in Shenmu City, especially in the southeast and central regions.Further correlation analysis results show that the degree and eigenvector centrality of grassland nodes and water source nodes are significantly positively correlated with ESs.The ESN of Shenmu City was optimized through the strategy of adding 22 stepping stone patches and 83 new corridors.The optimization results show that the robustness of the optimized network has been significantly improved, which not only has a higher anti-interference ability but also improves the overall stability.
In conclusion, the results of this study provide a solid theoretical basis for the ecological security of Shenmu City, which is conducive to promoting the optimization of the urban economic structure and sustainable development.Moreover, it has important reference significance for resource-based cities in China to explore a win-win model of ecological protection and economic development on the path to green development.

Fig. 1
Fig.1 Location and elevation of the study area.The top-left subgraph shows a map of theYellow River Basin (YRB) and the geographical location of the Shannxi Province.The bottom-left shows the elevation of Shaanxi Province and the geographical location of Yulin City, and the right map shows the elevation of Shenmu City

Fig. 2
Fig. 2 Schematic diagram of the technical framework.Construction of ecological spatial network, evaluating of ecological function importance and optimizing of ecological spatial network

Fig. 3
Fig. 3 Spatial pattern of RSEI and NDVI, WET, NDBSI and LST in Shenmu City.The RSEI value from 0 to 1 indicates that the quality of the ecosystem is getting better

Fig. 6
Fig. 6 Spatial pattern of resistance factors (e.g., Elevation, Slope, MNDWI, NDVI, Water network density, Road network density and Residential density) and comprehensive resistance surface in Shenmu City

Fig. 7
Fig. 7 Minimum ecological resistance surface of Shenmu City based on MCR model.Blue to red in the map, the resistance value gradually increases

Fig. 10
Fig. 10 Spatial patterns of WR, Ac, Sbio and EFI in Shenmu City.The value from 0 to 1 indicates a gradual increase in ecological function capacity, where EFI index, I represents the lowest, II represents relatively low, III represents medium, IV represents relatively high and V represents the highest

Fig. 11
Fig. 11 Correlation of ecological nodes with ESN topological indices (e.g., Degree, Clustering, Closness Centrality, Betweeness Centrality and Eigenvector Centrality) in forests, watersheds and grasslands.The values of -1 to 1 indicate negative to positive correlation, and the size and color of the circle indicate the magnitude of the correlation coefficient value

Fig. 12
Fig. 12 Optimized distribution of ecological source areas in Shenmu City.Voronoi corridors denote ecological node connecting channels; E+ denotes ecological nodes in need of ecological function enhancement; The bottom map is the integrated ecological resistance surface

Fig. 14
Fig. 14 Optimization robustness assessment of ecological networks in Shenmu City (a Before Optimization, b After Optimization).From left to right, Edge Recovery Robustness, Node Recovery Robustness and Connection Robustness, where the red line is malicious attacks scenarios and the blue line is random attacks scenarios

Table 1
Factor categories, grading values and resistance of the comprehensive ecological resistance surface

Table 2
Statistics on the number, total area and area percentage of different levels of connectivity of ecological source land in Shenmu City