Sensitivity to network perturbations in the randomized shortest paths framework: theory and applications in ecological connectivity

The randomized shortest paths (RSP) framework, developed for network analysis, extends traditional proximity and distance measures between two nodes, such as shortest path distance and commute cost distance (related to resistance distance). Consequently, the RSP framework has gained popularity in studies on landscape connectivity within ecology and conservation, where the behavior of animals is neither random nor optimal. In this work, we study how local perturbations in a network affect proximity and distance measures derived from the RSP framework. For this sensitivity analysis, we develop computable expressions for derivatives with respect to weights on the edges or nodes of the network. Interestingly, the sensitivity of expected cost to edge or node features provides a new signed network centrality measure, the negative covariance between edge/node visits and path cost, that can be used for pinpointing strong and weak parts of a network. It is also shown that this quantity can be interpreted as minus the endured expected detour (in terms of cost) when constraining the walk to pass through the node or the edge. Our demonstration of this framework focuses on a migration corridor for wild reindeer (Rangifer rangifer) in Southern Norway. By examining the sensitivity of the expected cost of movement between winter and calving ranges to perturbations in local areas, we have identified priority areas crucial for the conservation of this migration corridor. This innovative approach not only holds great promise for conservation and restoration of migration corridors, but also more generally for connectivity corridors between important areas for biodiversity (e.g. protected areas) and climate adaptation. Furthermore, the derivations and computational methods introduced in this work present fundamental features of the RSP framework. These contributions are expected to be of interest to practitioners applying the framework across various disciplines, ranging from ecology, transport and communication networks to machine learning.


General introduction
Animal migration not only enables populations to exploit seasonally varying resources to allow persistence in areas that may otherwise be uninhabitable, it has also major effects on trophic interactions with both food resources and predators, including ecosystem services to humans.However, in recent decades anthropogenic movement barriers are turning terrestrial migration into a globally threatened phenomenon (Berger 2004, Wilcove and Wikelski 2008, Harris et al 2009).Hence, the development of tools to identify migration corridors and prioritization areas for conservation and restoration of these corridors is a priority in movement and landscape ecology (Beier et al 2008, Bolger et al 2008, Sawyer et al 2009).Here we present a novel methodology to identify priority areas for corridor conservation based on a sensitivity analysis of the randomized shortest paths (RSP) framework (Yen et al 2008, Saerens et al 2009, Kivimáki et al 2014, 2016).
The RSP is increasingly being adopted for the modeling of animal migration corridors and more generally for connectivity modeling in ecology (e.g.Panzacchi et al 2016, Fullman et al 2017, Peck et al 2017, Brennan et al 2018, Long 2019), due to its ability to model movement behavior along a continuum from optimal (least-cost) to random movement.As local changes in a network have varying degrees of global impact; in particular, a change in a weight or feature of a particular edge or node can be negligible, while a change on another edge or node can cause a significant disruption of the network resulting in a large change in the distance from a source to a target.
This work considers the problem of measuring the impact of local changes on a network by quantifying how much a perturbation of an edge or node weight impacts RSP-based distance and similarity/proximity measures.This is achieved through sensitivity analysis based on computing derivatives (Klein 2010), which quantify the effect of infinitesimal changes in network parameters on the RSP-based measures.The derivation of such computable expressions for the derivatives of these quantities enable estimation of the importance of different parts of a network on its connectivity and are thus valuable in prominent applications of RSPs.This is especially true for the analysis of data based on some form of movement, spread, transportation or communication between nodes of the network.One such example is movement ecology, in which RSPs have already been applied to GPS tracking data for reindeer (Panzacchi et al 2016), caribou (Fullman et al 2017, Long 2019), grizzly bears (Peck et al 2017), and elk (Brennan et al 2018), as well as to archaeobotanical and genetic data (Van Etten andHijmans 2010, Gruber andAdamack 2015).Moreover, the RSP framework is closely related to the Spatial Absorbing Markov Chains used to model mortality in dispersal movements (Fletcher et al 2019, Van Moorter et al 2021).
In these ecological, as well as other similar application contexts, the quantification of the sensitivity of the network to local changes can help in detecting the most critical and fragile, as well as the most robust and reliable parts of the network.This can help in spatial conservation prioritization (Moilanen et al 2009) and planning of green infrastructures.Sensitivity analyses have been considered in the ecological literature, e.g. for the metapopulation capacity index (Ovaskainen and Hanski 2003).In related works, the effect of removal or addition of a habitat patch to the connectivity of a landscape graph was studied in terms of the metapopulation capacity in Ovaskainen (2003), and in terms of the probability of connectivity index in Saura and Rubio (2010).However, these studies were focused on the sensitivity of a metapopulation w.r.t.its patches, they did not address perturbations within movement corridors between pairs of patches.
In this paper, we complement these sensitivity analysis of patches within a metapopulation (Ovaskainen andHanski 2003, Saura andRubio 2010) with a sensitivity analysis of the movement corridors between patches.We computed first derivatives which quantify the effect of infinitesimal changes in network parameters on the RSP-based measures.We then demonstrate the applicability of this approach with an ecological case study of the migration corridor between winter and calving areas of a wild reindeer population in Southern Norway, using data from an earlier publication (Panzacchi et al 2016).While this demonstration will illustrate the application of this sensitivity analysis within ecology, it is applicable more broadly to transportation or communication networks for the detection of the most critical and fragile, as well as the most robust and reliable parts of a network's connection between a source and a target.

Related work
From a complex networks and network science point of view, the developments are thus mainly based on the RSP framework, a tool developed in recent years that considers a Gibbs-Boltzmann probability distribution over the set of all paths from a source node to a target node on a weighted, directed, network (Yen et al 2008, Saerens et al 2009, Bavaud and Guex 2012, Kivimáki et al 2014).The Gibbs-Boltzmann distribution comes from the fact that we are seeking for the probability distribution minimizing expected cost from source to target, regularized by a relative entropy term bringing randomness to the system of paths (closely related to a maximum entropy argument; see Jaynes 1957, Cover andThomas 2005).The distribution thus focuses mostly on optimal (i.e.shortest, or least-cost) paths but is monitored by an inverse temperature parameter β which introduces a degree of randomness in the behavior.This Gibbs-Boltzmann distribution elicits several graph measures of interest for various network applications, including distance and similarity measures between nodes (Yen et al 2008, Kivimáki et al 2014, Françoisse et al 2017) and network centrality measures (Lebichot et al 2014, Kivimáki et al 2016) among others.
One of the main characteristics of this model is that it allows to balance exploitation and exploration in a natural way by tuning the β parameter, therefore modeling a whole spectrum of behaviors going from optimal (when β is very large) to almost completely random (when β is close to zero).Therefore, the proposed measures mentioned above generalize key measures such as the shortest path distance or the shortest path betweenness in a meaningful way by bringing more and more randomness.For instance, the derived directed distance measure4 between nodes (the expected cost) interpolates between the shortest path directed distance (Christofides 1975, Gondran and Minoux 1984, Sedgewick 2002) and the average first passage cost in a Markov chain (which is proportional to the resistance distance; see for instance, Fouss et al 2007).Similarly, the node betweenness measure interpolates between a variant of the shortest path betweenness (Freeman 1977) and of the current flow betweenness (Brandes and Fleischer 2005), also called the random walk betweenness (Newman 2005).From an ecological perspective, this property is attractive because the trajectories followed by animals, for instance during a migration, are never completely random, nor completely optimal or rational, but in-between these two extremes (e.g.Panzacchi et al 2016).
Another salient property of the RSP is the fact that the Gibbs-Boltzmann distribution on the set of paths, defining a routing policy in terms of trajectories to follow, is exactly equivalent to a Markov policy defined by its transition probability matrix (Saerens et al 2009).This transition matrix can be computed thanks to a closed-form expression depending on the adjacency and the cost matrices, as well as the inverse temperature parameter.A random walker following this Markov policy is more and more 'attracted' by the target node when the inverse temperature parameter increases.In addition, most of these different quantities derived from the RSP can easily be computed in closed form by using standard linear algebraic operations such as solving systems of linear equations or computing a matrix inverse.For a more thorough related work concerning the RSP framework, see for instance (Guex et al 2019, Leleux et al 2021).
As already stated, in the present work, we study how local changes in a network affect similarity and distance measures derived from the RSP framework globally in the form of sensitivity analysis.The quantification of the global impact caused by a change in a particular edge or node on a network is vital for several reasons, and can be interpreted as a centrality, importance, or criticality measure, depending on the situation.In this context, the present work is directly inspired by Klein (2010) who proposed to quantify the centrality of an edge by the degree of global sensitivity of a node distance function (a topological index, such as the sum of the distances between all pairs of nodes) with respect to the weight of the considered edge (a local cost or an affinity assigned to the edge).In this paper, Klein calculated the sensitivity for two widely used node distances, the shortest path distance and the resistance distance (Klein 2002).
Another, more recent, related work (Manik et al 2017) investigates the computation of susceptibilities with respect to edges and nodes.In that paper, the authors consider a different model, namely Kuramoto's oscillator network (Kuramoto 1984, Rodrigues et al 2016).In this context, they analyse the impact of a small change in the coupling value (related to affinities) of an edge on various network quantities, like the edge flows or the phase of the oscillators.They obtain interesting results; for instance, a phenomenon akin to the Braess paradox was observed.Moreover, the conditions where a complete breakdown of an edge occurs, or the network loses synchrony, are also studied.Some topological indices related to the whole network are also investigated, for example the norm of the phase differences over the whole network, induced by a small perturbation.
Likewise, in the sensitivity analysis described in this paper, we develop computable expressions for such derivatives with respect to weights (costs or affinities) on the edges or nodes of the network for the RSP model.The derivatives can be used for quantifying the global impact a change in weights of an edge causes, by considering some form of topological index based on RSP distances, namely, the expected cost along all possible trajectories reaching the target node from the source node.Moreover, the sensitivity of expected cost to edge or node features provides a new signed network centrality measure, the negative covariance between edge/node visits and path cost, that can be used for pinpointing strong and weak parts of a network.It turns out that this quantity can be interpreted as minus the endured expected detour (in terms of cost) when constraining the walk to pass through the node or the edge of interest, therefore generalizing the related quantity investigated by Ranjan and Zhang (2013) for Markov chains.It is further shown that the resulting sensitivity with respect to edge costs can be simply expressed as the sum of the RSP betweenness matrix (expected number of transitions through each edge) and the negative covariance matrix multiplied by the inverse temperature parameter.

Background and notation
In this section, we restate definitions, notation and results from earlier literature that are used in this paper (see, e.g.Fouss et al 2016).

Basic concepts
Throughout this work, we consider a directed, strongly connected, graph G = (V, E) with a set of n nodes, V = {1, 2, . . ., n}, and a set of m edges, E.An edge from node i to node j is defined as an ordered pair (i, j), but we will often use the shorthand notation ij = (i, j), and sometimes use e k , where k ∈ {1, 2, . . ., m}, to denote an edge based on some enumeration of the edges of G.We only consider graphs that do not contain self-loops, so, for all ij ∈ E, i ̸ = j.The set of successor nodes of a node i is defined as Each edge ij ∈ E is associated with two kinds of weights-an edge affinity, a ij > 0, and an edge cost, c ij ⩾ 0. The affinities and costs are normally considered as each others' opposites in the sense that affinities reflect the local similarity, proximity or strength of connection between connected nodes, whereas edge costs quantify the difference or distance between connected nodes or the difficulty of movement, communication or interaction between them.Note also that all vectors are written in bold and are column vectors.
Effectively, the edge affinities define an unbiased random walk (sometimes called the reference, natural, or pure random walk) on G according to transition probabilities on edges ij ∈ E as where A regular path (or, simply, a path) on G, of length ℓ, is a sequence of nodes ℘ = (i 0 , . . ., i ℓ ), where 0 ⩽ ℓ < ∞ and (i l−1 , i l ) ∈ E for all l = 1, . . ., ℓ if ℓ ⩾ 1.The length of a path ℘ is denoted by ℓ(℘).Note that the set of paths, according to the above definition, contains the zero-length paths, i.e. sequences consisting only of one node (and no edges), which is considered for the sake of computational convenience.A hitting path (sometimes absorbing path) is a path which contains the last node only once; formally, a path ℘ = (i 0 , . . .i ℓ ) is a hitting path if i l ̸ = i ℓ for all l < ℓ.
The set of regular paths starting from a fixed source node s and ending in a fixed target node t is denoted by Pst (note the ring on top of the calligraphic P, which is used in this paper to denote concepts and quantities related to regular paths; the ring emphasizes that the paths are allowed to cycle over target node t), while the set of hitting paths from s to t is denoted by P st ⊂ Pst .We speak of a pair of starting node and target node concisely as a s-t-pair and a path going from s to t as an s-t-path.It is worth noting from the above definitions that for any t ∈ V, the set of hitting paths P tt consists only of the zero-length path P tt = {(t)}.Lastly, for a path ℘ and for any l = 0, . . ., ℓ(℘), the lth node of path ℘ is denoted by ℘(l), the lth edge by ℘(l − 1, l), and the number of times that path ℘ traverses an edge ij by n ij (℘).
The cost of a path ℘ is defined as the sum of edge costs along the path, (2) In addition, we define the cost of zero-length paths as zero.The random walk likelihood of ℘ is defined as the product of the transition probabilities (see equation ( 1)), By convention, the random walk likelihood of zero-length paths is defined to be 1.One convenience about considering hitting paths is that for a fixed s-t-pair on G, with s ̸ = t, the random walk likelihood of a path directly defines its probability, as ℘∈Pst π(℘) = 1 (Françoisse et al 2017).Accordingly, for hitting paths ℘ ∈ P st , we specifically define and call P rw (℘) the natural (or unbiased, or pure) random walk probability of ℘.We focus mainly on hitting paths for two reasons-simply for the sake of brevity, but also because hitting paths are more natural (once the target node is reached, the walker stops) and the network measures derived from the hitting paths RSP framework are usually more directly related to many traditional network measures.Of course, the results derived in this work for hitting paths can be easily extended to regular paths (including cycles on target node t) as well.

RSP
The RSP framework is often introduced according to a cost-minimization problem with a relative entropy constraint (as in Yen et al 2008).However, here we give a more straightforward presentation for conciseness.
Let β > 0 be a free parameter.The RSP edge likelihood associated to an edge ij ∈ E is defined as and the RSP likelihood matrix W as the matrix whose element (i, j) is [W] ij = w ij if ij ∈ E and 0 otherwise.Therefore, the RSP likelihood of a regular path, ℘ ∈ Pst , is which remains valid for hitting paths, but with π(℘) redefined as P rw (℘) in that special context (see equation ( 4)).
The regular RSP probability of a path ℘ ∈ Pst is then given by the Gibbs-Boltzmann distribution is the partition function of regular s-t-paths.It has been shown that the regular paths partition function can be computed for any s-t-pair as element (s, t) of the fundamental matrix of regular paths, z st = [Z] st with (see, e.g.Kivimáki et al 2014, for details), The hitting RSP probability (or, simply, RSP probability) of a hitting path ℘ ∈ P st is similarly given by another Gibbs-Boltzmann distribution is now the partition function of hitting s-t-paths P st .This quantity can be computed from equation ( 8) by turning the target node t into a killed, totally absorbing, node.One way to do this is to set all elements of row t in matrix W to zero, but a more efficient mechanism which avoids altering the matrix W has been developed in Kivimáki et al (2014).
As shown in Yen et al (2008) and Kivimäki (2018), the RSP probability distribution defined in equation ( 9) minimizes the expected cost over hitting paths from s to t with a constrained relative entropy, or Kullback-Leibler divergence defined on path probabilities.Moreover, the shape of the distribution depends on the parameter β, so that with high values of β (as β −→ ∞), the distribution focuses on least-cost paths, whereas at low values (as β −→ 0 + ), the RSP probability converges to the random walk probability, P rw (℘).The parameter β thus plays the role of inverse temperature, i.e. β = 1/T, where T > 0.

RSP expected number of traversals and visits
From the regular and hitting RSP distributions of equations ( 7) and (9), several quantities of interest can be computed in closed form.Recall that for an edge ij ∈ E and a path ℘, we denote by n ij (℘) the number of times that ij appears on ℘.Furthermore, we define Thus, nst ij and n st ij denote the expected number of traversals over edge ij (i.e. the edge flow) over regular and hitting RSP probability distributions, respectively, from s to t.These can be computed, for any ij ∈ E, using the fundamental matrix Z, from equation ( 8), as (see, e.g.Kivimáki et al 2016, for details) Furthermore, for a node i ∈ V, by considering the set of successor nodes of i, Succ(i), we define i.e. n i (℘) is the number of times that i appears on path ℘.Note that this definition actually counts visits to nodes excluding the last node of the path (which has no successor), by convention.Based on this, the expected number of visits to node i over regular s-t-paths is defined, and can be computed as which follows from the elementwise form of equation ( 8) after multiplication from the left by I − W and from the fact that Likewise, from equation ( 11), we can derive the expected number of visits to node i over hitting s-t-paths, as in Kivimáki et al (2016), as As can be seen from equations ( 11), ( 13) and ( 14), the visit rates over regular and hitting paths are connected with simple expressions: Moreover, the RSP probabilities over hitting paths from s to t (with i, s ̸ = t induce a first-order Markov chain with biased transition probabilities towards the target node t, which are given by (see Saerens et al 2009, for details) Likewise, based on equations ( 11) and ( 13), for any i ̸ = t, we also have, for regular paths, In other words, the biased transition probabilities are equivalent, whether defined based on regular or hitting paths, except on the outgoing edges of the end node t (because the biased transition probabilities of transiting out of node t are 0 when considering hitting paths-the random walker is 'killed' when reaching the target node).Moreover, as can be seen from the final expression in equations ( 16) and ( 17), the biased transition probabilities are not dependent on the source node s.
Lastly, summing the hitting path visit rates over all s-t-pairs defines the simple RSP betweenness centrality of edge ij and node i (Kivimáki et al 2016), respectively, as that is, the expected number of visits when considering all s-t paths.
As discussed in (Kivimáki et al 2016), when β −→ ∞, the RSP betweenness measures converges to the shortest path likelihood betweenness centrality, which is closely related to the standard shortest path betweenness centrality (Freeman 1977), one of the most common conceptions of graph node centrality.At the random walk limit, when β −→ 0 + , bet rsp i converges to the stationary distribution (multiplied by a constant) of the natural random walk on G, i.e. the unique vector π for which (P rw ) T π = π and k π k = 1 (which corresponds to the PageRank score; Page et al 1999); see (Kivimáki et al 2016, Kivimäki 2018) for further details.

RSP distance and proximity measures
In this section, we discuss two distance measures and two proximity measures that can be derived from the RSP framework.The distance measures, namely the RSP expected cost and RSP free energy, have been defined and applied in earlier literature (Yen et al 2008, Kivimáki et al 2014, Fouss et al 2016, Kivimäki 2018).Note that we use the term distance even though we consider these measures as directed, meaning that they do not satisfy the axiom of symmetry normally required from a distance or metric.For proximity measures, we first consider the partition function, Z st , defined earlier in equation ( 9), but also a variant, termed here the weighted power mean proximity, which, to the best of our knowledge, has not been considered in earlier literature.

Expected cost distance
Another fundamental quantity that can be computed from the RSP distributions is the RSP expected cost of paths from s to t, defined, again, for any (regular and hitting) paths, respectively, as From equation ( 13), the RSP expected cost from s to t over the set Pst of regular paths can be computed as or, in matrix form, where • and ÷ denote elementwise multiplication and division, respectively.Intuitively, these expected costs are computed by summing the expected flows in the edges (number of traversals) times the cost of the transition.
In a similar way, the RSP expected cost from s to t over the set P st of hitting paths can be computed from equation ( 14) as (Saerens et al 2009, Kivimáki et al 2014, Kivimäki 2018) or, in matrix form, as where e is the n × 1 vector of ones and Similarly to the expected visit rates, the expected costs over regular and hitting paths are connected by The expected costsc st and c st can be considered as directed (i.e.asymmetric) distance measures between nodes.Furthermore, they both converge to the directed shortest path distance (i.e.least cost distance) from s to t, as β −→ ∞, as the RSP distribution concentrates all probability mass on the least cost paths ℘ * .In addition, when β −→ 0, the expected RSP cost over hitting paths, c st , converges to the expected hitting cost of the pure random walks from s to t.
The symmetrized expected cost over hitting paths, ∆ rsp st = c st + c ts , is called the RSP dissimilarity (Yen et al 2008, Kivimáki et al 2014), and when β −→ 0 + , ∆ rsp st converges to the commute cost distance between s and t, ∆ cc st , which, on an undirected graph G, is proportional to the commute time distance, ∆ ct st , and the resistance distance, ∆ Res st (Klein andRandic 1993, Fouss et al 2016).More precisely, for an undirected graph G, for every s, t ∈ V, the following relations hold (see e.g.Chandra et al 1989, Kivimáki et al 2014): Thus, the RSP expected cost provides a natural generalization of both the shortest path distance and the resistance distance, which are possibly the two most commonly applied distance measures on graphs.

Free energy distance
Another relevant distance measure that can be derived from the RSP framework is the directed free energy distance (or, simply, free energy) from s to t, ϕ st , which can be defined for hitting paths as where T = 1/β is the temperature and J st is the Kullback-Leibler divergence, or relative entropy, of the distribution P rsp (see equation ( 9)) with respect to the random walk distribution P rw .Inserting the Gibbs-Boltzmann distribution of equation ( 9) into the expression of ϕ st provides another, more straightforward, expression (Kivimáki et al 2014), Similarly to the expected RSP hitting cost, c st , the free energy ϕ st also interpolates between the directed shortest path distance (when β −→ ∞) and the random walk expected hitting cost (when β −→ 0 + ).

The partition function, i.e. the survival probability proximity
The partition function of hitting paths, Z st , defined in equation ( 9), can be interpreted probabilistically in terms of killed, or transient, random walks: it can be shown that for any β > 0 and with c ij > 0 at least on one edge ij ∈ E, the RSP likelihood matrix W is non-negative and substochastic, i.e. its every row sum is less than or equal to 1 and at least one row sum is less than 1.This is equivalent to considering a random walk where, at each node i ∈ V, the residue probability 1 − n j =1 w ij corresponds to a transition probability to an imaginary 'cemetery' node, i.e. the probability that the random walk gets 'killed' at node i instead of continuing to an adjacent node (Fouss et al 2016, Guex et al 2019).This is the same formalism as the spatial absorbing Markov chains used for dispersal modeling with mortality (Fletcher et al 2019, Marx et al 2020), we discussed this link in earlier work (Van Moorter et al 2021).
Based on the above, the definition of the partition function, Z st , in equation ( 9) can be seen to quantify the overall probability of hitting paths leaving from s that go to t instead of going to the cemetery node.In other words, the partition function Z st is also the survival probability from s to t, i.e. the probability that a random walker makes it from s to t without getting killed along the way, when moving according to the killed random walk defined by the substochastic matrix W. Thus, Z st , as a probability, defines a meaningful and interpretable proximity measure between nodes of a network.
It was shown in Kivimáki et al (2014) and Françoisse et al (2017) that for any s-t-pair, the hitting path partition function Z st can be computed from the regular path partition functions (i.e. the elements of matrix Z; see equations ( 7) and ( 8)), as Accordingly, the fundamental matrix of hitting paths, containing the partition function Z st at element (s, t), for all s, t ∈ V, can be computed as where D Z = Diag(Z) is the diagonal matrix consisting of the diagonal of matrix Z.

The weighted power mean proximity
A distance measure can be converted into a proximity measure by applying a suitable decreasing function k : R ⩾0 → R ⩾0 .Standard choices for such functions are the reciprocal k rec (x) = 1/x and the exponential k exp (x) = exp(−x).The exponential is also a simple special case of a Gaussian kernel.
Applying the exponential transformation on the free energy distance ( 27) provides an interesting proximity measure, as where T = 1/β is the temperature of the RSP distribution.Based on equations ( 4), ( 6), and ( 9), this measure defined on hitting paths can also be expressed as which is the weighted power mean of the exponential terms exp(−c(℘)), with the unbiased random walk probabilities P rw (℘) as weights.Accordingly, we call this measure the weighted power mean proximity.
The weighted power mean proximity is obviously similar to the plain survival probability proximity, Z st .However, the scaling of the two proximities is different with different temperatures T. Especially, for the plain survival probability proximity, as β −→ ∞ (i.e.T −→ 0 + ), we have Z st −→ 0 for all s-t-pairs, as the probability of being killed increases in general, whereas when β −→ 0 + (T −→ ∞), we have Z st −→ 1 for all s-t-pairs, as the probabilities of being killed decrease and the walker survives to the target with almost certainty.Thus, the survival probability, as such, lacks meaning in the limits of the temperature T.
Instead, the limit values in the case of the weighted power mean proximity are more meaningful, which can be understood from its relation with the free energy.Namely, as β −→ ∞, we have ϕ st −→ c * st , and, accordingly, based on equations ( 30) and ( 31), Z . This is especially interesting in the case (appearing in real applications) where the edge costs are defined as c ij = − log a ij , and the edge affinities such that 0 < a ij ⩽ 1 for all ij ∈ E (e.g. as probabilities, in some way).Then, the cost of any path where is the likelihood of path ℘ in terms of the (possibly probabilistic) affinities along the path, and the path cost c(℘) is the negative log-likelihood of path ℘.With this setting, as β −→ ∞, the weighted power mean proximity generalizes the likelihood of the most likely path5 , Z As already stated, in the limit β −→ 0 + , the weighted power mean proximity converges to the exponential of the expected log-likelihood of paths with respect to the unbiased random walk probabilities, Z , where a rw st = ℘∈Pst P rw (℘) log a(℘).In addition, with β = 1 = T, the weighted power mean proximity corresponds to the survival probability, where the probability of surviving a transition over an edge ij is given by exp(−c ij ) = a ij .
To sum up, when defining affinities such that 0 < a ij ⩽ 1 and costs as c ij = − log a ij , the RSP model generalizes the concept of most likely paths and the weighted power mean proximity, Z 1/β st , generalizes the likelihood of the most likely path, a * st , as well as the survival probability proximity, where the probability of surviving a step over an edge ij is a ij .
Later in the paper, we will derive sensitivity analyses of the free energy, ϕ st , and the expected RSP hitting cost, c st , as distance measures, as well as the hitting path partition function, Z st , and the weighted power mean, Z 1/β st , as proximity measures.

Sensitivity analysis
The m edge affinities, a ij , and m edge costs, c ij , where m = |E| is the number of edges, can be considered as independent parameters of the RSP model.In addition to the edge parameters, it involves the inverse temperature parameter β meaning that the RSP model, in general, involves 2m + 1 parameters in total.
However, in practice, the edge costs and affinities are not necessarily always independent, but are defined from each other.This is the case, for example, when only one type of quantity can be estimated empirically, and the randomness and optimality of movement is considered in terms of that quantity.In such a case, the dependence between costs and affinities is meaningful to define using some strictly decreasing (and thus invertible) function.Either the edge costs can be defined from affinities using such a function c : R >0 → R ⩾0 as c ij = c(a ij ), or affinities from costs with a : R ⩾0 → R >0 as a ij = a(c ij ), where the two functions are inverses of each other, a = c −1 .In this case, the effective number of parameters is only m + 1.Moreover, throughout this work we assume that the functions a and c are differentiable.Standard examples of such functions are the reciprocal a ij = 1/c ij or the exponential a ij = exp(−c ij ), whose inverse functions are c ij = 1/a ij and c ij = − log(a ij ), respectively.
The sensitivity of RSP-based measures on perturbations on the graph should be interpreted differently depending on whether or not affinities and costs are dependent.If they are independent, then a perturbation of an edge affinity should not imply a perturbation of an edge cost, and vice versa.In such a case, the proper sensitivity measure is given by the partial derivative with respect to the parameter of interest.In this work, we derive the partial derivatives of the distance and proximity measures presented in section 2.4 with respect to edge affinities and costs independently.These results are important and useful for many applications of the RSP framework, including modeling movement on networks as well as defining network centrality measures.
In applications where the edge affinities and costs have a functional dependency, it can be more meaningful to consider sensitivity based on the total derivative, which can be computed straightforwardly using the partial derivatives as follows.Consider an arbitrary scalar function Q ≜ Q(β, (a ij ), (c ij )) (e.g. a distance between two nodes) that can be computed from the RSP model.The total derivative of Q with respect to the affinity a ij on a given edge ij ∈ E can be computed, using the chain rule, based on the partial derivatives as Of course, the same expression, with a ij in place of c ij and vice versa, gives the total derivative with respect to an edge cost c ij .Finally, in sensitivity analysis, it is often more relevant to study perturbations as relative, instead of absolute, changes in a parameter value.This can be done by taking the derivative with respect to the logarithm of the parameter, which is also the convention used e.g. by Klein (2010).For instance, the relative impact of a change in an affinity a ij on an arbitrary quantity Q = Q(a ij ) can be considered as How this measure changes in a relative, instead of absolute, sense can be understood by defining âij = log a ij , i.e. a ij = expâ ij .Then, expressing the derivative as the limit of the difference quotient, we can write Thus, the derivative with respect to the logarithm of the argument quantifies the change in Q, with respect to an infinitesimal change ϵ, when the argument is multiplied by exp(ϵ) ≃ (1 + ϵ) when ϵ becomes small (instead of incrementing the argument with ϵ, as in the standard absolute derivative).These relative sensitivities are commonly referred to as elasticities in the context of population ecology and demography (e.g.Caswell 2001).

Sensitivity to perturbation on an edge
Inspired by Klein (2010), this section presents the derivations of expressions for the sensitivity of the different RSP-based distance and proximity measures towards perturbations of edge parameters, assuming that edge costs and affinities are set independently.The results are essentially derived for hitting paths; the extension to regular paths is briefly discussed at the end of the section.

Partial derivatives of basic quantities
First, the derivatives of some of the fundamental quantities of the RSP framework are computed.We begin by noting that it follows trivially from the definition of path costs in equation ( 2) that for any path ℘ and any edge ij ∈ E, where n ij (℘) denotes the number of times edge ij is traversed.
A similar, although a bit more involved, result can be derived for the sensitivity of the random walk probability of a hitting path with respect to a perturbation of an edge affinity.The result is used later in the work, but presented here early on, as it does not only concern the theory of RSPs but natural, unbiased random walks on graphs in general.
Lemma 3.1.Let ℘ ∈ P st and ij ∈ E.Then, the derivative of the random walk probability of a hitting path, defined by equations ( 3) and ( 4), with respect to an (existing) affinity is with A i being the out-degree of node i.
Proof.The proof is slightly complicated by the fact that although a change in the affinity a ij does not affect other affinities a kl , where kl ̸ = ij, it does, however, affect the transition probabilities p kl , when k = i, as a change in a il causes a change in the out-degree A i of node i.
Recall from equation (1) that the unbiased random walk transition probabilities are defined as Accordingly, the random walk probability of path ℘, defined in equation ( 3) (remembering that for hitting paths ℘, P rw (℘) = π(℘), as stated in equation ( 4)), can be decomposed as a first factor depending on a ij and the remaining ones, not depending on a ij , using the convention 0 0 = 1, and the fact that A . Now, the derivative with respect to a ij only affects the two first factors of the above decomposition.Moreover, noting that Therefore, from (38), we get the desired result, We then derive the expressions for the derivatives of elements of the fundamental matrix Z, which are also vital for other derivations that follow.
Lemma 3.2.For any s, t ∈ V and any edge ij ∈ E, the partial derivatives6 of the elements z st of the fundamental matrix Z (equation ( 8)) are Proof.First, note that for an edge kl ∈ E: Accordingly, where e i is a basis column vector containing 0s, except at entry i which contains a 1.Thus, using ( 44) and the fact that ∂Y −1 /∂x = −Y −1 (∂Y/∂x) Y −1 (see, e.g.Harville (1997), Abadir and Magnus (2005)), for any invertible matrix Y, proves equation ( 41): The partial derivative w.r.t. the affinity a ij is a bit more involved because changing a ij affects transition probabilities p ik for all k ∈ Succ(i).First, because p ik = a ik /A i , we have and, for any k ̸ = j, Thus, which can be written more concisely as with δ(k = i) equal to 1 if k = i and 0 otherwise.Furthermore, in matrix form, similar to (44), we have where In words, W ij is the n × n matrix consisting of w ij at element (i, j) and zeros elsewhere, whereas W r(i) consists of the ith row of matrix W on its ith row, and zeros elsewhere.
From this, we obtain, similarly to (45), Now, we know that (I − W)Z = I, i.e.WZ = Z − I or, elementwise, n l=1 w il z lt = z it − δ it , which proves equation (42).

Sensitivity of RSP proximity measures
Next, the derivatives of the two proximity measures, namely the hitting paths partition function Z st (i.e. the survival probability, equation ( 28)) and the weighted power mean proximity Z 1/β st (equation ( 31)), as discussed in section 2.4), are derived.
Theorem 3.3.For any s, t ∈ V and any edge ij ∈ E, the partial derivatives, with respect to the edge parameters, of the partition function Z st , i.e. the survival probability proximity from s to t, from equation ( 9), are Proof.Remembering that Z st = z st /z tt for hitting paths (see equation ( 28)), and using ( 41), ( 11), we get Equation ( 54) follows similarly, by use of ( 11), ( 14) and (42).
As a side remark, equation ( 54) can be written further, by using the definitions of the unbiased and biased transition probabilities, p ij and p (t) ij , from equations (1) and ( 16), respectively, as This form shows that increasing the affinity on an edge ij also increases the partition function if and only if p (t) ij > p ij , i.e. if the bias towards the target node t increases the transition probability over ij compared to the unbiased transition probability.
From theorem 3.3, the partial derivatives of the weighted power mean proximity follow fairly trivially: Corollary 3.4.For any s, t ∈ V and any edge ij ∈ E, the partial derivatives of the weighted power mean proximity are Proof.For equation ( 57), using (53), we simply have Equation ( 58) follows similarly.

Sensitivity of directed free energy distance
Let us now proceed with the sensitivity of the directed free energy distance appearing in equation ( 27).
Lemma 3.5.For any s, t ∈ V and any edge ij ∈ E, the partial derivatives of the (directed) free energy distance, ϕ st , from equation ( 27), are Proof.These follow directly from theorem 3.3, and from the computable form of ϕ st in equation ( 27), as where we simply used equation ( 53).We proceed similarly from equation ( 54) for the partial derivative with respect to a ij .

Sensitivity of expected cost
Next, we derive expressions and a method for computing the sensitivity of the expected cost, c st (equations ( 19) and ( 22)), with respect to perturbations of edge parameters.We start with the sensitivity with respect to edge costs and then proceed with affinities.

Sensitivity with respect to costs
As the derivations are more complicated than in the previous results, we split the consideration of the partial derivatives with respect to edge costs c ij and to edge affinities a ij into separate theorems.
Theorem 3.6.For any s, t ∈ V and any edge ij ∈ E, the partial derivative of the expected cost from s to t, c st , from equation ( 19), with respect to the edge cost c ij is where σ st ij is the negative covariance of the random variables c(℘) and n ij (℘) (or, rather, functions of the random variable whose outcomes are paths ℘ ∈ P st ) with respect to the RSP hitting paths distribution.Formally, we define where is the expectation of the product n ij (℘)c(℘) over the hitting paths distribution P rsp , which is defined in equation ( 9).We discuss the interpretation of the term σ st ij after the proof of the theorem.Proof.Applying the derivative directly on the definition of c st from equation ( 19) gives in which term (2), based on equations ( 36) and ( 10), is simply (2) = n st ij .For term (1), on the other hand, we obtain from ( 6), ( 9), ( 36), and ( 53), and therefore which proves the theorem when computing (1) + (2).
The negative covariance term, σ st ij , appearing in theorem 3.6 deserves a deeper inspection.First of all, for a fixed s-t-pair, σ st ij is positive for an edge ij if s-t-paths that are likely to traverse edge ij also likely have a low cost, and, on the other hand, if high-cost s-t-paths rarely visit edge ij.On the contrary, σ st ij is negative if paths that are likely to visit edge ij also likely have high cost, whereas low-cost paths do not tend to visit ij.This happens when edge ij lies 'far away' from the low-cost paths between s and t.
Thus, σ st ij can be considered as a signed betweenness measure, because a positive value of σ st ij indicates that edge ij lies more likely on low-cost paths between s and t than on high-cost paths.It therefore allows us to pinpoint problematic edges which are frequently traversed by high-cost paths.In theorem 3.6, the above interpretation makes sense, as a positive value of σ st ij also implies stronger sensitivity of the expected cost c st to perturbations of the edge cost c ij .
However, the expression in theorem 3.6 is not sufficient for implementing the computation of the edge cost sensitivity of c st .In particular, the tools presented so far do not yield a method for computing the term cn st ij of equation ( 66).Next, we develop a method for implementing the computation of the expression in theorem 3.6, in particular, the negative covariance term σ st ij .For this, we first state and prove two intermediate results.
Lemma 3.7.For any s, t ∈ V and any edge ij ∈ E, Proof.Note first that for path likelihoods, w(℘), defined in equation ( 6), we have and thus, for the partition function, Z st , from equations ( 9) and ( 19), we get Hence, for the RSP hitting path probabilities recalled here, P rsp (℘) = w(℘)/Z st (equation ( 9)), Using this as well as equation ( 10), we finally get Interestingly, the first part of lemma 3.7 and equation ( 60) imply that σ st ij = ∂ 2 ϕ st /∂β∂c ij which, from standard notions of statistical physics, leads to a covariance measure (Jaynes 1957, Kardar 2007, Peliti 2011).
Applying lemma 3.7 on the computable expression of n st ij , from equation ( 11), provides a computable expression for the negative covariance term σ st ij : Lemma 3.8.For all s, t ∈ V and any ij ∈ E, the negative covariance term, σ st ij , from equation ( 63), can be computed as where and, furthermore, It means that this quantity can be computed using the computable expressions of the terms nst ij ,c st in equations ( 11) and ( 20).The intepretation of the quantities appearing in the Lemma are discussed after the proof.
Proof.Let us compute the different terms.Using lemma 3.7 and applying the derivative on the computable expression of n st ij of equation ( 11) gives Using equations ( 7) and ( 71), we obtain, for any s, t ∈ V and regular paths, where the last equality follows from combining equations ( 7) and ( 19).As a result of the above, we have Thus, for part (1) of equation ( 78), we get, using (11), For the other parts, by using ( 5), ( 11) and ( 15), we obtain and, in the same way, using (79), Summing ( 1), ( 2) and (3) in equation ( 78) then proves the Lemma: Concerning the new quantities, σst ij and κst ij , defined in lemma 3.8, we note (although it is not proved here) that σst ij actually quantifies the negative covariance between the quantities c(℘) and n ij (℘) analogously to the hitting-path version σ st ij but, this time, for regular paths, ℘ ∈ Pst , over the distribution Prsp from equation ( 7).The other newly introduced term, κst ij , can be interpreted (although slightly vaguely), based on equation ( 77), as measuring the difference in cost of moving directly from s to t versus making a detour through edge ij along the way.This difference is negative when the detour is more costly (c st <c si + c ij +c jt ), and positive when it is actually cheaper to first consider movement from s to i, then over edge ij and then from j to t (c st >c si + c ij +c jt ).As such, this quantity extends both the shortest-path and the random-walk eccentricity (Ranjan and Zhang 2013) measures, which are defined as the mean overhead (in terms of shortest path, or of average first passage time) incurred when visiting intermediate node j on a shortest path, or a random walk from s to t, instead of directly walking to s.As for standard betweenness measures, the overheads can be averaged over all s-t pairs and rescaled.The κst ij quantity therefore interpolates in some way between the shortest-path and the random-walk eccentricity.

Sensitivity with respect to affinities
Next we derive expressions for the sensitivity of c st with respect to a perturbation of an edge affinity.Lemma 3.9.For all s, t ∈ V and any ij ∈ E, the partial derivative of the expected cost from s to t, c st , from equation ( 19), with respect to the edge affinity a ij is where is the nodewise negative covariance between n i (℘) (equation ( 12)) and c(℘) with respect to the RSP distribution.Furthermore, this quantity can be also expressed as Proof.First, following lemma 3.1 (equation ( 37)) and equation ( 6), we have Therefore, applying the derivative directly to the definition of c st in equation ( 19) and using equations ( 9) and ( 54), gives where we used the definitions of σ st ij (equation ( 64)) and σ st i (equations ( 85) and ( 86)), as well as the fact that the negative covariance can also be expressed as Equation ( 87) follows from writing out the definition in equation ( 86), Consequently, the nodewise negative covariance can be computed by first computing σ st ij for all j ∈ Succ(i) separately and then summing the results.

Sensitivity to perturbation on a node
In some situations it may be more relevant to study perturbations affecting a node instead of a single edge.In general, as costs and affinities are usually defined on edges, a perturbation on a node can be considered in a few different ways: it can affect either the incoming edges or the outgoing edges of a node or possibly even both.Another possibility is that edge properties are actually determined by properties of the nodes attached to that edge; for instance, in some situations, the edge costs can be defined based on costs associated to the end node of that edge.In any case, the sensitivity to perturbations on a node can be computed by extending the results of section 3, but the extension needs to be considered in different ways depending on the context.
Formally, let us denote by E(i) ⊂ E the subset of edges of G that are affected by the perturbation of node i (for example, A simultaneous perturbation on node i can be defined as a weighted sum of the partial or total derivatives with respect to the edges in E(i).Technically this corresponds to the directional derivative in the parameter space along a vector that contains nonzero values only at the indices corresponding to the affinities or costs of the edges in E(i) (based on the implicit indexing of the parameters).
As an example, consider a perturbation of affinities (independent of costs) on the edges in E(i), and denote by a i a vector of length 2m (corresponding to the number of free parameters, namely the edge affinities, a kl , and edge costs, c kl , for all kl ∈ E where, as before m = |E| is the number of edges on G) that has nonzero values only at the indices corresponding to the affinities of the edges in E(i).Also, let Q, again, be an arbitrary differentiable scalar function of the RSP model (e.g. a distance between two nodes).Then the sensitivity of Q to a perturbation of the affinities on edges associated to node i, assuming that affinities and costs are independent, can be computed as the directional derivative of Q in the direction of a i , which is given by the dot product of a i and the gradient of Q.The nonzero values in vector a i can be chosen in, at least, two meaningful ways: they can be set to 1, in which case the sensitivity of Q to a perturbation of node i is Alternatively, the nonzero values of a i can be chosen as a kl for the vector element corresponding to the index of the affinity of edge kl.Then the sensitivity of Q becomes which corresponds to the sum of the unitless partial derivatives, i.e. the partial derivatives with respect to the logarithm of the parameters (see section 2.5).

Algorithm computing the sensitivity of expected cost c st
Recall that the sensitivity of c st to an edge cost perturbation was derived in theorem 3.6, where n st ij is the simple RSP edge betweenness of edge ij which was defined by Kivimáki et al (2016) and presented in equation ( 18), and where we have defined the negative covariance betweenness of edge ij as σ st ij .Similarly, the sensitivity of c st with respect to a perturbation of an affinity a ij is quantified, based on lemma 3.9, by Let us now derive an algorithm computing these sensitivities of expected s-t RSP cost with respect to local costs and affinities on edges.The objective is to try, as far as possible, to use sparse matrix computation and matrix-vector products in order to scale on larger landscapes.
The first step aims at turning the target node t into a totally absorbing node.This can be done by simply setting row t of the W matrix (see equation ( 5)) into a row full of 0's.This trick allows us to use the equations dealing with regular paths, instead of hitting paths because, when the target node is absorbing, all regular paths must be hitting paths.It therefore simplifies the computation as, usually, mathematical expressions for regular paths are simpler than their counterpart for hitting paths.
Then, we compute the forward and the backward variables (Saerens et al 2009, Garcia-Diez et al 2011), z s = Z T e s and z t = Ze t , corresponding respectively to the row s and the column t of the fundamental matrix Z viewed as column vectors, containing the z si and z jt for i, j = 1, . . ., n.These two vectors are needed for computing the expected number of visits to nodes and edges (see equations ( 11) and ( 13) for regular paths) as well as the expected costs from node s, and to node t (see equation ( 20)).Because Z = (I − W) −1 , for computing the forward and backward variables, we simply have to solve the two following systems of linear equations solve (I − W) T z s = e s (forward variables) solve (I − W) z t = e t (backward variables).( 93) We are now ready to compute the expected number of passages through existing edges7 and the expected number of visits to nodes in matrix/vector form.From equations ( 11) and ( 13), and considering that the total number of visits to absorbing node t is 1, where • denotes the elementwise vector or matrix product8 and z s t (element t of column vector z s ) is equal to z st , the partition function of regular paths (equation ( 7)).In the above equation, it is recommended to use the elementwise product formulation which uses vectors instead of (diagonal) matrices.
The next step is to compute the expected costs from the source node s to all nodes i, as well as from each node j, to the target node t.Using the forward and backward variables (93) and equations ( 20) and ( 21), we obtain the expected costs from source node,c s (forward cost) and to target nodec t (backward costs), In this equation, ÷ is the vector or matrix elementwise division and we used the property e T i (X ÷ Y) = (e T i X) ÷ (e T i Y).In addition, the expected cost of the set of regular paths from s to t is obtained by cst = [c s ] t (element t of vectorc s ).Now, as we want to avoid working with dense matrices like Z, we prefer to solve the following system of linear equations instead of using (95), and rescale the solution in the following way: Similarly, for the backward costs, (97) and therefore the backward vector is obtained by Let us now define a n × n binary indicator matrix B containing a 1 in position i, j when there exists an edge between node i and j, and 0 otherwise, B = (A > 0).The kappa matrix, representing the additional expected cost when making a detour through edge ij when walking from s to t (see equation ( 77)), can now be computed from the previously defined quantities as From this last result, the negative covariance matrix is easily obtained by equation ( 76), In addition, the node-based negative covariance vector is computed by summing each row of the negative covariance matrix (equation ( 87)), where e is a column vector of 1s.Using the above, the sensitivity of c st to perturbations of edge costs and affinities can be expressed in matrix form.The edge cost sensitivity ∂c st /∂c ij of equation ( 63) is given by For the edge affinity sensitivity ∂c st /∂a ij of equation ( 63), denoting the vector of out-degrees containing the A i as d and using equation (84) provides where the elementwise divisions are performed on non-zero entries only.
Importantly, even if we used the expressions for regular (non-hitting) paths, these quantities are actually defined on hitting paths because of the trick consisting in transforming the target node t into an absorbing node.
The algorithm for computing the sensitivity of c st , for all edges of the graph, is presented in algorithm 1.We implemented this algorithm in Julia (Bezanson et al 2017), see the supplementary material, and demonstrate it in the next section on a migration corridor for reindeer in Norway.with positive values along the lower cost paths bordered by two strips of negative values on either side, where these strips of both positive and negative values become wider as β decreases (i.e. more random movement).This is not surprising as increased movement along lower cost paths would indeed decrease the RSP expected cost and vice versa.
The sensitivity analysis of the movement corridor can highlight areas where mitigation actions may be most effective, as these are areas where perturbations have the highest effect on the expected cost of the corridor.In figure 3, we focus on the most central area of the migration corridor (as highlighted on figure 1(C)), where it crosses county road 450.While the sensitivities w.r.t.affinities or costs alone are revealing some information, for this application where costs are a function of affinities (c ij = − log(a ij )), it is the total sensitivity w.r.t.both affinities and costs that is most informative (panel 5 in figure 3), as it accounts for their functional relationship.As previously explained, by utilizing the chain rule, we can compute the total derivative (equation ( 33)) based on the partial derivatives w.r.t.affinities (equation ( 84)) and w.r.t.costs (equation ( 63)): .The top row is the betweenness of node i for s-t ( ∑ j ∈Succ(i) n st ij ), the second row is the negative covariance of node i ( ∑ j ∈Succ(i) σ st ij ), the third row is the sensitivity of the expected cost (cst) w.r.t. the costs of node i, and the fourth row w.r.t. the affinities of node i (a ij with j ∈ Succ(i)).The betweenness values are positive (n st i ⩾ 0), whereas the other values (in rows 2 to 4) can be both positive or negative.See figure 1 for the context of these maps and the main text for further discussion.
The combination of the road, hydropower reservoirs, recreational housing, and steep terrain introduces a major barrier, as shown by the low permeability (along the ellipse in Panel 2 in figure 3).Improving the permeability of this barrier along the main migration corridor (indicated with the ellipse in figure 3) would be one of the main interventions to reduce the cost of this migration corridor connecting the wintering and calving grounds of this population.Indeed, this area is a major focus for the management of this wild reindeer population and different mitigation actions related to human land use are being discussed in local boards (Strand et al 2011).We highlight the area around the road with an ellipse where increasing affinities would result in the largest drops in the expected cost to move from the winter range (source) to the summer range (target), and could be prioritized for conservation actions.

Discussion and future work
This work derived methods for performing sensitivity analysis of the RSP model considering infinitesimal perturbations of the edge or node parameters of the model.Although not presented here explicitly, the derivations have also been confirmed experimentally by comparing the analytical expressions derived here with simulated perturbations where edge or node parameter changes are caused.We applied these derivations to compute sensitivity of the expected cost for the movement corridor between wintering and calving grounds for a wild reindeer population in Norway.This demonstration shows the potential application of this approach to inform spatial prioritization and land planning for biodiversity conservation.
The results both in lemma 3.3 and corollary 3.4 show that, as Z st and Z 1/β st are considered as proximity measures, their cost-sensitivity can, in fact, be interpreted as (negative) proximity-weighted betweenness measures of edge ij with respect to a s-t-pair.The sensitivity of the expected cost, c st , involves, in addition to n st ij , also the negative covariance term σ st ij .This negative covariance between edge/node visit along the path and path cost is a new network eccentricity measure, similar to a signed betweenness measure.Interestingly, this measure can be interpreted as the endured expected detour (in terms of cost) when constraining the walk to pass through the edge or the node.A somewhat surprising result is the fact that the sensitivity of the expected cost with respect to the local edge cost is simply a linear combination of two terms, the edge betweenness (the expected number of traversals through the edge) and the just mentioned negative covariance.
The sensitivity analysis derivations presented in this work can provide insights in different applications of RSPs, such as movement modelling on networks, where the results can help in pinpointing critical and vital parts of a network when modelling movement on the network.In addition, this work can also be of use when applying the RSP framework in semi-supervised classification of network nodes (Kivimáki et al 2014, Lebichot et al 2014, Françoisse et al 2017).On the one hand, the sensitivity analyses can help, e.g. in detecting nodes or parts of a network that lie on boundaries of clusters or are outliers.Furthermore, the negative covariance term, σ st ij , introduced in this work in section 3 could also be harnessed directly for betweenness-based classification of graph nodes in the spirit of (Lebichot et al 2014), as well as for other applications of graph node centrality.
Spatial conservation prioritization (SCP) addresses the optimal allocation of resources for biodiversity conservation; in the context of land use planing this requires the identification of areas that contribute most to the conservation objective (Moilanen et al 2009).Current SCP approaches accounting for connectivity focus on the prioritization of habitat patches considering their connectedness (Pouzols and Moilanen 2014, Kukkala and Moilanen 2017, Jalkanen et al 2020, Muenzel et al 2023).SCP approaches accounting directly for corridors are using centrality metrics, such as betweenness and current flow (e.g.Hodgson et al 2016, Daigle et al 2020).One of our contributions is the demonstration of the relationship between betweenness and sensitivity to local perturbations in the RSP framework.While the betweenness is an important components of the sensitivity, other factors also come into play such as the negative covariance.
Land use changes affecting movement corridors are generally large perturbations, whereas this work focuses solely on sensitivity in terms of derivatives, and not in terms of node or edge removal, partly because the effect of edge or node removal is computationally less tractable than the computation of derivatives.The effect of node removal on measures derived from the bag-of-paths model (which is closely related to the RSP model) was investigates by, e.g.(Lebichot and Saerens 2018) (see also the references therein) based on an approximation avoiding the computational pitfall.However, adopting a similar strategy in the context of this paper did not provide fruitful results.Thus, we leave the investigation of computing the effect of node removal for future work.Approaches in landscape ecology for the effect of removal or addition of a habitat patch to the connectivity of a landscape graph was studied in terms of the metapopulation capacity in Ovaskainen (2003), and in terms of the probability of connectivity index in Saura and Rubio (2010).However, these approaches focus on habitat patches and do not address the movement corridors between these patches, and using a 'brute force' approach through iteratively removing nodes (or edges) becomes quickly unfeasible for corridors on large networks.
This work focuses on the movement corridors between a single source-target pair.Previous applications of sensitivity analysis in landscape ecology are, within a metapopulation context, addressing sensitivity of topological measures characterizing the network as a whole.Ovaskainen and Hanski (2003) investigate the sensitivity of the metapopulation capacity w.r.t.perturbations of patches, whereas (Saura and Rubio 2010) studied the criticality of the 'probability of connectivity' w.r.t. the patches.Both metrics characterize the whole network through, respectively, eigenanalysis or summation.Future work will extend the current sensitivity analysis for a single s-t pair to such topological measures, for instance the sum of the expected costs between all pairs of node in the network (see also Van Moorter et al 2023).
The use of sensitivity analysis for prioritization of areas for conservation or restoration of movement corridors holds great potential for enhancing migration routes, as we demonstrated using wild reindeer migration between their wintering and calving areas.This demonstration is a highly relevant one, as migration corridors are threatened globally (Berger 2004, Wilcove and Wikelski 2008, Harris et al 2009).However, as species have already begun shifting their distributions in response to changing climate (e.g.Chen et al 2011), movement corridors are also important for climate adaption to allow such range shifts and movements to occur (Nuñex et al 2013, Alagador et al 2016, McGuire et al 2016).The identification of priority areas for conservation and restoration of movement corridors is therefore also crucial for climate adaptation and mitigation of its effects on biodiversity loss.

Summary
This work investigated how local perturbations in a network influence proximity and distance measures derived from the RSP model.Through sensitivity analysis, the study develops computable expressions for derivatives concerning edge or node weights.The formulation of this derivative was dependent upon the specific RSP-based measure.Interestingly, the sensitivity of expected cost incorporates a negative covariance term, representing a novel network eccentricity measure analogous to signed betweenness.We found that the derived sensitivity analysis provides valuable insights to guide spatial conservation prioritization of movement corridors for biodiversity.Moreover, the derived computational methods contribute fundamental features to the RSP framework, with applications across diverse disciplines, from ecology to machine learning.

Figure 1 .
Figure 1.The demonstration of the sensitivity analysis of one of the last remaining migration corridors of wild reindeer in Southern-Norway (panel (A)).Panel (C) on the right shows the permeability surface (from low in black to high permeability in white) with superimposed: winter range (in blue), calving range (in green), migration trajectories of eight marked individuals (in red), and the road separating both ranges (in orange) -see Panzacchi et al (2016) for a detailed description of these data.The source and target for the migration corridor in the center of respectively the winter and calving range are marked with a * .Panel (B) shows the topographic map of the central area of the migration corridor crossing county road 450.

Figure 2 .
Figure 2. Metrics related to the sensitivity analysis of the migration corridor between the winter and calving range for a population of wild reindeer for different values of β, the inverse temperature parameter of the RSPs.The source and target for the migration corridor are marked with a * .The columns represent different values of β ∈ [1.0, 0.002466, 0.0001], along the continuum from near optimal (1.0) to near random (0.0001), with the value best fitting the GPS data as an intermediate value (Kivimáki et al 2020).The top row is the betweenness of node i for s-t ( ∑ j ∈Succ(i) n st ij ), the second row is the negative covariance of node i ( ∑ j ∈Succ(i) σ st ij ), the third row is the sensitivity of the expected cost (cst) w.r.t. the costs of node i, and the fourth row w.r.t. the affinities of node i (a ij with j ∈ Succ(i)).The betweenness values are positive (n st i ⩾ 0), whereas the other values (in rows 2 to 4) can be both positive or negative.See figure1for the context of these maps and the main text for further discussion.

Figure 3 .
Figure 3. Sensitivity analysis of the migration corridor between the winter and calving range for a population of wild reindeer zoomed to the area around county road 450 (see also figure1) for the maximum likelihood value of β (i.e.0.002466) from Kivimáki et al (2020).We show the topographical map on the top (panel 1), the permeability (panel 2), the sensitivity w.r.t.independent costs (panel 3), w.r.t.independent affinities (panel 4), w.r.t.affinities that are functionally linked to costs (panel 5).We highlight the area around the road with an ellipse where increasing affinities would result in the largest drops in the expected cost to move from the winter range (source) to the summer range (target), and could be prioritized for conservation actions.
(Fletcher et al 2019, Marx et al 2020) node i.In other words, the edge affinities define what is considered random movement on the network.The edge costs, c ij , on the other hand define what is considered optimal movement, for instance, in terms of the energy consumption, geographical distance, time duration, monetary value, or other form of expense related to the step over an edge.Interestingly, these edge costs can be used to model mortality as demonstrated with spatial absorbing Markov chains used for dispersal modeling in movement ecology(Fletcher et al 2019, Marx et al 2020), which is closely related to the RSP framework (Van Moorter et al 2021).