Implement tree permutation
The paper of Louxin Zhang describes optimal algorithms for routing with permutations on trees. Implement the fastest 3/2n + O(log n) algorithm and/or the simpler 2n algorithm
Sources: https://epubs.siam.org/doi/pdf/10.1137/S0895480197323159