add method to caculate the fareast distance in the tree between two nodes