An algorithm to represent inbreeding trees
DDiversity in endogamy: an algorithm to representinbreeding trees
C. Jarne a , F. A. G´omez Albarrac´ın b , M. Caruso c a Universidad Nacional de Quilmes, Departamento de Ciencia y Tecnolog´ıa CONICET b Instituto de F´ısica de L´ıquidos y Sistemas Biol´ogicos (IFLYSIB), UNLP-CONICET, LaPlata, Argentina and Departamento de F´ısica, Facultad de Ciencias Exactas, UniversidadNacional de La Plata; Departamento de Ciencias B´asicas, Facultad de Ingenier´ıa, UNLP c Departamento de Estad´ıstica e Investigaci´on Operativa, Universidad de Granada,Campus de Fuentenueva, Espa˜na
Abstract
Recent work has proven the existence of extreme inbreeding in a Euro-pean ancestry sample taken from the contemporary UK population [1]. Thisresult brings our attention again to a math problem related to inbreedingfamily trees and diversity. Groups with a finite number of individuals couldgive a variety of genetic relationships. In the present work, we present thiskey question: given a particular number of ancestors at each generation, howmany different hypothetical trees can be constructed? Building upon ourprevious works, we propose an approach to estimate this number. Giventhat this number is quite large, we also address the non-trivial issue of treerepresentation. We present an open-source python code to generate the treegraph and the adjacency matrix for each different tree representation. Weshow how this mapping reflects the diversity in the different tree represen-tations, and how valuable information may be extracted upon inspection ofthese matrices. The code presented here, available in Git-Hub, may be eas-ily modified to be applied to other areas of interest involving connectionsbetween individuals, such as models of opinion spread.
Keywords: inbreeding, ancestors’ trees, graph representation, adjacencymatrix, open source algorithm
Email address: [email protected] (C. Jarne)
Preprint submitted to Arxiv September 24, 2020 a r X i v : . [ q - b i o . P E ] S e p . Introduction Several studies were conducted regarding the inbreeding strategy of dif-ferent animals. They have reported from inbreeding tolerance in for differentspecies [2, 3] to inbreeding preference for some of them [4]. Recent studieshave also found evidence of regular incest behavior in wild mammals [5].Even more interesting is the fact that the existence of extreme inbreedingin humans was also detected when considering a European ancestry sample,taken from the contemporary UK population [1].Motivated by the new evidence, and based on the ideas and the modelpresented in previous works [6, 7, 8], here we address the question of howanimal species (including humans) may achieve diversity when having in-breeding at the same time. In our previous studies, we simulated randomtrees of ancestors considering inbreeding along the tree. In previous workdone by some of the authors (Ref.[8]), to build the tree, generations wereadded of it in a markovian way. The number of ancestors, for a given gen-eration, was a random quantity limited to a maximum value given by thecase where all ancestors were different. In that approach, the only constraintconsidered in the number of ancestors was random blood relationships be-tween individuals of the same generation. Other restrictions in the numberof ancestors related to culture, in the human case, ethological in the animalcase, or regarding isolation of populations, were not taken into account.From a mathematical point of view, it was possible to calculate the firsttwo cumulants of the probability distribution of ancestor number at eachgeneration. This was possible through the development of new methods todescribe the underlying stochastic process.In the present work, we deepen our previous studies. We now addressdiversity in terms of all possible links between the ancestors in the tree.First, we count how many different inbreeding cases are, in terms of treeconnections, for a fixed number of available individuals at a given generation.We find that even for a few generations, this number is quite large. Motivatedby this, we present an algorithm that produces different tree representationsrandomly, for a fixed number of individuals per generation, chosen by theuser. The number of individuals in each generation may also be previouslyfixed by the user. The algorithm, in this case, takes into account the gender ofthe individuals, supposing a binary female/male reproduction scheme (whichcan be changed by the user), ensuring that each individual has one femaleand one male direct ancestor. We also present a mapping from the tree2epresentation to an adjacency matrix. We show how these matrices capturethe diversity from the trees and are very useful tools to represent the linksbetween generations. The code will be available online, and it can be easilyused and modified.The manuscript is organized as follows. In Section 2, we present the al-gorithmic representation of the tree and introduce the necessary notation.The mathematical treatment of the number of possible tree representationsis presented in Section 3. Section 4 shows the description of the algorithmand computational implementation. The adjacency matrix representation isdiscussed in Section 5. In that section, we profit from the flexibility of thecode presented in this work to generate different cases of trees and commenton their different characteristics in the adjacency matrix representation. Fi-nally, we close in Section 6 with conclusions and discuss future work.
2. A possible tree representation
In this section, we will describe how we consider and build different rep-resentations of trees with inbreeding, and mention the notation we will usein the rest of this work. We will consider only binary animal reproduction(although the algorithm that will be described in Section 4 can be adapted toconsider other types of interaction). In our case, we will distinguish betweentwo reproductory genders, male and female, and for each individual in eachgeneration, a female and a male direct ancestors are required. We call a “fullbinary tree” that one without endogamy and where there are no “siblings”,individuals have no common ancestors. An example of a 7 generation tree isshown in Figure 1.Now, we proceed to construct one possible tree representation. To dothis, we start from the full binary tree. To uniquely identify each individual,we assign each of them a number and distinguish males and females withodd and even numbers, respectively. We then proceed to remove in eachgeneration as many nodes as indicated by the simulation presented in ourprevious work [8]. The labels to be removed, in each generation, are chosenat random. The gender of the removed individuals is chosen in such a waythat we keep close to 50% individuals of each gender (this may be changedin the code presented here if necessary).Regarding notation used in present work: we call A n the totalnumber ofancestors at the n − generation given by the simulation presented in [8]. The3 igure 1: Full binary tree. Each ancestor is represented with a node. Pink nodes labeledwith even numbers represent female animals. Green nodes with odd numbers representmale animals. The tree starts from the present generation at the bottom, to the seventhgeneration in the past. At the lasts generations, nodes are overlapping on the plot due tothe large number of them. removed ancestors at n − generation will be called (cid:101) A n [9], in the way describedby the following equation A n = 2 n − (cid:101) A n , (1)where n = 1 , · · · , N , 2 n is the number of individuals at the n − th gen-eration in a full binary tree, and A = 2, or equivalently (cid:101) A = 0.In Figure 2, we show the resulting tree, obtained after subtracting thenodes from the binary graph. Due to this process, some of the individualswill lose the links which represent the “progenitor-offspring” relationshipbetween generations. In Figure 2 we indicate different types of missing linksin the nodes. The goal now is to distribute all the missing links betweengenerations among the current nodes. These nodes will be the progenitors of4hose members who lost a link in the tree when removing individuals. Thesenew links represent inbreeding relationships, since they will not follow thefull binary tree. Figure 2: Example of a tree where some of the ancestors (nodes) have been removedrandomly from a full binary tree like the one shown in Figure 1. Pink nodes labeled witheven numbers represent females, green nodes with odd numbers represent males. This isthe first step to build the inbreeding tree representation. Nodes missing different types oflinks are indicated.
Therefore, the next step to obtain one realization of the ancestor tree isto generate an algorithm that includes a criterion to distribute the nodesin such a way that each member of the tree has both a female and a maledirect ancestor (since we consider only binary reproduction). In this work,the criterion that we applied was to choose the remaining nodes (ancestors)at random to be linked to the nodes in the following generation. We takeinto account the label of the ancestor to complete for each node one directancestor of each type, and in such a way that every node is connected toboth the previous and the next generation (except of course those from thefirst and the last generations). This criterion may be changed in the code5f needed. As a result, we obtained a graph like the one shown in Figure 3.Clearly, this is only one possible realization of a tree with seven generations,and the numbers of individuals per generation shown in the figure. In thefollowing section, we address the question of how many possible trees can beconstructed fixing the number of members at each level.
Figure 3: Example of a tree where some ancestors (nodes) have been removed, and thelinks between the remaining ancestors were added. As before, pink nodes labeled witheven numbers represent females, green nodes with odd numbers represent males. Thisgraph is one possible representation of inbreeding between individuals.
3. Diversity of trees with a fixed number of ancestors
In section 2, we built one of the possible trees given the number of maleand female ancestors in each generation. Now we will count all possible anddifferent trees, meaning all the different kin relations between the individualsof the tree. In terms of Figure 2, this means all the possible graphs (suchas Figure 3) that we can obtain with labeled ancestors with all the differentlinks distribution. 6o start the procedure let’s suppose that this tree has N generations, weremove from the tree the value of (cid:101) A n ancestors in each generation n , includingmale (cid:101) M n and female (cid:101) F n , in a way that: (cid:101) A n = (cid:101) F n + (cid:101) M n (2)Let’s also remember that A n = 2 n − (cid:101) A n , where this equation allows us tocompare the value of removed ancestors with the binary tree.Now we considered the n − generation. We call µ n the number of indi-viduals in the tree without mother, ϕ n the number of individuals without afather, and π n the number of individuals lacking both, mother and father.We know that if we count the number of individuals without one or twodirect ancestors, we have the following constraints defined by Equation (3)and (4). Let’s consider first Equation (3): µ n + π n = (cid:101) F n +1 , (3)this is because the number of individuals in the tree without a femaledirect ancestor, or lacking both direct ancestors must be equivalent to allthe links that were lost when subtracting (cid:101) F n +1 female nodes in the previousgeneration.In other words, the number of individuals without mother in the n − generationplus the number of individuals lacing of mother and father is equal to thenumber of females substracted in the ( n +1) − generation. Following the samereasoning for males, we obtain: ϕ n + π n = (cid:101) M n +1 , (4)Also equivalent to all the links that were lost, when subtracting (cid:101) M n +1 male nodes in the previous generation.If we want to compare with a binary tree, meaning one ancestors treewithout inbreeding, we know that the number of female and male ancestorsin a given n generation is half of each one, as shown in Equation (5).2 n = 2 n − + 2 n − (5)Now we use Equation (1) with equation (2) to split and count how manyavailable male ( M n ) and female ( F n ) we have, to distribute kinship repre-sented by the links in the graph. 7 n = 2 n − − (cid:101) M n (6) F n = 2 n − − (cid:101) F n (7)where M = 1 = F , or equivalently (cid:101) M = 0 = (cid:101) F .We now have all that we need to count how many different ways we haveto distribute the link between the actual available males and females.Let’s consider first the case where we distribute all ancestors in the ( n +1) − generation in a way that every ancestor in the n − generation is linkedto different nodes till the point that we have no more different nodes inthe ( n + 1) − generation to assign. Now, we count how many different wayswe have to distribute the missing links between the consecutive generations,repeating direct ancestors (i.e. an individual from the ( n + 1)-generationhas more than one link to the next generation). As a consequence, someindividuals will be “siblings” or “half-siblings”.The total number of different ways to distribute all the females at the( n + 1)-generation between the individuals without a female direct ancestor µ at the n − generation, T µ ( n ), comes from Equation (8). T µ ( n ) = µ n (cid:89) i =1 C ( F n +1 , , (8)where C ( F n +1 ,
1) denotes the combinatorial number of 1 element (onefemale progenitor) from a given set of F n +1 elements (potential female pro-genitors) and the index i corresponds to the individuals in n − generationwithout a female direct ancestor.Now, we proceed in the same way for the males: we count the waysto distribute all the males at the ( n + 1)-generation between the individu-als without a male direct ancestor ϕ at the n − generation, T ϕ ( n ), given byequation (9). T ϕ ( n ) = ϕ n (cid:89) j =1 C ( M n +1 , , (9)where C ( M n +1 ,
1) denotes the number of the combination of one element(one male) from a given set of F n +1 elements (potential male progenitors)8nd the index j corresponds to the individuals in n − generation without amale direct ancestor. Finally, we distribute the female and male potentialdirect ancestors between the individuals without any progenitor in equation(10): T µ,ϕ ( n ) = π n (cid:89) k =1 C ( M n +1 , C ( F n +1 , , (10)where the index k corresponds to the individuals in n − generation withoutwithout any links to the previous generation π . In this way, the full problemconsists of counting with repetitions all the possible combinations to dis-tribute the links between all the individuals without one or two progenitors,by the following simple multiplication: T ( n ) = T µ ( n ) · T ϕ ( n ) · T µ,ϕ ( n ) (11)In this way, Equation (11) shows all the possible different combinations forinbreeding links between two generations (a sub-graph). For every possiblecombination in one generation, there is a different path in the consecutivegeneration n + 1. For a tree whose total number of generations equals to N ,the different possible inbreeding trees, T N , is given by Equation (12): T N = N (cid:89) n =1 T ( n ) (12)We know that for x ∈ N : C ( x,
1) is equal to x , thus we can replace inEquation (12) the combinatorial number in each term: T N = N (cid:89) n =1 (cid:32) µ n (cid:89) i =1 F n +1 ϕ n (cid:89) j =1 M n +1 π n (cid:89) k =1 M n +1 F n +1 (cid:33) (13)And also we know that (cid:81) Ll =1 S = S L , if S and l are independent, thusthe Equation (13) can be rewritten as: T N = N (cid:89) n =1 ( F n +1 ) µ n ( M n +1 ) ϕ n ( M n +1 F n +1 ) π n (14)Rearranging we obtain: 9 N = N (cid:89) n =1 ( M n +1 ) π n + ϕ n ( F n +1 ) π n + µ n (15)It is useful to write Equation (15) in terms of the number of subtractedmales and females, and also in terms of the binary tree. We can use use therelations given by Equations (6) and (7): T N = N (cid:89) n =1 (2 n − (cid:101) M n +1 ) π n + ϕ n (2 n − (cid:101) F n +1 ) π n + µ n (16)Finally if we use the constraint given by Equations (3) and (4) we obtain: T N = N (cid:89) n =1 (2 n − (cid:101) M n +1 ) (cid:101) M n +1 (2 n − (cid:101) F n +1 ) (cid:101) F n +1 (17)Equation (17) gives us the analytical way to count all possible inbreedingtrees (graphs) for a fixed number of ancestors, given that we know how manymales and females are not present in the ancestor’s tree (compared to thefull binary tree) for a tree with N generation.If we want to consider what happens when we change the rate of sub-tracted male and female, we have to add all possible combinations of (cid:101) M k +1 + (cid:101) F k +1 that gives the same value of subtracted ancestors.As we can see from Equation (17), this number could be very large. Wecan observe from the equation clearly that this number diverges when weincrease the number of generations of the tree.For example for a tree of 7 generations, as the one that we consideredin the previous section, we can obtain the order of 1 . × different rep-resentations. Clearly, to generate and explore different representations anumerical method is needed. In this direction, we introduce an algorithmdescribed in the next section to randomly generate representations for a treewith N generations. As we will discuss later, this code is flexible and allowsdifferent possibilities: one can build possible representations for an N gen-eration tree with a fixed number of trees per generation, or fix the numberof individuals and distribute them among N generations, or among more (orless) generations, etc., depending on the interest of the user.10 . Methods: Algorithm description The algorithm to construct one realization for the tree of ancestors withinbreeding starts with a full binary tree first (in terms of code, it is a listof nodes and links). In this tree, each member has an associated tag (anumber).We go over the description from Section 2 in detail, which we representin Figure 4:1. We start from a full binary tree with a given number of generations2. From the full binary tree, we remove as many individuals as our sim-ulation indicates [8]. Our first models had no distinction (here in thecase of binary reproduction that distinction is the gender, but the codecan be adapted for other situations). Now, we have to take a criterionlike the one described in the previous sections to take into account howmany labels or tags representing each gender we will extract. Herewe choose this randomly, with the constraint that the number of bothtypes of individuals remains the same.3. After choosing a criterion, as some nodes were extracted, the links in-volving them disappear. Therefore, we must also take a criterion todistribute the missing links, to obtain one of all the possible represen-tations. The criteria used to ensure that each node has a direct ancestorof each gender is as follows: we go over each of the generations of thetree except the last one. In each generation, we analyze one by oneeach node. In each node of the generation, we observe how many linksarrive, and if these links came from a female or male gender label. Withthis information we decide what to do:(a) If there is no link arriving at the node from the previous generationwe randomly choose a node of the previous one to be its ancestor.(b) If there is a link from the node of the previous generation, we checkthe label from this ancestor and randomly choose an individualfrom that generation among those with the opposite label.(c) If the node considered already has the 2 links, we do not addanything.When we finish, we move to the next generation and repeat the process,thus going through the entire tree.In this way, we can obtain one representation, like the one shown atthe left of Figure 4. 11 igure 4: A sketch of the steps of the algorithm to obtain a possible tree representation.
As we have mentioned, there are multiple ways to distribute the linksbetween generations among the existing nodes. In this way, trees with verydifferent kinship relationships can be created, keeping the same amount ofancestors.To build the representation the program needs as input the number ofancestors per generation. This number may be obtained using the code pre-sented in Ref.[8], or fixed at will. With this information, the program plotsone representation. The output of the program is: i) one of all possiblegraphs for the tree ii) its corresponding adjacency matrix, and node distri-butions [10], which we present and discuss in the next section. Also, withthe number of ancestors, the program estimates the number of possible treesconfigurations following the estimation explained in Section 3.Our representation depends on the number of ancestors in each generationand gender labels, also depend on the seed we put in the random numbergenerator. Different seed values give rise to different representations likethose observed in Figure 5.Code to obtain the tree representation was developed using Python [11]and Networkx [12]. It will be available at the Github repository to be usedand modified freely. 12 igure 5: Four possible different realizations of 7-generation trees for the same number ofancestors in each generation.
5. Graph properties of the Tree
Let us consider the adjacency matrix for a simple graph with vertex set V . It is a square | V | × | V | matrix MMM where the element M ij is 1 whenthere is a edge from the i − vertex to the j − vertex, and 0 when there is noedge [10], where | V | is the number of elements of V . We use this definitionwith the matrix of each directed graph representing the tree in such a waythat columns represent the relationships between generations. Each columnalways has two non-null elements representing each progenitor. Each rowindicated how many nodes from the next generation are linked to a certainnode. The vertical axis represents the nodes as ancestors and the horizontalaxis as offspring. 13 igure 6: Left panel: Adjacency matrix of a full binary tree. Right panel: Adjacencymatrix of the inbreeding tree from Figure 3. The case of a binary tree is represented at the left of Figure 6. Let uscompare it with what happens when we have an inbreeding tree, such asthe one obtained in Figure 3, which we show at the right of 6. In the firstcase, no inbreeding is reflected by the yellow line (which has slope 2), wherenone of the nodes share a progenitor. In the second case, it is interesting toobserve that the yellow points separate from the slope corresponding to thedi-graph, creating a unique distribution pattern. Adjacency matrix could beused as a useful measure of the degree of inbreeding with respect to the fullbinary tree.The adjacency matrix (lower panel of Figure 6) acts as a fingerprint ofeach of our tree realizations. For each graph, the plot of the adjacency matrixis unique. To illustrate this point, Figure 7 shows the adjacency matricescorresponding to the trees presented in Figure 5. Each of them is different,and so are their corresponding graphs. In all the matrices, the number ofancestors at the beginning of the tree is low. As a result, a flattening of thecurve appears as the number of the generation increases. The red rectanglesindicate yellow points that must necessarily belong to the same generation.The cyan rectangles at the bottom of the graphs indicate the first and secondgeneration from the trees, using the fact that we started from a binary tree.These show that these graphs also indicate the number of generations from14 igure 7: Adjacency matrices corresponding to the trees presented in Figure 5. In theseplots, the distinctive imprint of each tree can be seen more clearly in the distributions ofyellow dots on the dark background. The red rectangles indicate dots that must be in thesame generation. The cyan rectangles, at the bottom fo the matrices, belong to the firstand second generation. each tree: it is simply the number of rectangles. It can be seen more clearlyfrom these plots that, even though the number of ancestors is the same, theedges in the tree are distributed differently. This is reflected in the differentdistribution of yellow points in the rectangles.15n order to further explore the information displayed in the adjacencymatrices, we compare three cases: one of the trees we have already presented,a 7-generation tree with the same total number of nodes but a differentdistribution, and a 9-generation tree with the same number of nodes. Thematrices and the trees are shown in Figure 8. First, it can be clearly seen thatthe graph from panel (c) corresponds to a tree with more generations. Then,comparing panels (a) and (b) we can see that, for example, the tree associatedwith the matrix in panel (b) must have more nodes in the last generation.This further illustrates the usefulness of this graphic representation.
Figure 8: Comparison of different adjacency matrices for three different trees (shown beloweach matrix) with the same number of nodes. Panels (a) and (b) correspond to 7-generationtrees with the same number of nodes but different distribution in the generations. Panel(c) corresponds to a 9-generation tree. The red rectangles indicate yellow dots that mustbelong to the same generation.
Finally, it is interesting to study other properties of the graph, such asthe degree of connectivity of the nodes. By studying the distribution of theoutput degree of the nodes, we can observe that there is inbreeding, as it isshown in Figure 9. Here, we plot a histogram of the number of descendantsassociated with each node for two cases: on the left, the tree presented inFigure 3, and on the right, for the 9-generation tree with the same numberof nodes shown in Figure 8. From the Figure, we can see that in the case of16he 7-generation tree, the majority of the nodes have one child, some of themhave two, and only a minority have more than 5. For the 9-generation tree,the histogram is flatter and broader. This is associated with the fact thatsince this tree has the same number of nodes than a 7-generation tree, moreedges are missing from a full binary tree, and therefore more nodes need tobe linked to more than one node from the next generation.In this way, we have shown how this algorithm makes it possible to obtaindifferent tree representations and explore the connectivity information ineach realization in different manners: either plotting the tree, studying theadjacency matrix or analyzing the connectivity between nodes.
Figure 9: Histograms with the number of descendants per node for two trees with the samenumber of nodes: (left) the 7-generation tree from Figure 3 and (right) the 9-generationtree from Figure 8.
6. Conclusions
In the present work, we have presented an algorithm with a softwareimplementation to build one possible ancestors’ tree with its correspondinggraph. On the other hand, we analytically estimated the number of differenttrees that can be obtained for the same number of ancestors then applied ourestimation to a seven-generation model. We have shown that such a numberis really large, which supports the need to use an algorithm to construct andanalyze different trees.Regarding the software implementation, this algorithm provides differenttools to study the properties of the trees and their degree of inbreeding: itproduces the tree itself, the adjacency matrix (which we have shown is auseful tool to visualize and distinguish trees), and a histogram illustrating17he degree of connectivity of the nodes. The code gives the possibility ofextending these tools to perform different types of simulations and analysis.For example, our next step would be to add attributes to the nodes thatcould be considered as genes, or maybe diseases, study the propagation ofthis feature along the tree, and compare it with the degree of inbreeding.Concerning the analytical estimation, similar reasoning can be useful foraccounting in other cases where nodes with some attributes are subtracted.In this way, we have shown how, from a simple ancestor distributionmodel, we can study the family of corresponding graphs with different edgesfor the trees. This situation constitutes an interesting example of how, froma small set of elements or individuals, an enormous diversity of cases can beobtained. In this way, we suggest that even small inbred groups could stillgive rise to different genetic variability.Finally, the code presented in this work is open source and easily adaptedto study other situations relevant to current studies such as opinion spreadmodels, disease propagation, etc. We are thus certain that it will prove tobe a useful tool for future studies.
Acknowledgments
Present work was supported by CONICET and UNQ. F. A. G. A. issupported by SECyT UNLP and PICT 2018-02968. This work was finishedduring the Covid-19 quarantine.
References [1] L. Yengo, N. Wray, P. Visscher, Extreme inbreeding in a european an-cestry sample from the contemporary uk population, Nat Commun 10. doi:10.1038/s41467-019-11724-6 .[2] I. , Jamieson, S. S. Taylor, L. N. Tracy, H. Kokko, D. P. Armstrong,Why some species of birds do not avoid inbreeding: insights from newzealand robins and saddlebacks, Behav. Ecol. 20 20 (2009) 575584. doi:https://doi.org/10.1016/j.tree.2012.10.016 .[3] E. Rioux-Paquette, M. Festa-Bianchet, D. W. Coltman, No in-breeding avoidance in an isolated population of bighorn sheep,Animal Behaviour 80 (5) (2010) 865 – 871. doi : https ://doi.org/10.1016/j.anbehav.2010.08.006 doi:https://doi.org/10.1016/j.tree.2012.10.016 .[5] H. Nichols, M. Cant, J. Hoffman, J. Sanderson, Evidence for frequentincest in a cooperatively breeding mammal, Biol Lett 10. doi:10.1098/rsbl.2014.0898 .[6] M. Caruso, C. Jarne, Equivalent markov processes under gauge group,Phys. Rev. E 92 (2015) 052132. doi:10.1103/PhysRevE.92.052132 .URL https://link.aps.org/doi/10.1103/PhysRevE.92.052132[7] M. Caruso, C. Jarne, Markov-chain approach to the distribution of an-cestors in species of biparental reproduction, Phys. Rev. E 90 (2014)022125. doi:10.1103/PhysRevE.90.022125 .URL https://link.aps.org/doi/10.1103/PhysRevE.90.022125[8] C. Jarne, M. Caruso, Markovian simulation for ancestors trees, Com-munications in Nonlinear Science and Numerical Simulation 72 (2019)1 – 15. doi:https://doi.org/10.1016/j.cnsns.2018.12.004 ppendix A. Code implementation
Code will be avaliable at the github repository upon publication: https : //github.com/katejarne/Ancestors trees//github.com/katejarne/Ancestors trees