## Appendix EFinding the Shortest and the Fastest Paths

There are many paths to the top of the mountain,
but the view is always the same.
Chinese proverb

Techniques for finding the shortest and the fastest pathways can

be useful during sampling for pathways, in post-processing and

analysis of DPS databases, and in various optimisations of pathway

ensembles

[

8

,

10

,

192

,

290

,

291

]. Given a digraph representation of a

connected database of minima and transition states it is possible to identify

the shortest path between any two minima using a breadth-first search

algorithm

[

154

], which runs in linear time. The shortest path, however, is not

necessarily the fastest. Recently Evans suggested using Dijkstras

algorithm

[

153

] for finding the path with the largest non-recrossing DPS

rate

[

290

]. It was pointed out by Carr, however, that the weight

function used in Reference

[

290

] is not positively defined, and the use of

the Bellman-Ford-Moore (BFM) algorithm

[

292

294

] was suggested

[

291

]. Because Dijkstras algorithm scales better than BFM

algorithm (see Figure

E.1

) we describe below a weight function that

enables us to use the Dijkstras algorithm for finding the fastest

path.

As detailed in Section 4.1.1, within a digraph representation of a coarse-grained PES each minimum is represented by a single node and each transition state is represented by two oppositely directed edges. Here we ignore degenerate rearrangements since they do not affect the rates, and for cases where more than one transition state links the same pair of minima only the one with the fastest forward and backward rates is used. Adopting the non-recrossing DPS rate definition from Equation 4.11 we can associate forward and backward rate constants

 $\begin{array}{ccc}{k}_{a,b}\hfill & =\hfill & \frac{{P}_{b}^{\mathit{eq}}}{{P}_{B}^{\mathit{eq}}}\frac{{k}_{a,{i}_{1}}\phantom{\rule{0.3em}{0ex}}{k}_{{i}_{1},{i}_{2}}\cdots {k}_{{i}_{n},b}}{\sum _{{\gamma }_{1}}{k}_{{\gamma }_{1},{i}_{1}}\phantom{\rule{0.3em}{0ex}}\sum _{{\gamma }_{2}}{k}_{{\gamma }_{2},{i}_{2}}\cdots \sum _{{\gamma }_{n}}{k}_{{\gamma }_{n},{i}_{n}}},\hfill \\ \hfill \\ \hfill \\ {k}_{b,a}\hfill & =\hfill & \frac{{P}_{a}^{\mathit{eq}}}{{P}_{A}^{\mathit{eq}}}\frac{{k}_{b,{i}_{1}}\phantom{\rule{0.3em}{0ex}}{k}_{{i}_{1},{i}_{2}}\cdots {k}_{{i}_{n},a}}{\sum _{{\gamma }_{1}}{k}_{{\gamma }_{1},{i}_{1}}\phantom{\rule{0.3em}{0ex}}\sum _{{\gamma }_{2}}{k}_{{\gamma }_{2},{i}_{2}}\cdots \sum _{{\gamma }_{n}}{k}_{{\gamma }_{n},{i}_{n}}}\hfill \end{array}$ (E.1)

with a pathway $\xi =a,{i}_{1},{i}_{2},\dots ,{i}_{n},b$.

For a detailed description of Dijkstra and BFM algorithms we refer the reader to Reference [154]. A suitable choice of edge weight function to be used with either of the shortest path algorithms must be made. We define the weight of each directed edge $\alpha \to \beta$ as

 (E.2)

Note that $w\left(\beta ,\alpha \right)\ne w\left(\alpha ,\beta \right)$ and $0\le w<\infty$. Since the weight is non-negative it is possible to apply Dijkstras algorithm to find the fastest pathway [154].

It makes sense to include only minima with more than one connection when searching for the fastest pathway. In our calculations we first iteratively identified a connected subset of minima with the number of connections greater than one, and then run the above algorithm for this subset.

To find the fastest path connecting minima $a$ and $b$ in the direction $b\to a$ it is necessary to solve either a single-source shortest paths problem with minimum $b$ chosen as a source, or a single destination shortest paths problem with minimum $a$ chosen as the destination. In the latter case all the edges in the graph need to be reversed, which can be accomplished by simply swapping the arguments to the weight function in Equation E.2. This reversal is possible because our graph is a symmetric digraph, i.eif there is an edge $a\to b$ then there is also an edge $b\to a$.

A useful check for correct implementation of this algorithm is to verify that the weight of the shortest path from minimum $b$ to minimum $a$, $W\left(a,b\right)$, is related to the rate ${k}_{a,b}$ calculated for that pathway by

 (E.3)

The BFM algorithm runs in $\mathsc{𝒪}\left(|V|\phantom{\rule{0.3em}{0ex}}|E|\right)$ time while Dijkstras algorithm as described in Reference [153] scales as $\mathsc{𝒪}\left(|V{|}^{2}+|E|\right)=\mathsc{𝒪}\left(|V{|}^{2}\right)$ [154]. Although both algorithms appear to have similar (quadratic) asymptotic complexity for the case of sparse graphs (e.g$|E|=\mathsc{𝒪}\left(|V|\right)$) the scaling prefactor is smaller for Dijkstras algorithm. In addition, for sparse graphs with $|E|=o\left(|V{|}^{2}∕\mathrm{lg}|V|\right)$ an implementation of Dijkstras algorithm that utilises a priority queue of some sort can improve the asymptotic bounds further. Priority queues based on binary min-heap and Fibonacci heap [276] result in $\mathsc{𝒪}\left(\left(|E|+|V|\right)\mathrm{lg}|V|\right)=\mathsc{𝒪}\left(|E|\mathrm{lg}|V|\right)$ and $\mathsc{𝒪}\left(|V|\mathrm{lg}|V|+|E|\right)$ scaling of the algorithm, respectively [154]. In the present work we have used a priority queue based on Fibonacci heap. A performance comparison of our implementations of BFM and static Dijkstras algorithms is shown in Figure E.1.

Since knowledge of all the pathways on a complicated PES is out of the question a representative sample must be obtained to properly describe the property of interest. It is unclear what is the best strategy of evolving the pathway database if the proper description of kinetics is sought, as sampling techniques may introduce a bias towards pathways of particular type.

In previous DPS studies a set of perturbations was applied to the fastest known path to generate new ones [810]. New pathways were constructed from a subset of stationary points featured in the pathway being perturbed, and from these that were found as a result of perturbation. Because building the shortest paths tree with Dijkstras algorithm is relatively cheap it is possible to analyse the whole database for the presence of new faster pathways rather than just the subset. Results for an example application are presented in Figure E.2.

After a set of perturbations was applied to the fastest currently known pathway $a←b$ Dijkstras algorithm was used to solve the single-source shortest paths problem to build the shortest paths tree rooted at minimum $b$. For path $\xi$ the set of perturbations constituted $l\left(\xi \right)-\Delta +1$ attempts to shortcut the path, where $\Delta$ is a shortcut parameter, $\Delta \in \left\{1,2,\dots ,l\left(\xi \right)\right\}$.

Each attempt to shortcut the path was realised as a single connect run (see Chapter 2) seeded with two minima $\alpha ,\beta \in \xi$ separated by a gap of length $\Delta$ along the path. If the fastest path $a←b$ found by Dijkstras algorithm was different (not necessarily new) from the one that was currently being perturbed the iteration was completed, this pathway was perturbed in the next iteration and parameter $\Delta$ was reset to $1$. Otherwise, $\Delta$ was incremented by one, unless $\Delta =l\left(\xi \right)$ in which case the calculation was terminated.