Change PathTree to EquationTree with specific types of labels and vertices