a top to bottom fashion eliminating the backtracking step and reducing its computational complexity. While there is no exact analytical expression for the computational complexity of the backtracking algorithm, a loose upper bound of the backtracking algorithm is $\mathcal{O} (n!)$, which we bring down to $\mathcal{O}(n^2)$ with our new proposal. The lower bound is of the order of $\mathcal{O}(n)$ for both algorithms. The algorithm relies on a novel graphical representation of the data as a tree structure. We note that this tree is related to the definition of the directed acyclic graph (DAG) used in [@pal19], with some important differences. The DAG depends on [**g**]{} whereas the tree we introduced is solely a function of the data. This implies that we need to define it only once. Also, the DAG groups sequences differently since it does not incorporate sampling time information.

The rest of the paper proceeds as follows. In Section \[sec:hettaj\], we define the Tajima heterochronous $n$-coalescent. In Section \[lik\], we introduce the mutation model we shall assume, describe the data, define the likelihood and the new algorithm to compute it. Section \[mcmc\] describes the MCMC algorithm for posterior inference, and in Section \[sim\], we present a comprehensive simulation 