Extending isolation by resistance to predict genetic connectivity

Genetic connectivity lies at the heart of evolutionary theory, and landscape genetics has rapidly advanced to understand how gene flow can be impacted by the environment. Isolation by landscape resistance, often inferred through the use of circuit theory, is increasingly identified as being critical for predicting genetic connectivity across complex landscapes. Yet landscape impediments to migration can arise from fundamentally different processes, such as landscape gradients causing directional migration and mortality during migration, which can be challenging to address. Spatial absorbing Markov chains (SAMC) have been introduced to understand and predict these (and other) processes affecting connectivity in ecological settings, but the relationship of this framework to landscape genetics remains unclear. Here, we relate the SAMC to population genetics theory, provide simulations to interpret the extent to which the SAMC can predict genetic metrics and demonstrate how the SAMC can be applied to genomic data using an example with an endangered species, the Panama City crayfish Procambarus econfinae, where directional migration is hypothesized to occur. The use of the SAMC for landscape genetics can be justified based on similar grounds to using circuit theory, as we show how circuit theory is a special case of this framework. The SAMC can extend circuit‐theoretic connectivity modelling by quantifying both directional resistance to migration and acknowledging the difference between migration mortality and resistance to migration. Our empirical example highlights that the SAMC better predicts population structure than circuit theory and least‐cost analysis by acknowledging asymmetric environmental gradients (i.e. slope) and migration mortality in this species. These results provide a foundation for applying the SAMC to landscape genetics. This framework extends isolation‐by‐resistance modelling to account for some common processes that can impact gene flow, which can improve predicting genetic connectivity across complex landscapes.


| INTRODUC TI ON
Understanding connectivity is essential for ecology, evolution and conservation (Hanski, 1999;Slatkin, 1993). Over the past two decades, there has been a tremendous interest in interpreting the role of connectivity in population genetics and genomics. Landscape genetics has emerged as a key subdiscipline that addresses a wide range of problems, focusing on how landscapes influence microevolutionary processes and patterns such as gene flow and genetic structure (Balkenhol et al., 2016;Manel et al., 2003).
Landscape genetics has extended isolation-by-distance (IBD) relationships (e.g. Wright, 1943) to incorporate how landscape structure can alter gene flow and genetic connectivity. For instance, 'isolation-by-environment' (IBE) relationships capture genetic variation that may be explained by environmental differences between sites (Wang & Bradburd, 2014). Similarly, 'isolation-by-resistance' (IBR) captures how the landscape can alter migration and genetic connectivity, which is commonly quantified through the use of circuit theory (McRae, 2006). The rationale is that aspects of the matrix (e.g. land use, topography) can alter movement routes across landscapes, what has been termed 'landscape resistance' (Zeller et al., 2012), leading to landscape effects on gene flow (Spear et al., 2010). Yet such resistance can emerge from multiple processes, such as migration avoidance or preference of landscape features leading to asymmetric migration, cumulative costs of transport over space from mortality risk and related costs or selection against maladapted dispersers (Wang & Bradburd, 2014).
A recently introduced framework advanced random walk theory with absorbing Markov chains to better capture different processes influencing connectivity (Fletcher et al., 2019). This framework, termed the 'spatial absorbing Markov chain' (SAMC), honours the idea that resistance can influence both movement behaviour and mortality risk, or more broadly the termination of movement. The SAMC is an analytical framework like least-cost analysis (Etherington, 2016), randomized shortest paths (Saerens et al., 2009) and circuit theory (McRae et al., 2008), all of which assume that variation in landscape features influences the movement process. Overall, the SAMC is most similar to circuit theory in that both are rooted in Markov chain theory and depend on local-scale landscape information (in contrast to least-cost analysis and randomized shortest paths that assume that movement involves broad-scale information of the landscape). While similar, the SAMC moves beyond circuit theory and other frameworks in ecology by providing short-and long-term predictions and by providing a means to account for time-specific movement, directional movement, species distribution and mortality. Despite the potential value of this framework for connectivity based on individual movement (Fletcher et al., 2019), it remains unclear if and how this framework is relevant to landscape genetics.
We extend the SAMC framework to the problem of genetic differentiation and gene flow. First, we provide a brief overview of the SAMC framework. Second, we discuss the relationship of the SAMC with population genetics theory using a common metric of genetic differentiation, F ST . Third, we demonstrate that circuit theory is a special case of the SAMC such that they are identical on simplified population networks. Yet the SAMC is flexible enough to provide predictions that potentially account for directed migration (Lundgren & Ralph, 2019) and migration mortality (Nagylaki, 2015) in population differentiation. Finally, we illustrate the application of this framework with genomics data from an endemic and rare species, the Panama City crayfish Procambarus econfinae, which has been hypothesized to have undergone directed migration . Not only do these extensions provide a formal linkage of this framework to landscape genetics but these extensions also provide a means to potentially capture some key processes affecting the spatial distribution of genetic variability (Lundgren & Ralph, 2019;Wang & Bradburd, 2014), which may facilitate predicting genetic connectivity across landscapes.

| The spatial absorbing Markov chain
The SAMC models connectivity based on extensions of discretetime absorbing Markov chain theory. This framework is applied by assuming that landscapes are discrete representations of the environment, which can be represented using raster maps or in a network context where populations or demes are vertices (or nodes) on a spatial graph (Acevedo et al., 2015;Fletcher et al., 2019;Sefair et al., 2017). We introduce this model in the context of dispersal (Fletcher et al., 2019) and subsequently illustrate how parameters relate to genetic differentiation. For each time step during which an organism disperses across a complex landscape, it can either survive and stay at the same location (i.e. site fidelity), survive and move to a nearby site or die. The SAMC framework honours this idea by considering 'transient' states that capture fidelity and movement, and an 'absorbing' state that captures mortality. In the context of some common processes that can impact gene flow, which can improve predicting genetic connectivity across complex landscapes.

K E Y W O R D S
circuit theory, gene flow, landscape genetics, Markov chains, movement genetic differentiation, movement and fidelity capture the potential for migration (or not), whereas absorption can reflect two different processes, mortality during migration (Nagylaki, 2015) or the probability of coalescence (Hey, 1991), depending on how the model is applied. We discuss each in detail below.
The SAMC framework captures transient and absorption states through the construction of a probability matrix, P (Figure 1; throughout we use bold capital letters to denote matrices, bold lowercase letters to denote vectors and non-bold letters to denote scalars). For a landscape divided into C cells or patches, P can be written as: where Q is a sparse, C × C transition matrix reflecting transitions between transient states, R is a C × r matrix containing transition probabilities from the transient states to r absorbing states and 0 is a 1 × C vector of zeros. The elements p ij of P describe the probability of transitioning from state i to j in one time step, such as the probability of migration between state i and j in one generation.
A variety of connectivity-related metrics can be quantified using P.
Here, we extend this framework to address gene flow and genetic differentiation.

| Relating the SAMC to genetic differentiation
To interpret the relationship of the SAMC to genetic differentiation, we use a similar approach as in McRae (2006). We first review the relationship of coalescence times to F ST for stepping stone models and how coalescence times can be generally captured using absorbing Markov chain theory based on random-walk times. Based on these relationships, we then discuss the connection of the SAMC to F ST values and coalescence times.
2.2.1 | F ST , coalescence times and Markov chains Slatkin (1991Slatkin ( , 1993 derived relationships between coalescence times, or the amount time in the past that two or more genes first had a common ancestor, and F ST under a variety of scenarios. These derivations were motivated by the need to simplify the analysis of population genetic models, make inferences on population genetic parameters and derive general results for gene flow in subdivided populations (Slatkin, 1991). For a stepping stone model, Slatkin (1991Slatkin ( , 1993 determined that F ST can be calculated using coalescence times between pairs of genes sampled within and among demes as: (1) The spatial absorbing Markov chain applied to landscape genetics. (a) This framework takes information from a population network, as described as a spatial graph or raster grid, to create a probability matrix P that includes information on migration and absorption. (b) Both symmetric (balanced) and directed (anisotropic) migration m between demes can be captured. Note that even in the case of balanced pairwise migration, actual migration rates in each direction may differ due to variation in the number of links (e.g. the number of adjacent links for deme i and j is the same but differs with deme k). (c) For population or landscape genetic data, absorption can reflect the probability of coalescence or migration mortality. For instance, we show the current state of two alleles (blue, orange) in the network and the location of coalescence occurring four steps (arrows) backward in time. For migration mortality, dashed lines represent a scenario where a barrier is driven by mortality (i.e. migration is attempted across the barrier but mortality occurs). where t 0 is the average coalescence time of two genes sampled from the same deme and t 1 is the average coalescence time when two genes are sampled from different demes (Table 1; terms in Table 1 are italicized at first mention). Typically, t 0 = 2N, where N is the effective population size summed across all demes (Slatkin, 1991). The average coalescence times of two genes from different demes include the time to coalescence given the genes are in the same deme (t 0 ) plus the time for the two genes to first be present in the same deme, t ′ 1

Migration
, such that Absorbing Markov chain theory can be used to calculate coalescence times and derive F ST by applying this theory backward in time (Hey, 1991;McRae, 2006 Slatkin's (1991) propositions regarding t 1 in the context of circuit theory and landscape resistance. A well-known quantity in circuit theory related to landscape resistance is the expected commute time, t c , which is the sum of hitting (or first passage) times going from i to j and back again ( j to i ), on an ergodic chain network (Chandra et al., 1997). When considering isotropic migration (i.e. migration pattern is identical between all demes) and demes (3) t = I − Q s −1 1,

Term Symbol Description
Coalescence time t 0 The average time for two genes sampled from the same deme to coalesce t 1 The average time for two genes that are sampled from different demes to coalesce The time for the two alleles from different demes to first be present in the same deme Absorption time t a The mean time to move i to j and absorb into j. Related to t 0 and t 1 on isotropic graphs Absorption index A I An index of differentiation describing the proportion of total time prior to absorption that is driven by between-population movements Net visitation rate v kl Expect net movement probabilities between k and l when moving through demes. Analogous to current density or flow TA B L E 1 Terms and metrics described and evaluated for interpreting genetic connectivity of equal sizes, McRae (2006) showed that t � 1 = t c 4 . Commute time is divided by four because it describes the time of moving to a deme and back again and acknowledges that it takes half the time for alleles to meet because two alleles are moving (Lundgren & Ralph, 2019). McRae (2006) then used simulations to illustrate that commute time could also predict F ST on non-isotropic deme networks with balanced migration (m ij = m ji ).
In the context of the SAMC, the commute time between deme i and j on an isotropic graph as calculated with circuit theory is precisely twice the hitting time, t h , of a spatial absorbing Markov chain when starting at i and the only absorbing state is j (Table 1). In this In a similar way, current flow is often used in mapping based on circuit theory (  (Hanks, 2017). In contrast, the SAMC can decompose commute time into movement rates in each direction, thereby allowing consideration of directed flows that can arise on non-isotropic graphs, both when migration is balanced (Table S2) and when it is directed or 'anisotropic' (m ij ≠ m ji ; see below).
More generally, the SAMC can explicitly include absorbing states related to the coalescence process using a similar rationale as Hey (1991) regarding N altering the probability of coalescence.
The difference lies in that Hey (1991) explicitly tracks two alleles thereby providing a means to quantify coalescence, whereas the SAMC implicitly tracks only one allele (similar arguments apply using circuit theory above). Consequently, the SAMC cannot explicitly quantify coalescence, but it can partially encapsulate the process via absorbing states. The benefit is that using the SAMC allows the transition matrix to be much smaller (and sparser) than that described in Hey (1991), which eases computation considerably for large landscapes.
For isotropic migration, we provide a metric to approximate average coalescence times, t 1 and t 0 , by creating an absorbing state in a similar way as above for relationships with commute time, but here R is populated where the only absorbing state is j, defined as: This formulation uses a similar rationale as Hey (1991) in terms of the potential for coalescence transitioning from i and j (cf. Equation S3).
For the elements q ij of Q, we account for nonabsorption (cf. Equation S1) as: We can then calculate absorption time as: Repeating across all demes creates an absorption-time matrix T a (we use the term 'absorption time' as it acknowledges the time to both arrive and absorb). The diagonal elements of T a represent the time it takes to absorb in j when starting in j, and are related to t 0 on an isotropic graph. The off-diagonal elements represent the time it takes to go to j when starting from i plus the time to absorb once reaching j , such that this time is related to t 1 . The conditional mean first passage time (Table 1; De Sanctis & de Koning, 2018) can be calculated to directly approximate t ′ 1 between transient states (Equations S7-S10). This metric generalizes the hitting time metric to allow for the potential for more than one possible absorbing state. We sum this metric in both directions to provide a distancebased metric analogous to commute time for demes i and j, what we refer to as the conditional commute time (Table 1; Equation S11).
Finally, we provide an absorption index, A I (Table 1) (Table S3). Below, we use simulations to interpret the generality of these relationships to non-isotropic graphs.

| Migration mortality and the SAMC
The problem of mortality during migration is often raised in landscape genetics (e.g. Spear et al., 2010). Yet in population differentiation models, mortality during migration is frequently neglected (but see Nagylaki, 2015). Here, we show how the SAMC can account for this problem.
The SAMC was initially motivated to capture the potential for movement mortality arising when individuals disperse across landscapes (Fletcher et al., 2019). Consider a forward transition matrix as described in Section 2.1 with n d demes and an absorbing state indicating mortality. Let m ij be the probability of attempting migration from deme i to j forward in time, and a ij be the probability of surviving the event. The probability of successful migration from population i in time t to j in time t + 1 is thus m ij = a ijmij , where the cup symbol depicts successful migration forward in time. We assume that a ii = 1, as we only consider mortality to occur during migration. When a ij < 1, actual migration rates are smaller than attempted (6) t a = (I − Q) −1 1. migration rates (� m ij > � m ij ), leading to a reduction in total migration rate (1 −m ii ) (Nagylaki, 2015). The probability of dying when beginning in state i is the i -th entry of R: which is a weighted average of movement-specific mortality probabilities.
We now reverse the process, asking about the history of movement in the presence of migration mortality when going from time t to t − 1 into the past. We reverse the chain to create a backward, where the M is an n d × n d matrix with elements giving the conditional probabilities of moving between demes backward in time, R ′ is a n d dimensional row vector with jth element describing the transition probabilities of being in deme j one time step in the past, given the chain is in the absorbing state, and , which is the probability of staying in the absorbing state one time step into the past. We can then add an absorption state for coalescence and adjust as described in Equations 4 and 5. Consequently, gives the probabilities of prior states given the observed state under a defined forward process that includes migration mortality. can be compared to similar matrices that assume no migration mortality (a = 1) to interpret the effects of migration mortality on genetic connectivity (see Supporting Information S4).

| Simulations with variation in migration
We explore the utility of the SAMC for landscape genetics under three scenarios. First, we compare the SAMC to other common metrics in terms of their capacity to predict F ST calculated from population genetics theory for simple finite, non-isotropic networks with no migration mortality. Second, we evaluate the extent to which the SAMC can capture directed migration. Third, we interpret the utility of the SAMC when migration mortality occurs. For each scenario, we primarily focus on the average absorption times (i.e. the average of absorption times from i to j and j to i ), the absorption index and the conditional commute time, as these metrics are readily comparable to F ST and other distance-based metrics.
To assess the ability of the SAMC relative to other common metrics in capturing F ST , we consider two finite, non-isotropic networks use in McRae (2006) that have balanced migration (Figure 2). In these simulations, we compare expected values for F ST from population genetics theory (using Equations 2 and 3, Equation S1-S4; see also Hey, 1991) to predictions from the SAMC, geographic distance, least-cost distance and commute time (cf. McRae, 2006). We simulate migration under different effective population sizes (N = 10, 100, 1000) and backward migration rates (m = 0.001, 0.01, 0.1).
To assess the ability of the SAMC to capture directed migration, we consider four simple networks that highlight different types of potential directional migration: directional flow across a partial barrier, migratory routes, source-sink dynamics and a dendritic network (Figure 3). Directed migration is clearly more complex in nature than any of these scenarios, but these simple networks capture common processes that can lead to directional flow (Lundgren & Ralph, 2019). We vary migration in different directions in each network, with high migration rates (0.1) and low rates (0.01). We then contrast changes in F ST and coalescence times calculated from population genetics theory (Equations 2 and 3) to changes in SAMC metrics between each directed network and its non-directional equivalent (i.e. m ij = m ji based on the average migration rate between i and j).
To understand the effect of migration mortality on genetic differentiation, we contrast three scenarios based on the network in Figure 2a. In the baseline scenario, the partial barrier is removed, population size is constant (N = 10, 100 or 1000) and migration occurs across all demes at equal rates (either 0.01 or 0.001; Figure 4a).
In the second scenario, we alter the baseline such that the partial barrier is driven by migration mortality, not resistance to movement ( Figure 4b). In the third scenario, we alter the baseline rates to reflect that the partial barrier acts as resistance to movement but not mortality, such that the overall migration rate is equivalent to the baseline scenario ( Figure 4c). We then compare the change in F ST and conditional commute time between the baseline scenario and these two partial boundary scenarios. We also map differences in net visitation rates, which is analogous to mapping current flow in circuit theory (Table 1). All simulations were performed in R using the samc package version 1.4 (Marx et al., 2020).

| Application to genetic connectivity of an endangered crayfish
One potential application of SAMC is the identification of model parameters and landscape attributes that are most important for driving genetic structure, which can provide important information for management plans aimed at conserving genetic diversity of imperilled species. To illustrate this type of application of the SAMC, we focus on the imperilled Panama City crayfish (Procambarus econfinae; crayfish hereafter), which currently occupies approximately 28% of its historical range (USFWS, 2017). Suitable habitat for the species is composed of fragmented patches of flatwoods in the highly urbanized western portion of the range and managed plantations in the more contiguous eastern portion of the range . Genetic differentiation in this species has been hypothesized to be shaped by habitat fragmentation, roads, range expansion and coastal dynamics . Other crayfish species have directed dispersal along elevational gradients, with greater dispersal tendencies downslope than upslope (Bernardo et al., 2011). Consequently, we hypothesized that, along with land cover effects on resistance, both directed migration from elevational gradients and migration mortality from roads and urban areas could drive genetic differentiation in this species. To address this problem, we used linearized F ST estimates from 1640 neutral single nucleotide polymorphisms (SNPs)  to evaluate the connectivity of eight crayfish populations across its known distribution (Table S4, Figure S7). See Duncan et al. (2020) for more details on the species and genetic data and Figure S8 for the workflow used.
Because there were no prior empirical data on movement and gene flow in the Panama City crayfish, we undertook an expert assessment to derive potential resistance-based information for connectivity modelling. We used the Florida Cooperative Land Cover Map (FNAI, 2016), which was reclassified in an effort to delineate Difference between asymmetric and symmetric metric   Figure S7; see Supporting Information S6). We converted this reclassified map based on hypothesized resistance values from an expert opinion survey to create seven hypothesized resistance layers (60 m resolution; Figure S9). We also considered slope, derived from a digital elevation map (Figure S10a), as a directional resistance measure, based on the change in elevation between adjacent raster cells. We contrasted this directional measure to using an equivalent undirected metric of slope with circuit theory and least-cost distances (i.e. the average slope per raster cell; Figure S10b) using the gdistance package ( van Etten, 2017). To illustrate the problem of migration mortality, we hypothesized that developed land uses and major roadways could lead to migration mortality. For developed land and roadways, we fit models that altered values of migration mortality between 0.001 and 0.99, selecting the best-fit models based on log-likelihoods (see Supporting Information S6 for more).

F I G U R E 4
Migration mortality, resistance and the spatial absorbing Markov chain. (a) Three networks that vary in migration mortality and migration resistance near a barrier. Shown is a baseline network with balanced migration rates among demes. The migration mortality network has the same migration rates as the baseline, but migration mortality occurs at the partial barrier (cf. Figure 2a). The resistance/ redirection network has the same overall migration rates as the baseline, but migration is redirected away from the barrier. was estimated with SNP data using the LD method (Waples & Do, 2008) implemented in N E Estimator ver. 2 (Do et al., 2014). To calculate conditional commute time, we first calculated conditional first passage times using the samc package, which led to an asymmetric matrix of pairwise value of first passage times. We then summed these times in both directions (Equation S13) to generate a symmetric matrix of conditional commute times comparable to other distance-based metrics.
We used linear mixed-effects models using the maximumlikelihood population-effects parameterization (MLPE;Clarke et al., 2002) implemented with the resistanceGA package (Peterman, 2018) to separately model the effects of (the log of) Euclidean distance, least-cost distance, commute time, conditional commute time and an intercept-only model on linearized F ST . All explanatory variables were scaled (mean centered with a standard deviation of 1) before modelling. We compared models using loglikelihoods, Akaike's information criterion for small sample sizes (AICc) and marginal R 2 (Nakagawa & Schielzeth, 2013).

| Simulations with variation in migration
When comparing the ability of the SAMC metrics relative to other common metrics in predicting F ST , we found that conditional commute time, absorption time and commute time were perfectly correlated with each other on these non-isotropic networks and were highly correlated with F ST (Figure 2). For these metrics, correlations with F ST were lower with small population sizes and low migration rates (Table S6). In general, these metrics performed better than either Euclidean distance (r = 0.62 and 0.73 for the small and large networks) or least-cost distances (r = 0.95 and 0.78). Overall, the absorption index best explained F ST and was nearly perfectly correlated with F ST for all scenarios (r ≥ 0.98; Figure 2, Table S6).
Comparing networks with directed migration relative to identical networks with balanced migration (where m ij was set to the average of each direction) emphasized that the SAMC metrics were sensitive to differences in migration asymmetries ( Figure S3). However  Figure S4), suggesting that deviations of conditional commute time from F ST may be largely due to the within-deme coalescence process rather than migration. Indeed, for the dendritic network, variation was explained by t 0 and absorption time best explained this metric (r = 0.62). Overall, absorption time generally predicted t 0 (r = 0.60), but t 1 was less well predicted (r = 0.30). We note that both conditional commute time and F ST use directed migration information but summarize it in a non-directed manner (Equation S11).
When interpreting the effect of migration mortality relative to resistance to movement, we found that F ST tended to increase for both scenarios relative to the baseline, but the effect was slightly larger when migration mortality occurred (Figure 4b, TA B L E 2 Model comparison using the most supported scenarios for land use and land cover, slope and migration mortality for explaining linearized F ST in the IUCN endangered Panama City crayfish. Note that for slope, commute time from circuit theory is based on a symmetric value, whereas conditional commute time and least-cost distance are calculated using both asymmetric and symmetric measures. 'Mortality' refers to migration mortality based on developed lands Figure S5). This was explained by slightly longer conditional commute times when mortality occurred than when redirection occurred (Figure 4c, Figure S6). In general, conditional commute times and absorption times accurately predicted F ST under all three scenarios (r > 0.91), as could the absorption index (r > 0.99).
Incorporation of migration mortality altered the expected net visitation rates across the network (Figure 4d). Thus, incorporating migration mortality can alter expectations for spatial migration patterns across landscapes even when the movement component of migration is undirected.

| Application with connectivity of an endangered crayfish
There was support for both asymmetric metrics of resistance and the effect of mortality during migration for explaining F ST in the Panama City crayfish (Table 2). Resistance based on land cover had slightly more support than Euclidean distance alone (Table 2), yet the most supported land cover resistance was a simple constant resistance ( Figure S8). However, incorporating directionality using a slope-based resistance with the SAMC provided a better fit to linearized F ST than did the land cover resistance metric (Table 2, Figure S11). Interestingly, incorporating slope without capturing the potential for asymmetric flow (i.e. using average slope values) when using circuit theory, least-cost distance or the SAMC was less supported than when allowing this covariate to be directional.
There was no support for roads potentially impacting migration mortality ( Figure S12), yet there was some weak evidence that developed lands affected migration mortality (Table 2, Figure S12).
However, differences in conditional commute times under the assumption of no migration mortality or migration mortality on developed lands were small ( Figure S13). Based on this asymmetric resistance classification of slope, conditional commute time best fit the data, capturing nearly all of the model weight (Table 2). This model explained 2.4× the variation (R 2 m = 0.75; Figure 5a) as circuit theory (R 2 m = 0.31) and 1.7× the variation as least-cost distances (R 2 m = 0.44; Figure S14). Notably, the conditional first passage times from this asymmetric model varied considerably with direction ( Figure 5b). We map a directional measure of connectivity based on conditional first passage time, focusing on expected connectivity along the longitudinal gradient (east-west; Figure 5c,d).
The mapping suggested that expected connectivity is greater from west to east than vice versa.

| DISCUSS ION
We provide a framework for predicting genetic connectivity across landscapes and illustrate its relationships with coalescence times and population differentiation as interpreted through F ST . This framework extends concepts from circuit theory to understand the movement of genes and the potential for absorption to alter connectivity across landscapes. Our framework is grounded in Markov chain theory and attempts to capture some key processes relevant for understanding genetic connectivity.

| Coalescence and absorbing Markov chains
We demonstrated that when applying the SAMC to population differentiation, absorption in the SAMC can be related to the probability of coalescence. Absorbing Markov chain models have been previously used address coalescence, where states are the locations (deme) of two randomly sampled genes (Hey, 1991). This structure has n s = n d n d + 1 ∕ 2 states, such that the probability matrix used has dimensions n s × n s . In contrast, implementation of the SAMC formulation has matrix dimensions are n d × n d . This has some practical computational benefits for problems that span large landscapes: a scenario with 100 demes would require a matrix of dimensions 4950 × 4950 for the former and 100 × 100 for the SAMC. This computational benefit similarly arises with the use of circuit theory.
Furthermore, as the SAMC captures more of the coalescence process of Hey (1991) than circuit theory, on graphs with isotropic migration, it provides essentially identical results to population genetics theory (Table S3).

| Migration mortality
Migration mortality can be captured in the SAMC by interpreting migration mortality forward in time and then reversing the matrix to analyse population differentiation. Nagylaki (2015) considered the problem of how migration mortality affects spatial genetic variation and considered its effects in simple landscapes (e.g. circular islands). He found that acknowledging mortality did not change migration patterns in the landscapes he considered, but it did decrease migration rates, reduce heterozygosity and increase genetic diversity and differentiation. The SAMC framework allows for considering mortality in more complex landscapes. Our comparison of migration mortality and migration resistance illustrates that connectivity between demes can vary based on these different mechanisms (Figure 4), with migration mortality leading to greater genetic isolation than migration resistance and changes in expected gene flow (Figure 4d). Our framework allows for flexible implementation to consider scenarios where there is no assumed mortality or where high mortality risks are expected to occur (e.g. along highways). Such comparisons could inform potential management actions for maintaining genetic connectivity in the face of potential risks. In many practical settings, inferring the relative contribution of migration mortality and landscape resistance to movement to observed genetic connectivity may be difficult because each has a similar functional effect on genetic relatedness. If data are available on mortality risks (e.g. mortality estimates near roads), then such information could address this issue to better understand the drivers of genetic connectivity. Finally, we note that impassable landscape barriers that arise from fidelity rather than mortality can also be accommodated in the SAMC (and are implemented in the samc package via a fidelity map; see Marx et al., 2020).

| Application to crayfish connectivity
Our application to the endemic crayfish demonstrates the potential usefulness of the SAMC as a new landscape genetics method.
In the crayfish analyses, the SAMC better explained genetic distance (F ST ) than did other common connectivity methods used in   (Gherardi et al., 2000) such that presumably less vehicle activity across roads at night during nocturnal movements may help explain this lack of effect. The SAMC additionally allowed us to decompose the directionality of potential gene flow across the landscape, which we would not have been able to do with circuit theory. Because the east portion of the crayfish range is less developed, we expected that there would be more relatively successful movement forward in time from east to west and thus relatively more connectivity going from west to east backward in time.
Mapping connectivity based on SAMC confirmed these expectations: Conditional first passage time was estimated to be generally shorter backward in time when moving from west to east than vice versa (Figure 5c,d). These results are also consistent with prior analyses that indicate eastern locations with lower genetic differentiation and higher genetic diversity are experiencing less fragmentation .
We found no strong evidence for land cover explaining genetic differentiation using resistance values based on expert opinion.
Expert opinion has known limitations (Spear et al., 2010), but we used it in this example due to the very limited data on this endangered species. Furthermore, in our example, there were relatively few populations for estimating genetic differentiation, which limits the power of the analysis for detecting land cover effects.
Resistance optimization techniques (e.g. Peterman, 2018;Peterman & Pope, 2021) could be extended to optimize resistance surfaces for the SAMC framework, both for land cover resistance and also for identifying effects of migration mortality.

| The niche for the SAMC in landscape genetics
Our framework can be readily applied to problems in landscape genetics for predicting how landscapes may influence population genetic differentiation quantified via F ST or related metrics (see Balkenhol et al., 2016). It extends isolation-by-resistance from circuit theory to help elucidate how genetic connectivity may be impeded, such as through directional barriers that alter movement directions or anthropogenic mortality that may limit gene flow. Lundgren and Ralph (2019) also show how coalescence times can be directly modelled as an alternative to circuit theory, finding that coalescent times may be more reliable than circuit theory under directed migration.
Other key developments on directed migration include advances in autoregressive and related models that can be applied to genetics data and can account for directional migration patterns (Hanks, 2017;Marcus et al., 2021;Peterson et al., 2019). Our model provides complementary insights by illustrating how circuit-theoretic ideas can be directly extended with Markov chains in a way that can acknowledge asymmetric resistance and migration mortality.
We provided several metrics for interpreting genetic connectivity (Table 1). For the empirical example, we focused on conditional commute time, which emphasizes only between-patch processes, rather than absorption times, which blend internal population dynamics with between-population movement across landscapes.
While it could be valuable to address absorption times to capture within-patch processes (Pfluger & Balkenhol, 2014), more development is needed to scale these dynamics appropriately to raster grids. Conditional commute time summarizes conditional first passage time in both directions (from deme i to j and j to i), and it is more comparable to F ST and other connectivity metrics that are not explicitly directional. However, conditional first passage time can be interpreted separately in each direction, providing flexibility for interpreting the genetic consequences of directional migration. We have updated the samc package (Marx et al., 2020) to include the conditional first passage times described here (v1.4.0 or later). We also updated the package for analysis of discrete networks such as those considered here (rather than only raster grids) and allow for scenarios where some locations in the landscape have zero absorption probabilities (e.g. to acknowledge that coalescence may occur only where populations reside).
Landscape genetics increasingly focuses on genetic relationships among individuals rather than populations to interpret problems of connectivity (Balkenhol et al., 2016;Cros et al., 2020). Given that some genetic differentiation concepts among individuals can be cast similarly to differentiation among populations (Rousset, 2000), we expect that the results we have provided apply to such cases.
As the SAMC was derived initially at the individual level (Fletcher et al., 2019), its applications to individual-level relationships may be more straightforward than to population-level relationships considered here. For instance, when applying the SAMC at the individual level, we note that migration probabilities used here have similar interpretation, such that the primary difference is in the interpretation of absorption. Some metrics, such as conditional commute time as implemented here, are not sensitive to absorption values based on population size as setting absorption to one for individual-level analyses rather than scaling it to effective population size would result in similar variation in conditional commute time. However, more research is needed to explore these relationships fully. For relatedness, we would alter the expectation of absorption, where relatedness is expected to vary with the inverse (effective) population size (Shirk et al., 2017).

| CON CLUS IONS
The spatial absorbing Markov chain framework we have presented extends the analysis of isolation by resistance. Circuit theory has seen widespread use to interpret isolation by resistance and movement across landscapes in ecology and evolution and can successfully predict gene flow in some situations (Dickson et al., 2019;Fletcher et al., 2016). Yet circuit theory has known limitations for capturing key processes that may affect gene flow (Lundgren & Ralph, 2019;Wang & Bradburd, 2014). Our results provide a foundation for applying spatial absorbing Markov chains to population genetic data. Future landscape genetic studies considering circuit theory can extend applications using the SAMC to address directed migration, migration mortality and the potential effects of withinpatch processes for predicting genetic connectivity across complex landscapes. Fletcher led the writing of the manuscript. All authors contributed critically to the drafts and gave final approval for publication. Davis, A. Warren) and Faith Bell. We are grateful to C. Pylant and C.

ACK N OWLED G EM ENTS
Carneiro for their assistance with lab work.

CO N FLI C T O F I NTE R E S T
The authors declare that there is no conflict of interest.

PEER R E V I E W
The peer review history for this article is available at https://publo ns.com/publo n/10.1111/2041-210X.13975.

DATA AVA I L A B I L I T Y S TAT E M E N T
The primary genotype and sample data are deposited in Dryad Digital Repository https://doi.org/10.5061/dryad.n02v6 wwss