Optimization all pair

How to optimize all pair on one test or by any tool .. any one know the way .. i am ready to pay for that