Here we adopt a standard notation (pseudocode) fordefining algorithms [33, 154]. Assignment of a valueto a variableis denoted by. The branchingprobabilityis representedasif it is stored inmatrix form, and asif it is stored in the form of adjacency lists.
Algorithm B.1:Calculate the pathway sum
Require: Chain nodes are numbered Require: Require: Require: is the probability of branching from node to node 1:ifthen 2: ; ; 3:else 4: ; ; 5:endif 6: 7:for alldo 8: 9:endfor 10: 11:for alldo 12: 13: 14:endfor 15: 16:for alldo 17: 18:endfor 19:return
Algorithm B.2:Calculate the pathway sum
Require: Require: Require: is a boolean array of size with every element initially set to True Require: is the number of True elements in array (initialised to ) Require: is the probability of branching from node to node Require: and are the lists of indices of all nodes connected to node via incoming and outgoing edges, respectively Recursive function 1: False 2: 3:if and then 4: 5:else 6: 7:for alldo 8:for alldo 9:if and then 10: 11:endif 12:endfor 13:endfor 14: 15:ifthen 16: 17:for alldo 18:if W[i] then 19: 20:endif 21:endfor 22: 23:endif 24:endif 25: True 26: 27:return
Algorithm B.3:Calculate the pathway sum from every source to every sink, and the mean escape time for every source in a dense graph
Require: Nodes are numbered Require: Sink nodes are indexed first, source nodes - last Require: is the index of the first intermediate node Require: is the index of the first source node Require: In case there are no intermediate nodes , otherwise Require: Require: Require: is the waiting time for node , Require: is the probability of branching from node to node 1:for alldo 2:for alldo 3:ifthen 4: 5:for alldo 6:if and then 7: 8:endif 9:endfor 10: 11:endif 12:endfor 13:for alldo 14: 15:endfor 16:endfor 17:for alldo 18:for alldo 19:if and then 20: 21: 22: 23: 24: 25:for alldo 26: 27: 28: 29:endfor 30: 31: 32:endif 33:endfor 34:endfor
Algorithm B.4:Detach node from an arbitrary graph
Require: Require: Require: is the waiting time for node Require: is the ordered list of indices of all nodes connected to node via outgoing edges Require: is the cardinality of Require: is the index of the th neighbour of node Require: is the ordered list of probabilities of leaving node via outgoing edges, Require: is the probability of branching from node to node 1:for alldo 2: 3: 4:for alldo 5:ifthen 6: 7:break 8:endif 9:endfor 10:if not then 11: 12: 13: 14: 15:for alldo 16: 17:if not then 18:if exists edge then 19:for alldo 20:ifthen 21: 22:break 23:endif 24:endfor 25:else 26: 27: 28:endif 29:endif 30:endfor 31:for alldo 32: 33:endfor 34: 35:endif 36:endfor