Implement the algorithm of TreeMiner