Improve the algorithm by adding another recursion dimension.
Speed up : use only the top k most frequent patterns and the top k least frequent.