Algorithms and computer implementations